GameMaker: 8-way shooting with 4 keys


This is a specific example for shooting in 8 directions by having 4 'shoot' keys, which, in different combinations, determine direction. While not being exactly a common control scheme, in some situations this proves to be better than different schemes with single attack button, as it allows projectiles to be fired in directions independent from movement, essentially granting something similar to 'analog sticks' of gamepads.
Example is simple, well commented, and would be rather easy to implement.

Download GMK

Related posts:

9 thoughts on “GameMaker: 8-way shooting with 4 keys

  1. I highly doubt this comment will be replied to, but with some tweaking couldn’t this turn into an 8-Directional movement system with four keys? I haven’t used Game Maker in quite a few years now, but that’s really my only reason to download this. To see what I can do by changing the code and (obviously) add in some animation for an 8 player directional movement.

    • Unless I misunderstood you, the example already implements that – you use WASD to accelerate the player in 8 directions.

  2. You have some great, high quality examples for Game Maker here. I’ll be using a lot of these.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.