• Simple Moving GameMaker - Make Object Moving Tutorial
Simple Moving GameMaker - Make Object Moving Tutorial

First thing first, if you want to make a game, you should know how to make the object moving. It means making the character moving specific directions by pressing the up, down, left, or right key from the keyboard. Plus, when you are pressing nothing or release the key, your character should be stopped.

Alright, let see how we can build it with gamemaker studio.

Preparing:

Download Gamemaker Studio, have it installed already in your computer.
Choose any character images (sprite) to build the demo. (we choose the bear)

Step 1: Click on Gamemaker Tool to Run the IDE

Step 2: Name your project as Beginner-Moving (or whatever you want) and click on Create button to Create a new game

Step 3: The IDE layout will be opened. Next, you should see the directory folders of the games. For example, Sprites, Sounds, Backgrounds, Objects, Rooms, etc.

Step 4: Right Click on Sprites folder to add a new sprite for your games.
Question – What is sprites?

Like an image or set of images for your character. For example, object bear need bear image. So bear image is a sprite

Step 5: The pop up sprite property will be displayed. Change the name of the sprite to spr_bear (or spr_). Then click on Load Sprite to Browser images on computer hard drive.

Step 6: Finding for any images you want it becomes a sprite. (We selected the ferya_bear.png because we want to make a bear moving)

Double click on the ferya_bear.png (or select it then click Open) then we will go back to Sprite Properties Dialog. Click Ok to finish this loading bear image for bear sprite step.

Step 7: We already have sprite bear, now we have to create object bear and add bear sprite to it.

Right click on object folder or click the object icon on the menu tool to create an object. The object properties dialog will be displayed.

Change the object name to obj_bear.

Step 8: Choose sprite for this obj_bear object by click on sprite select icon and select the spr_bear then click Ok

Step 9: Now, we have the character bear (obj_bear). Then, we need a game room to put the bear inside.

To create a room, right click on Room folder on the folder directory or click on room icon. The room properties will be displayed.

Step 10: Select the object tab in order to choose the obj_bear tab and put it to the room. Click on the select object icon and choose obj_bear

Step 11: Place obj_bear to the room, then select ok to close the room properties dialog

Step 12: You almost finish the game; just click on the green play icon to test what you have done.

You will see the game run on a window application, however only the bear showed in the room, you cannot move it by pressing direction keys.

Step 13: Close the game play, get back to obj_bear to add events moving for our first bear character

Left click on obj_bear to reopen its object properties dialog

Step 14: Click on Add Event Button/ Select Event Keyboard / Select Left

Now you will see the Left event display on the Event List

Step 15: We just added Left Event, now we need actions for it.

Select Move Tab/ Drag Move Action to Actions List. The Move Action Dialog will be displayed

Click on Left Direction and Input Speed 2 then click ok

Step 16: Click Play green icon again to test the game if we press the left key, the bear should move to the left with speed 2

Step 17: However, when we release the left key, the bear still moves to the left and won’t stop. To make the bear stop when we don’t press any key. Go back to obj_bear object properties and add Key Released.

Step 18: Select tab move and drag Move Action to Released event. Click Direction Go nowhere and speed 0. This Action will make the bear stop when we press nothing.

Click on the green play icon and test the game, now when you release the left key the bear will stop

Step 19: Now, you should try to add right, up, down events and moving actions for the bear 

Harrison Thomas

sound seem easy to do. i think i just follow your tutorial.

5/24/2016 4:03:35 AM
Ryan

i read your tutorial about " Ninja Girl RPG - Kid learns to develop games". yep, i made a Ninja girl, she could move such as: jump, move,.... so cute. thank you so much!

5/24/2016 5:38:00 AM