Code cleanup and minor fixes to Level 3
This commit is contained in:
@@ -13,7 +13,7 @@ signal gem_collected
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
pass # Replace with function body.
|
||||
pass # Replace with function body.
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
@@ -22,12 +22,12 @@ func _ready() -> void:
|
||||
|
||||
|
||||
func _on_Player_Detector_area_entered(area: Area2D) -> void:
|
||||
if area.get_parent().name == 'Player':
|
||||
if is_opened == false:
|
||||
$chestClosed.visible = false
|
||||
$chestOpened.visible = true
|
||||
$Gem.visible = true
|
||||
$Gem/AnimationPlayer.play('rise')
|
||||
is_opened = true
|
||||
has_gem = false
|
||||
emit_signal('gem_collected')
|
||||
if area.get_parent().name == 'Player':
|
||||
if is_opened == false:
|
||||
$chestClosed.visible = false
|
||||
$chestOpened.visible = true
|
||||
$Gem.visible = true
|
||||
$Gem/AnimationPlayer.play('rise')
|
||||
is_opened = true
|
||||
has_gem = false
|
||||
emit_signal('gem_collected')
|
||||
|
Reference in New Issue
Block a user