Flopsy/scenes/levels/02/castle.gd

19 lines
326 B
GDScript3
Raw Permalink Normal View History

2022-07-20 04:28:30 +02:00
extends StaticBody2D
var unlocked = false
signal player_entered_castle
func _ready():
pass # Replace with function body.
func _on_Unlock(body):
if GlobalState.keys['blue'] == true:
$DoorSprite.play("open")
unlocked = true
func _on_entered_castle(body):
if unlocked == true:
emit_signal("player_entered_castle")