GameMaker Manual - GameMaker.info (2024)

Move actions

The first set of actions consists of those related to movement of objects.The following actions exist:

GameMaker Manual - GameMaker.info (1) Move Fixed
Use this action to start the instance moving in a particular direction.You can indicate the direction using the buttons with the arrows on it.Use the middle button to stop the motion. Also you need to specifythe speed of the motion. This speed is given in pixels per step.Preferably don't use negative speeds.You can specify multiple directions. In this case a random choice is made.In this way you can let a monster start moving either left or right.

GameMaker Manual - GameMaker.info (2) Move Free
This is the second way to specify a motion. Here you can indicate a precise direction.This is an angle between 0 and 360 degrees. 0 means to the right.The direction is counter-clockwise. So for example 90 indicates anupward direction. If you want an arbitrary direction, you can typerandom(360). As you will see below the function random givesa random number smaller than the indicated value. As you might have noticed thereis a checkbox labeled Relative. If you check this, the new motion is addedto the previous one. For example, if the instance is moving upwards and youadd some motion to the left, the new motion will be upwards to the left.

GameMaker Manual - GameMaker.info (3) Move Towards
This action gives a third way to specify a motion. You indicate a position anda speed and the instance starts moving with the speed towards the position.(It won't stop at the position!) For example, if you want a bullet to flytowards the position of the spaceship you can use as position spaceship.x, spaceship.y.(You will learn more about the use of variables like these below.)If you check the Relative box, you specify the position relativeto the current position of the instance. (The speed is not taken relatively!)

GameMaker Manual - GameMaker.info (4) Speed Horizontal
The speed of an instance consists of a horizontal part and a vertical part.With this action you can change the horizontal speed. A positive horizontalspeed means a motion to the right. A negative one means a motion to the left.The vertical speed will remain the same. Use relative to increase the horizontal speed(or decrease it by providing a negative number).

GameMaker Manual - GameMaker.info (5) Speed Vertical
In a similar way, with this action you can change the vertical speed of the instance.

GameMaker Manual - GameMaker.info (6) Set Gravity
With this action you can create gravity for this particular object.You specify a direction (angle between 0 and 360 degrees) and a speed,and in each step this amount of speed in the given direction is addedto the current motion of the object instance. Normally you need a verysmall speed increment (like 0.01). Typically you want a downward direction(270 degrees). If you check the Relative box you increase thegravity speed and direction. Note that, contrary to real life,different object can have different gravity directions.

GameMaker Manual - GameMaker.info (7) Reverse Horizontal
With this action you reverse the horizontal motion of the instance.This can for example be used when the object collides with a vertical wall.

GameMaker Manual - GameMaker.info (8) Reverse Vertical
With this action you reverse the vertical motion of the instance.This can for example be used when the object collides with a horizontal wall.

GameMaker Manual - GameMaker.info (9) Set Friction
Friction slows down the instances when they move. You specify the amountof friction. In each step this amount is subtracted from the speeduntil the speed becomes 0. Normally you want a very small number here (like 0.01).

GameMaker Manual - GameMaker.info (10) Jump to Position
Using this action you can place the instance in a particular position.You simply specify the x- and y-coordinate, and the instance is placedwith its reference point on that position. If you check the Relative box,the position is relative to the current position of the instance.This action is often used to continuously move an instance.In each step we increment the position a bit.

GameMaker Manual - GameMaker.info (11) Jump to Start
This action places the instance back at the position where it was created.

GameMaker Manual - GameMaker.info (12) Jump to Random
This action moves the instance to a random position in the room.Only positions are chosen where the instance does not intersect anysolid instance. You can specify the snapping used. If you specifypositive values, the coordinates chosen with be integer multiples ofthe indicated values. This could for example be used to keep the instancealigned with the cells in your game (if any). You can specify a separatehorizontal snapping and vertical snapping.

GameMaker Manual - GameMaker.info (13) Align to Grid
With this action you can round the position of the instance to a grid.You can indicate both the horizontal and vertical snapping value (that is,the size of the cells of the grid). This can be very useful to make surethat instances stay on a grid.

GameMaker Manual - GameMaker.info (14) Wrap Screen
With this action you can let an instance wrap around, that is, whenit leaves on one side of the room it reappears at the other side. Thisaction is normally used in the Outside event. Note that theinstance must have a speed for wrapping to work, cause the directionof wrapping is based on the direction of the motion. You can indicatewhether to wrap only horizontal, only vertical, or in both directions.

GameMaker Manual - GameMaker.info (15) Move to Contact
With this action you can move the instance in a given direction until acontact position with an object is reached. If there already is a collisionat the current position the instance is not moved. Otherwise, the instanceis placed just before a collision occurs. You can specify the direction butalso a maximal distance to move. For example, when the instance is fallingyou can move a maximal distance down until an object is encountered. You canalso indicate whether to consider solid object only or all objects. You typicallyput this action in the collision event to make sure that the instance stopsin contact with the other instance involved in the collision.

GameMaker Manual - GameMaker.info (16) Bounce
When you put this action in the collision event with some object, the instancebounces back from this object in a natural way. If you set the parameter preciseto false, only horizontal and vertical walls are treated correctly. When you setprecise to true also slanted (and even curved) walls are treated correctly.This is though slower. Also you can indicate whether to bounce only against solidobjects or against all objects. Please realize that the bounce is not completelyaccurate because this depends on many properties. But in many situations theeffect is good enough.

« Actions | Main actions, set 1 »

GameMaker Manual - GameMaker.info (2024)

FAQs

What are the directions in GameMaker manual? ›

You supply the direction value from 0° to 360° - where right is 0°, up is 90°, left is 180° and down is 270° - and you can also set the relative flag to add/subtract the value you give to the current direction.

Is GML similar to C++? ›

While it has its own scripting language called GameMaker Language (GML), which is similar in syntax to C, GameMaker itself is not primarily programmed using C++. However, GameMaker does provide functionality for more advanced users to extend the capabilities of their games through the use of "extensions".

Is GameMaker still worth it? ›

Overall it a great software to be used by all types of game developers if they want an easy and smooth process. GameMaker is very good for thoes who just started to do game development. One of the best tool for coding. The interface of this tool is very user friendly.

How hard is GameMaker? ›

Is GameMaker good for beginners? Yes! GameMaker Studio is relatively easy to learn compared to other game engiens like Unity or Unreal, as you can make a game without very much code or scripting. However, the games made in GameMaker are geneallly not as complex as with other game engines.

What coding language does GameMaker use? ›

What language does GameMaker use? GameMaker uses its very own coding language known as GameMaker Language (creative name, right?). GameMaker Language, or GML for short, comes in two different flavours: GML Code, and GML Visual. GML Code allows you to write your own code and take full control of your creation.

Is GML like Python? ›

GML is designed specifically for GameMaker and shares some similarities with languages like C and JavaScript, but it is not Python. However, it's possible to use Python or other programming languages for certain tasks within a GameMaker project by using external libraries or DLLs and interfacing them with GML.

Is GML like Java? ›

No, GameMaker does not use Java for its game development process. GameMaker Studio, developed by YoYo Games, utilizes its own scripting language called GameMaker Language (GML). GML is a C-like language specifically designed to be used within the GameMaker environment.

What does ++ mean in GML? ›

++, -- are used to add or subtract one (1) from a value. It is worth noting that placing this before or after the value to be added to or subtracted from will have slightly different results. For example: ++a will increment the variable and return the incremented value.

Is GameMaker 100% free? ›

Yes - all versions of GameMaker are completely free to download. You'll only need to upgrade to a paid GameMaker package if you'd like to export your games to certain platforms. For more information, check out our Pricing page and our comprehensive GameMaker exports article.

Is GameMaker or Unity easier? ›

For a beginner, small 2D games are easier to build in GameMaker Studio than in Unity, yes. Complex, visually-heavy games are better handled with Unity — but it isn't easy at all. (But it's fun.)

Is Unreal Engine better than GameMaker? ›

When assessing the two solutions, reviewers found GameMaker easier to use, set up, and administer. However, reviewers preferred doing business with Unreal Engine overall. Andrew M. Game Maker is deceptively simple to start using, and it has powerful features under the hood.

Does GameMaker need internet? ›

When you first install GameMaker you will be required to have an internet connection to log into the product and download any additional runtimes. After that, you can use the product offline, although you will be required to connect again approximately every 30 days to verify the account using the product.

Does GameMaker require code? ›

Does GameMaker require coding? No, not for basic games thanks to its DnD system. However, as your game complexity increases, using GML becomes almost inevitable. It is highly recommended to learn GML to harness the full potential of GameMaker.

What is FPS on GameMaker? ›

These values are often confused, but basically one is the number of game steps that GameMaker is supposed to be completing in a second (game speed), while the other is the number of CPU steps that GameMaker is actually completing in a second (the real fps), and this value is generally much higher than the game speed, ...

What is the direction of movement in GameMaker? ›

NOTE Direction in GameMaker is calculated counter clockwise, so 0° and 360° are to the right, 90° is up, 180° is to the left and 270° is down. Finally, we use the lengthdir_x() and lengthdir_y() functions to actually move the variable.

How do you get direction in GameMaker? ›

You can use point_direction(x1, y1, x2, y2) to get a direction, in degrees. Degrees start at 0 being RIGHT, and going to 360 in a counter-clockwise motion.

What are paths in GameMaker? ›

A path is created from a series of defining points that are linked together and then used to plan the movements of an instance. They can be created with code, or in The Path Editor and they are assigned to an instance to use in the game.

What is the direction of speed in GameMaker? ›

By default the speed value will be added to the direction vector - so if you set speed to 2 and the direction to 45° the instance will move up and right 2 pixels every game frame - but you can also click on the direction field and select either Horizontal or Vertical speed.

References

Top Articles
Latest Posts
Recommended Articles
Article information

Author: Merrill Bechtelar CPA

Last Updated:

Views: 5773

Rating: 5 / 5 (50 voted)

Reviews: 81% of readers found this page helpful

Author information

Name: Merrill Bechtelar CPA

Birthday: 1996-05-19

Address: Apt. 114 873 White Lodge, Libbyfurt, CA 93006

Phone: +5983010455207

Job: Legacy Representative

Hobby: Blacksmithing, Urban exploration, Sudoku, Slacklining, Creative writing, Community, Letterboxing

Introduction: My name is Merrill Bechtelar CPA, I am a clean, agreeable, glorious, magnificent, witty, enchanting, comfortable person who loves writing and wants to share my knowledge and understanding with you.