Enemy Dust Effect + Flying enemy aggro
This commit is contained in:
parent
3d940d26c0
commit
930ff3e2bb
5 changed files with 65 additions and 4 deletions
|
@ -6,6 +6,9 @@ var MainInstances = ResourceLoader.MainInstances
|
|||
|
||||
onready var sprite = $Sprite
|
||||
|
||||
func _ready():
|
||||
set_physics_process(false)
|
||||
|
||||
func _physics_process(delta):
|
||||
var player = MainInstances.Player
|
||||
if player != null:
|
||||
|
@ -17,3 +20,7 @@ func chase_player(player, delta):
|
|||
motion = motion.clamped(MAX_SPEED)
|
||||
sprite.flip_h = global_position < player.global_position
|
||||
motion = move_and_slide(motion)
|
||||
|
||||
|
||||
func _on_VisibilityNotifier2D_screen_entered():
|
||||
set_physics_process(true)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue