Quellcode durchsuchen

Switch back to liner sprite when arena removed

DricomDragon vor 4 Jahren
Ursprung
Commit
8277de0dc1
2 geänderte Dateien mit 5 neuen und 0 gelöschten Zeilen
  1. 3 0
      Scenes/Player.tscn
  2. 2 0
      Scripts/Player.gd

+ 3 - 0
Scenes/Player.tscn

@@ -36,5 +36,8 @@ __meta__ = {
 
 [node name="Tween" type="Tween" parent="."]
 script = ExtResource( 2 )
+[connection signal="arena_removed" from="." to="Crash" method="hide"]
+[connection signal="arena_removed" from="." to="Liner" method="show"]
 [connection signal="body_entered" from="." to="." method="_on_crash"]
 [connection signal="crash" from="." to="Crash" method="show"]
+[connection signal="crash" from="." to="Liner" method="hide"]

+ 2 - 0
Scripts/Player.gd

@@ -2,6 +2,7 @@ extends Area2D
 # Handle player logic and events
 
 signal crash
+signal arena_removed
 
 enum Direction {
 	UP = 0
@@ -73,6 +74,7 @@ func _on_round_won():
 func _on_arena_removed():
 	grid = null
 	landed = false
+	emit_signal("arena_removed")
 
 
 func _on_tween_completed(_o, key):