GM:S 1.4 How to make the Peahat enemy from The Legend of Zelda

Discussion in 'Programming' started by HenrikoNumberOne, Nov 18, 2017.

  1. HenrikoNumberOne

    HenrikoNumberOne Member

    Joined:
    Jul 6, 2017
    Posts:
    86
    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;

    Any help achieving this would be very much appreciated!

    - Henriko
     
    ParodyKnaveBob likes this.
  2. The-any-Key

    The-any-Key Member

    Joined:
    Feb 2, 2017
    Posts:
    1,521
    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)
     
    HenrikoNumberOne likes this.
  3. HenrikoNumberOne

    HenrikoNumberOne Member

    Joined:
    Jul 6, 2017
    Posts:
    86
    Yeah, that sounds like a good plan. I already have some octorok-ish enemies coded so I could probably build upon that.
     
  4. TheouAegis

    TheouAegis Member

    Joined:
    Jul 3, 2016
    Posts:
    6,781
    HenrikoNumberOne likes this.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice