GML Virtual controller stick example

V

Virtual Mage

Guest
I made up a virtual stick. How it works:
If you click anywhere on the screen, it'll create a virtual stick at the cursor coordinates. Then, you can drag it around to move the player. This can be easily converted to an android or iOS port too.
It also has some kind of built-in customization: You can set the deadlock and the maximum distance.

The example is a very simple platformer.

Preview:


Download project file
The downloaded project file will be a .gmk. GameMaker 8, 8.1, or any studio version can read it (For Studio, you'll have to Import it from the Home menu. Ignore the warning message of changed functions, this project doesn't use any code that would've been removed.)

If you have any questions or suggestions, write a comment below! :)
 
Last edited by a moderator:

chance

predictably random
Forum Staff
Moderator
You added comments as I requested, so we can approve this. However, it still lacks proper line termination with semi-colons, so that's something you should fix.

It's an interesting approach to control, so I hope some members find it useful. My only suggestion would be adding a "reset button" to the example, so when the player object falls out of the room, you can restart the example without having to exit and re-start the game.
 
V

Virtual Mage

Guest
You added comments as I requested, so we can approve this. However, it still lacks proper line termination with semi-colons, so that's something you should fix.

It's an interesting approach to control, so I hope some members find it useful. My only suggestion would be adding a "reset button" to the example, so when the player object falls out of the room, you can restart the example without having to exit and re-start the game.
I'll try my best to improve the comments, and will be adding an auto-restart function to the example! ^^
 
Top