mirror of
https://git.kittycat.homes/zoe/codename-routes.git
synced 2024-08-15 03:18:26 +00:00
fuck around with native script
This commit is contained in:
parent
c8046a6e85
commit
3317db5211
8 changed files with 115 additions and 9 deletions
8
godot/world/StateApi.gd
Normal file
8
godot/world/StateApi.gd
Normal file
|
@ -0,0 +1,8 @@
|
|||
extends Node
|
||||
|
||||
var server = preload("res://native/StateServer.tscn").instance()
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
add_child(server)
|
||||
print(server.a)
|
||||
server.foo()
|
16
godot/world/state_server.gd
Normal file
16
godot/world/state_server.gd
Normal file
|
@ -0,0 +1,16 @@
|
|||
extends Node
|
||||
|
||||
|
||||
# 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.
|
||||
#func _process(delta):
|
||||
# pass
|
|
@ -3,10 +3,13 @@
|
|||
[ext_resource path="res://world/terrain/terrain.tres" type="TileSet" id=1]
|
||||
[ext_resource path="res://world/terrain.gd" type="Script" id=2]
|
||||
[ext_resource path="res://world/worldcam.gd" type="Script" id=3]
|
||||
[ext_resource path="res://world/state_server.gdns" type="Script" id=4]
|
||||
[ext_resource path="res://world/StateApi.gd" type="Script" id=5]
|
||||
|
||||
[node name="World" type="Node2D"]
|
||||
|
||||
[node name="StateApi" type="Node" parent="."]
|
||||
script = ExtResource( 5 )
|
||||
|
||||
[node name="terrain" type="TileMap" parent="."]
|
||||
position = Vector2( -2, 0 )
|
||||
mode = 1
|
||||
|
@ -27,6 +30,3 @@ format = 1
|
|||
current = true
|
||||
zoom = Vector2( 0.4, 0.4 )
|
||||
script = ExtResource( 3 )
|
||||
|
||||
[node name="state_server" type="Node" parent="."]
|
||||
script = ExtResource( 4 )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue