diff options
Diffstat (limited to 'demos/2d/space_shooter/enemy1.gd')
-rw-r--r-- | demos/2d/space_shooter/enemy1.gd | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/demos/2d/space_shooter/enemy1.gd b/demos/2d/space_shooter/enemy1.gd index 204995c05d..e127eb2777 100644 --- a/demos/2d/space_shooter/enemy1.gd +++ b/demos/2d/space_shooter/enemy1.gd @@ -7,7 +7,7 @@ const SPEED = -200 var destroyed=false -func _process(delta): +func _fixed_process(delta): get_parent().translate(Vector2(SPEED*delta, 0)) @@ -20,14 +20,14 @@ func destroy(): return destroyed = true get_node("anim").play("explode") - set_process(false) + set_fixed_process(false) get_node("sfx").play("sound_explode") # Accumulate points get_node("/root/game_state").points += 5 func _on_visibility_enter_screen(): - set_process(true) + set_fixed_process(true) get_node("anim").play("zigzag") get_node("anim").seek(randf()*2.0) # Make it start from any pos |