Mag gen & work towards AI
This commit is contained in:
@@ -50,7 +50,7 @@ func take_damage(dmg):
|
||||
func update_angry():
|
||||
if angry && global_position.distance_to(player.global_position) > angry_distance:
|
||||
angry = false
|
||||
elif global_position.distance_to(player.global_position) < active_distance:
|
||||
elif player and global_position.distance_to(player.global_position) < active_distance:
|
||||
angry = true
|
||||
if(TIMER.wait_time <= 0):
|
||||
TIMER.start(UPDATE_ANGRY_TIME)
|
||||
@@ -65,7 +65,7 @@ func _physics_process(_delta: float) -> void:
|
||||
|
||||
if knockback > 0:
|
||||
motion.y -= knockback/2
|
||||
if(player.global_position.x > global_position.x):
|
||||
if(player and player.global_position.x > global_position.x):
|
||||
motion.x -= knockback
|
||||
else:
|
||||
motion.x += knockback
|
||||
|
||||
Reference in New Issue
Block a user