[GML] Game Maker WASD Movement Code

Learning Game Maker? Check out our simple recipe for game maker wasd movement code. This game maker movement code also works with the arrow keys.

Game Maker WASD Movement Code

gmslogo1This is a simple Game Maker WASD Movement Code for easy use. You can change it up to even use arrow keys or whatever keybinds you wish to setup for your characters movement.

Requirements:

  • Game Maker 8.1
  • Or Game Maker: Studio

[GML Create Event]

[GML Step Event]

Use WASD instead of the arrow keys:

Expand on this by checking out the RPG Game Maker Movement code.

Want to expand your knowledge? I highly recommend this book for getting more advanced with your GML code and game development experience with GameMaker: Studio. Please buy this book: GameMaker Game Programming with GML

GameMaker Game Programming with GML is one of the highest recommended books for GameMaker Studio! If you are ready to take your programming to the next level, I highly recommend picking this up!

Kyle on sabyoutubeKyle on sabwordpressKyle on sabtwitterKyle on sablinkedinKyle on sabfacebookKyle on sabemail
Kyle
Hi there, I'm Kyle. I'm a web developer and an indie game developer. Currently working on an android game called: Burning Rush developed in Game Maker: Studio and is currently in Early Access Stages.

I enjoy working with code, favorite language currently: Python.
Currently working: Freelance Part-time, Real Estate Marketing & Web Development Full-time, and Indie Game Development with Unholy Squid Entertainment.

6 Comments

  1. One problem, to have an action, you must have a event. What event did you use in this circumstance?

  2. There’s a little problem in the step event on line 19. It says room_height but it should say sprite_height.

  3. I am getting a problem where my character can only move up on half the screen. I’m not getting any errors my character just wont move up on the top part of the screen. Anyone have any ideas?

  4. Never mind the problem is in your code you’ve put
    if (MOVEUP && y > room_height/2)
    when it should be
    if (MOVEUP && y > sprite_height/2)

Leave a Reply

Your email address will not be published. Required fields are marked *