From fbb81024ea206bfad1436e27f49175a815b010b7 Mon Sep 17 00:00:00 2001 From: nokoe Date: Sat, 22 Jun 2024 18:14:27 +0200 Subject: update multiplayer, add take, put --- client/scripts/tiles/full_tile.gd | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'client/scripts/tiles/full_tile.gd') diff --git a/client/scripts/tiles/full_tile.gd b/client/scripts/tiles/full_tile.gd index 7ee1e1fc..bdcca61c 100644 --- a/client/scripts/tiles/full_tile.gd +++ b/client/scripts/tiles/full_tile.gd @@ -2,6 +2,7 @@ class_name FullTile extends Floor var static_body = StaticBody3D.new() +var item: Node3D = null func _init(rename: String, neighbors: Array): super(rename, neighbors) @@ -21,3 +22,13 @@ static func interact_target() -> Vector3: # actions when interacting, e.g. animations func interact(): pass + +func put_item(i: Node3D): + if item != null: + push_error("already holding an item") + item = i + +func take_item() -> Node3D: + var i = item + item = null + return i -- cgit v1.2.3-70-g09d2