The fundamental thing that makes a game a game is the
interaction with the player. This is achieved by a variety of
means, with the keyboard and mouse on computers and through touch
and tilting on mobile devices. The standard way of doing this in
GameMaker is to put actions in mouse or keyboard events, but
sometimes you need more control, especially when creating something
for mobile devices or HTML5. For that you can use the mouse and
keyboard functions to get which buttons have been pressed or
released as well as simulating the touches on a screen, and there
are a couple of specific functions relating to the tilt
controls that most mobile devices have too.
The following sections deal with the main user input devices for developing games with GameMaker: Studio:
On the Windows target platform, you can also access the legacy joystick functions. However, unless you are porting an older game made with a previous version of GameMaker, it is recommended that you use the newer gamepad functions (above). The joystick functions can be found here:
- Joystick Input (Windows Only)
Finally, you also have haptics available to you if you are targeting Android devices. This is covered in the following section:
- Immersion Haptics (Android Only)