Legacy GM How to make the Peahat enemy from The Legend of Zelda

H

HenrikoNumberOne

Guest
Hello! I am trying to remake the Peahat enemies from The Legend of Zelda in Game Maker: Studio. However, I am having trouble mimicking their movement. They go about at random and sometimes move towards Link until they hit him or they miss hitting him, and they go back to just moving around at random.

They also perform some kind of "U-turn" and then move diagonally to the direction they were moving in at the end of the U-turn. The peahats, also at random, slow down to a stand still (their propellers are moving slower and slower until they stop completely too). This is when Link can harm these enemies. After a second or two, they begin picking up speed again until they're back to moving about at random.

It's pretty difficult to explain, so to make things a bit clearer I've recorded this video that showcase their behavior in the real game;


Here is the paragraph about Peahats on the Zeldapedia Wiki;

Peahats are not much larger than Link, but are immune to almost all attacks while they are moving and their blades are spinning. To defeat them, Link must wait until they momentarily stop moving, at which point they become easy targets. The exception to this is if their movement is stopped by Link using the clock; if they were moving at the time that Link touched the clock and caused all of his enemies to freeze, the game regards the Peahats as still being in motion and they will take no damage from any attack.

Any help achieving this would be very much appreciated!

- Henriko
 

The-any-Key

Member
Seems you have a good picture on the movements.

I would start with a state machine with:
sleep (not moving then start)
start (speed up)
stop (speed down)
random direction (set random direction then move)
player direction (set to player direction then move)
moving (moving in direction then new direction or stop)
 
H

HenrikoNumberOne

Guest
Seems you have a good picture on the movements.

I would start with a state machine with:
sleep (not moving then start)
start (speed up)
stop (speed down)
random direction (set random direction then move)
player direction (set to player direction then move)
moving (moving in direction then new direction or stop)
Yeah, that sounds like a good plan. I already have some octorok-ish enemies coded so I could probably build upon that.
 
Top