idk its broken :(

This commit is contained in:
zoe 2022-05-05 15:54:49 +02:00
parent 2735749baa
commit 8de6d3bdb9
9 changed files with 49 additions and 16 deletions

BIN
build/libroutes_native.so Normal file

Binary file not shown.

BIN
build/routes.x86_64 Executable file

Binary file not shown.

24
godot/export_presets.cfg Normal file
View file

@ -0,0 +1,24 @@
[preset.0]
name="Linux/X11"
platform="Linux/X11"
runnable=true
custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path="../build/routes.x86_64"
script_export_mode=1
script_encryption_key=""
[preset.0.options]
custom_template/debug=""
custom_template/release=""
binary_format/64_bits=true
binary_format/embed_pck=true
texture_format/bptc=false
texture_format/s3tc=true
texture_format/etc=false
texture_format/etc2=false
texture_format/no_bptc_fallbacks=true

Binary file not shown.

View file

@ -2,9 +2,9 @@ extends Node
onready var server = $StateServer
export var xsize = 512
export var ysize = 512
export var zsize = 124
export var xsize = 124
export var ysize = 124
export var zsize = 12
var Tilemap = preload("res://world/Tilemap.tscn")
var tilemaps = []
@ -21,5 +21,6 @@ func respawn_tilemaps(amount):
func _on_StateServer_request_init():
respawn_tilemaps(zsize - 1)
func _on_StateServer_changed_tiletypes(tile_positions):
pass
func _on_StateServer_changed_tiletypes(tile_positions: Array):
print(tile_positions[2])
print(server.get_tile_at(0,0,0))

14
godot/world/World.tscn Normal file
View file

@ -0,0 +1,14 @@
[gd_scene load_steps=4 format=2]
[ext_resource path="res://world/StateApi.gd" type="Script" id=1]
[ext_resource path="res://native/StateServer.gdns" type="Script" id=2]
[ext_resource path="res://native/StateServer.tscn" type="PackedScene" id=3]
[node name="World" type="Node"]
script = ExtResource( 1 )
[node name="StateServer" type="Node" parent="." instance=ExtResource( 3 )]
script = ExtResource( 2 )
[connection signal="changed_tiletypes" from="StateServer" to="." method="_on_StateServer_changed_tiletypes"]
[connection signal="request_init" from="StateServer" to="." method="_on_StateServer_request_init"]

View file

@ -1,8 +1,7 @@
[gd_scene load_steps=4 format=2]
[gd_scene load_steps=3 format=2]
[ext_resource path="res://native/StateServer.tscn" type="PackedScene" id=2]
[ext_resource path="res://world/World.tscn" type="PackedScene" id=1]
[ext_resource path="res://world/worldcam.gd" type="Script" id=3]
[ext_resource path="res://world/StateApi.gd" type="Script" id=5]
[node name="Main" type="Node2D"]
@ -11,10 +10,4 @@ current = true
zoom = Vector2( 0.4, 0.4 )
script = ExtResource( 3 )
[node name="World" type="Node" parent="."]
script = ExtResource( 5 )
[node name="StateServer" parent="World" instance=ExtResource( 2 )]
[connection signal="changed_tiletypes" from="World/StateServer" to="World" method="_on_StateServer_changed_tiletypes"]
[connection signal="request_init" from="World/StateServer" to="World" method="_on_StateServer_request_init"]
[node name="World" parent="." instance=ExtResource( 1 )]

View file

@ -3,6 +3,7 @@ export var min_zoom = 0.4
export var speed = 200
var zoomlevel = 0.4
func _process(delta):
move_around(delta)
handle_zoom()

View file

@ -41,7 +41,7 @@ impl StateServer {
}
#[export]
fn get_tile_at(&mut self, _owner: &Node, x: usize, y: usize, z: usize) -> &str {
fn get_tile_at(&self, _owner: &Node, x: usize, y: usize, z: usize) -> &str {
self.world.get_tile_at(x, y, z).kind_to_string()
}
}