Enemy Dust Effect + Flying enemy aggro

This commit is contained in:
Felipe M 2021-02-10 17:25:47 +01:00
parent 3d940d26c0
commit 930ff3e2bb
Signed by: fmartingr
GPG key ID: 716BC147715E716F
5 changed files with 65 additions and 4 deletions

View file

@ -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)