initial commit
This commit is contained in:
35
godot/entries/main.gd
Normal file
35
godot/entries/main.gd
Normal file
@@ -0,0 +1,35 @@
|
||||
extends Spatial
|
||||
|
||||
|
||||
# Declare member variables here. Examples:
|
||||
# var a = 2
|
||||
# var b = "text"
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
pass
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
var delay = 0.5
|
||||
var existing = false
|
||||
func _process(delta):
|
||||
delay -= delta
|
||||
if delay < 0:
|
||||
if !existing:
|
||||
create_ch()
|
||||
delay = 10.0
|
||||
existing = true
|
||||
else:
|
||||
destroy_ch()
|
||||
delay = 3.0
|
||||
existing = false
|
||||
var char_id = -1
|
||||
|
||||
func create_ch():
|
||||
char_id = Character.create_character(0)
|
||||
|
||||
func destroy_ch():
|
||||
print(char_id)
|
||||
Character.destroy_character(char_id)
|
||||
char_id = -1
|
||||
25
godot/entries/main.tscn
Normal file
25
godot/entries/main.tscn
Normal file
@@ -0,0 +1,25 @@
|
||||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[ext_resource path="res://entries/main.gd" type="Script" id=1]
|
||||
|
||||
[sub_resource type="ProceduralSky" id=2]
|
||||
|
||||
[sub_resource type="Environment" id=3]
|
||||
background_mode = 2
|
||||
background_sky = SubResource( 2 )
|
||||
|
||||
[sub_resource type="PlaneMesh" id=1]
|
||||
size = Vector2( 200, 200 )
|
||||
|
||||
[node name="main" type="Spatial"]
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="Camera" type="Camera" parent="."]
|
||||
transform = Transform( 1, 0, 0, 0, 0.969497, 0.245104, 0, -0.245104, 0.969497, 0, 1.36901, 1.55894 )
|
||||
environment = SubResource( 3 )
|
||||
|
||||
[node name="MeshInstance" type="MeshInstance" parent="."]
|
||||
mesh = SubResource( 1 )
|
||||
|
||||
[node name="DirectionalLight" type="DirectionalLight" parent="."]
|
||||
transform = Transform( 1, 0, 0, 0, 0.528512, 0.848926, 0, -0.848926, 0.528512, 0, 20, 0 )
|
||||
Reference in New Issue
Block a user