SwimmingCheepCheep.gd 463 B

12345678910111213141516171819
  1. extends Enemy
  2. @export var move_speed := 20
  3. @export_enum ("Straight", "Wavey", "Random") var movement_type := 2
  4. func _ready() -> void:
  5. if movement_type == 2:
  6. if [0, 1].pick_random() == 1:
  7. $WaveAnimations.play("Wave")
  8. else:
  9. $WaveAnimations.play("RESET")
  10. elif movement_type == 1:
  11. $WaveAnimations.play("Wave")
  12. else:
  13. $WaveAnimations.play("RESET")
  14. func _physics_process(delta: float) -> void:
  15. global_position.x += (move_speed * direction) * delta