DummyAI.gml 534 B

12345678910111213141516171819202122232425262728293031323334
  1. function enemy_dummy_ai()
  2. {
  3. x_spd = 0;
  4. y_spd = 0;
  5. switch(state)
  6. {
  7. case "IDLE":
  8. if hitstun_timer == hitstun_max
  9. {
  10. state = "COUNTER";
  11. set_sprite(sEnemyDummyCounter);
  12. }
  13. facing = sign(oPlayer.x - x);
  14. break;
  15. case "COUNTER":
  16. if animation_end()
  17. {
  18. enemy_create_hitbox(384, 96, facing * 192, 0, 12);
  19. state = "ATTACK";
  20. set_sprite(sEnemyDummyCounter);
  21. }
  22. break;
  23. case "ATTACK":
  24. if animation_end()
  25. {
  26. state = "IDLE";
  27. set_sprite(sEnemyDummyIdle);
  28. }
  29. break;
  30. }
  31. }