O'Reilly logo

GameMaker Cookbook by Brandon Gardiner

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Utilizing analogue joystick acceleration

Anyone who's used a modern gamepad controller knows that most games incorporate the joysticks for camera control and player movement, the latter being more common. Given this fact, it would be helpful to know how this works with GameMaker. Now, this can be handled by allowing GameMaker to check, in absolutes, whether one of the sticks is moving in a specific direction. This is fine for menus and the like, but what if you want to handle acceleration? Let's take a look at this.

Getting ready

Of course, you'll need to have at least one gamepad connected to your PC. It's not necessary to have the face buttons mapped, as seen in the previous recipe. You'll also need an object with a sprite to move with the gamepad, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required