Make A Game Maker Game With "GML" for Beginners
Browse articles:
Auto Beauty Business Culture Dieting DIY Events Fashion Finance Food Freelancing Gardening Health Hobbies Home Internet Jobs Law Local Media Men's Health Mobile Nutrition Parenting Pets Pregnancy Products Psychology Real Estate Relationships Science Seniors Sports Technology Travel Wellness Women's Health
Browse companies:
Automotive Crafts, Hobbies & Gifts Department Stores Electronics & Wearables Fashion Food & Drink Health & Beauty Home & Garden Online Services & Software Sports & Outdoors Subscription Boxes Toys, Kids & Baby Travel & Events

Make A Game Maker Game With "GML" for Beginners

GML is used in Game Maker to make video games. Game Maker is a fun and easy way to make video games. Now you will learn how to make a video game with simple coding, for GML beginners. Here you can find out GML information that is easily understood by anyone.

What is GML? It is a built in code editor in Game Maker 7.0 through 8.1, GM-Html5 and GM studio. GML stands for Game Maker Language. Once you get used to GML, you only have to look up a problem you have in Game Maker Help. Before you begin remember to save your game often by clicking the third button to the right of the top left corner which says Save the Game when your mouse hovers over it. You can also go to File and click save.

The first thing you will be learning is basic movement. However, you need to create a sprite and object before you can do this. Make a sprite by clicking the "create sprite" button that looks like a little red Pac-Man. Change the name to spr_main. For this tutorial, all you need to do for the sprite is make a square. To do this, click "edit sprite" then click "create new sprite" which is directly to the right of the check mark on the top left corner. Leave the width and height at 32, click Ok. Double click on image 0. Press F on your keyboard (while in Game Maker). The hot key F doesn't work on mac, so you must click on the paint bucket. Now click on the checkered square. In the mac version this would be a green square. This will fill in the square with a color of your choice. Click the green check mark at the top left on the screen you are currently on, then the next screen, then click center, then click the Ok button.

Now click the create object button, which is a sphere about eight buttons to the left of the create a sprite button in all game makers. In game maker 8.1 and below, it is a blue sphere. In Game Maker: HTML5, it is an orange sphere. In Game Maker: Studio, the sphere is also orange. After you clicked on create a new object, click on "no sprite" directly under where it says object0, click on spr_main. Now change the name of the object from object0 to obj_main.

The next thing you need to do is click Add Event which is at the bottom middle of the object window. Click on the keyboard event, and select Left which is at the top of the menu. Go to the control tab at the right side of the object window which is the fourth tab down, including the move tab. Now go under the -code section, and drag and drop the execute code button. Type x -= 5. Note to not add the period. You also must know all code in GML is case sensitive. Click the check mark and click Add Event, this time, click Keyboard, then click right. Drag and drop the execute code button in to the Right event. This time you need to type x+=5. After you've done this, Add an Event, Click keyboard, and select up. Drag and drop the execute code button, this time type y-=5. Last bit of code you have to do, add a keyboard event and select down. Drag and drop the execute code button, type y+=5.

Now all you have to do is add a room by clicking the create a room button. This is located directly to the right of the create an object button. Open the room and click anywhere in the room to place the object in it. Next, just run the game by clicking the green arrow pointing to the right, it is 2 buttons to the left of create a sprite.

To play, you just use your arrow keys to move up, down, left, and right. There you go, you just made an easy game that you can play whenever you want, and don't forget to save. Remember to make sure transparent is deselected in the sprite, this is often a reason why it would be invisible in the game.

Additional resources:

Need an answer?
Get insightful answers from community-recommended
in Computer Programming & Languages on Knoji.
Would you recommend this author as an expert in Computer Programming & Languages?
You have 0 recommendations remaining to grant today.
Comments (2)

Good information!  Thanks for posting here...

Person who read college essay about creating games could almost after this create it.