TUBES NOW SHOOT UP, A BASKED NOW CATCHES YOU

This commit is contained in:
Derek
2025-03-30 18:44:54 -05:00
parent 757b2df6b3
commit e1ac78d927
17 changed files with 461 additions and 116 deletions

View File

@@ -1,8 +1,25 @@
extends Area3D
class_name LevelBounds
var level_collision_shapes : Array[CollisionShape3D]
var check_collision = true
func _ready() -> void:
for i in get_children():
if i is CollisionShape3D:
level_collision_shapes.append(i)
func _on_body_exited(body: Node3D) -> void:
var level_control = get_tree().current_scene
if level_control.gamemode.die_on_leaving_bounds == true:
get_tree().current_scene.die()
else:
body.global_position = body.last_ground_pos + Vector3(0,10,0)
if check_collision == true:
var level_control = get_tree().current_scene
if level_control.gamemode.die_on_leaving_bounds == true:
get_tree().current_scene.die()
else:
body.global_position = body.last_ground_pos + Vector3(0,10,0)
func toggle_collision(collision_state):
print("COLLISION STATE: ",collision_state)
check_collision = collision_state
if level_collision_shapes != null and level_collision_shapes != []:
for i in level_collision_shapes:
i.disabled = collision_state