diff options
author | metamuffin <metamuffin@disroot.org> | 2024-06-22 18:10:07 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-06-23 19:28:39 +0200 |
commit | e366cfdf9133c0da798352c474580d329c6a0f33 (patch) | |
tree | 1cb97c585cd7c457f3205cacc36cdd183883ac5f /client/scripts/map.gd | |
parent | 512ea1fce397549e2dd2f2b24adde5bc074b4ad2 (diff) | |
download | hurrycurry-e366cfdf9133c0da798352c474580d329c6a0f33.tar hurrycurry-e366cfdf9133c0da798352c474580d329c6a0f33.tar.bz2 hurrycurry-e366cfdf9133c0da798352c474580d329c6a0f33.tar.zst |
player collisions and better movement code
Diffstat (limited to 'client/scripts/map.gd')
-rw-r--r-- | client/scripts/map.gd | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/client/scripts/map.gd b/client/scripts/map.gd index 9d9453e4..01c7b66e 100644 --- a/client/scripts/map.gd +++ b/client/scripts/map.gd @@ -1,5 +1,8 @@ +class_name Map extends Node3D +var tile_by_pos: Dictionary = {} + func _ready(): Multiplayer.connect("update_map", update) @@ -48,6 +51,7 @@ func update(pos, tile_name, neighbors): instance = Floor.new(node_name, neighbors) instance.position = Vector3(pos[0], 0, pos[1]) + tile_by_pos[str(Vector2i(pos[0],pos[1]))] = instance add_child(instance) func queue_free_rename(node: Node) -> void: |