File tree Expand file tree Collapse file tree 4 files changed +13
-0
lines changed Expand file tree Collapse file tree 4 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,8 @@ func _on_MobTimer_timeout():
3333 direction += rand_range (- PI / 4 , PI / 4 )
3434 mob .rotation = direction
3535 mob .linear_velocity = Vector2 (rand_range (mob .min_speed , mob .max_speed ), 0 ).rotated (direction )
36+ # warning-ignore:return_value_discarded
37+ $ HUD .connect ("start_game" , mob , "_on_start_game" )
3638
3739
3840func _on_ScoreTimer_timeout ():
Original file line number Diff line number Diff line change @@ -11,3 +11,7 @@ func _ready():
1111
1212func _on_VisibilityNotifier2D_screen_exited ():
1313 queue_free ()
14+
15+
16+ func _on_start_game ():
17+ queue_free ()
Original file line number Diff line number Diff line change @@ -84,5 +84,7 @@ public void OnMobTimerTimeout()
8484
8585 // Choose the velocity.
8686 mobInstance . SetLinearVelocity ( new Vector2 ( RandRange ( 150f , 250f ) , 0 ) . Rotated ( direction ) ) ;
87+
88+ GetNode ( "HUD" ) . Connect ( "StartGame" , mobInstance , "OnStartGame" ) ;
8789 }
8890}
Original file line number Diff line number Diff line change @@ -23,4 +23,9 @@ public void OnVisibilityScreenExited()
2323 {
2424 QueueFree ( ) ;
2525 }
26+
27+ public void OnStartGame ( )
28+ {
29+ QueueFree ( ) ;
30+ }
2631}
You can’t perform that action at this time.
0 commit comments