enemy3.tres.gd 403 B

1234567891011121314
  1. extends Area2D
  2. func _on_damage_enemy2_body_entered(body):
  3. get_parent().fliph = not get_parent().global_position.x > body.global_position.x
  4. if get_parent().is_on_floor():
  5. get_parent().state = 'shooting'
  6. pass # Replace with function body.
  7. func _on_damage_enemy2_body_exited(body):
  8. get_parent().state = 'runaround'
  9. pass # Replace with function body.
  10. func _ready():
  11. scale.x = rand_range(0.5,2.0)