Now About Social Code
summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorLucas Fryzek <lucas.fryzek@fryzekconcepts.com>2023-09-25 18:22:55 -0400
committerLucas Fryzek <lucas.fryzek@fryzekconcepts.com>2023-09-25 18:22:55 -0400
commit73cbbef3d165519f7d76304049e0037ecaa29f85 (patch)
tree668dba8380699aa576355a9d1a2390496b34c059 /scripts
parent185de137decb12cc05c58436151456ef43ebd84e (diff)
Add seed object and ability to pickup
Diffstat (limited to 'scripts')
-rw-r--r--scripts/player.gd6
1 files changed, 5 insertions, 1 deletions
diff --git a/scripts/player.gd b/scripts/player.gd
index 7c6079b..95737ce 100644
--- a/scripts/player.gd
+++ b/scripts/player.gd
@@ -25,6 +25,7 @@ var last_wall_direction: Vector3 = Vector3()
func got_body(body: Node3D):
if current_node == null:
+ print("Got body ", body)
current_node = body
func leave_body(body: Node3D):
@@ -32,7 +33,10 @@ func leave_body(body: Node3D):
current_node = null
func pickup():
- if holding == null:
+ if current_node.collision_layer & 0b1000:
+ num_seeds += 1
+ current_node.get_parent().remove_child(current_node)
+ elif holding == null:
holding = current_node
current_node.get_parent().remove_child(current_node)
holding.position = Vector3.ZERO