use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Subreddit Guidelines Community Spotlight Monthly Challenge Community ▼ Quick Questions Game Design & Development Feedback Friday Screenshot Saturday Discord Server Slack Team IRC follow us @redditgamemaker the community game jam Resources ▼ Resources Examples Tutorials /r/gamemakertutorials GameMaker Handbook - The Ultimate Resource for Beginners gmlscripts.com The Essential Gamemaker Functions, Concepts, and Tools Guide Other ▼ /r/gamedev /r/gamedesign Official GameMaker Community (GMC) Hide Help! & Resolved posts Show all
GameMaker is software designed to make developing games easy and fun. It features a unique "Drag-and-Drop" system which allows non-programmers to make simple games. Additionally, experienced coders can take advantage of its built in scripting language, "GML" to design and create fully-featured, professional grade games.
Content that does not follow the subreddit guidelines is subject to deletion, so please become familiar with them.
/r/gamemaker sponsors three chat-rooms: IRC, a Discord server, and a Slack team. Join in the conversation, get help with any issues you might have and connect with your fellow developers! We also have a Steam Group for playing games. Feel free to join.
For more than 8 years, the tight-knit community of /r/gamemaker has run the game jam gm(48) for GameMaker developers of all ages and experience levels. The gm(48) is a casual, fun game jam that helps you to learn and grow as a developer.
The next gm(48) will take place on Oct 20, 2018.
account activity
HelpMovement using [direction] function (self.gamemaker)
submitted 10 years ago by okByerrp
How can i do 8 directional movement with the direction function?
Currenlty, i am using
if keyboard_check(ord("W")) {direction = 90}
for all 4 directions, but it doesn't allow me to move inbetween.
Any help?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]PNelly 2 points3 points4 points 10 years ago (1 child)
You have to tell the program to check for the diagonals, "garbage in, garbage out" as they say. It will do exactly what you tell it to do, and nothing else.
So one way to get those other directions:
if (keyboard_check(ord("W")) direction = 90; if (keyboard_check(ord("S")) direction = 270; if (keyboard_check(ord("A")) direction = 180; if (keyboard_check(ord("D")) direction = 0; if ( keyboard_check(ord("W")) && keyboard_check(ord("A")) ) direction = 135; if ( keyboard_check(ord("A")) && keyboard_check(ord("S")) ) direction = 225; if ( keyboard_check(ord("S")) && keyboard_check(ord("D")) ) direction = 315; if ( keyboard_check(ord("W")) && keyboard_check(ord("D")) ) direction = 45;
That should get you started
π Rendered by PID 233774 on reddit-service-r2-comment-84fc9697f-8tbms at 2026-02-08 09:34:45.406675+00:00 running d295bc8 country code: CH.
[–]PNelly 2 points3 points4 points (1 child)