Added door closing. Fixed death in the air

This commit is contained in:
2026-01-08 00:04:41 +03:00
parent 1ac74e7793
commit e3d0dfb674
10 changed files with 244 additions and 24 deletions
+9
View File
@@ -2,17 +2,26 @@ class_name ClosedDoor
extends Door
var _unlocked := false
func _is_key(_node: Node) -> bool:
return false
func _can_open(body: Node2D) -> bool:
if _unlocked: return true
if not body.has_node("Pickups"): return false
if not body.has_method("remove_pickup"): return false
for pickup in body.get_node("Pickups").get_children():
if _is_key(pickup):
body.remove_pickup(pickup)
_unlocked = true
return true
return false
func _can_close(_body: Node2D) -> bool:
return _unlocked