How to Set Gravity in a Game Maker

By Dan Chruscinski

Updated September 22, 2017

What goes up must come down, unless you have control over gravity. In the Game Maker software, budding game designers are able to alter every aspect of their creations, from how fast characters move to how their objects react to the user's interactions. Using the gravity action, the force and direction of the game's gravitational pull can be changed to suit flying objects or characters that can walk up walls and upside down. Multiple objects in the same location can each be bound by a separate law of gravity.

Select the object for which you would like to set the gravity and choose “Create Event.” While keeping the “Create Event” menu open, click back on the object and open the “Object Properties” menu.

Choose the tab that is labeled “Move” from the “Object Properties” menu. Locate the “Set Gravity” action.

Click the “Set Gravity” icon and drag it from the “Object Properties” menu into the “Create Event” menu under the “Action” heading.

Enter the numerical direction you want the gravity to pull your object. To have the gravity pull down, enter 270; pull to the right with 0; pull upwards with 90; and pull left with 180. It works on the same principle as the 360 degrees of a circle.

Enter the force of gravity into the box labeled “Gravity.” Set this number between 0.1 and 0.5 for the standard pull of gravity present in platforming games. A higher number means a greater pull and faster fall, while a lower number will allow objects and sprites to stay suspended for longer periods of time.

Click on the green check mark to exit the “Gravity Menu.” Save the new action by clicking “OK” from the “Object Properties” menu.

Tips

Test different gravitational strengths and directions to create a unique platforming element to your game. Play Super Mario Galaxy on the Wii for an understanding of how gravity can alter game play.

×