YoYo Games Wiki

Beginner's Information

From YoYoGames Wiki

If you do not know anything about Gamemaker, you can find out here:

Click on the Ball

Let us first make the sprites. From the Resources menu select Create Sprite (you can also use the appropriate button on the toolbar). A form will open. In the Name field type “wall”. Select the Load Sprite button and choose an appropriate image. That is all, and you can close the form. In the same way, create a ball sprite.


Next, we make the sound. From the Resoources menu select Create Sound. A different form opens. Give the sound a name and choose Load Sound . Pick something appropriate and check whether it is indeed a nice sound by pressing the play button. If you are satisfied, close the form.


The next step is to create the two objects. Let us first make the wall object. Again from the Resources menu choose Create Object. A form will open that looks quite a bit more complex than the ones we have seen so far. At the left there is some global information about the object. Give the object an appropriate name, and from the drop down menu pick the correct wall sprite. Because a wall is solid, you should check the box labeled Solid. That is all for the moment. Again create a new object, name it ball, and give it the ball sprite. We don't make the ball solid. For the ball, we need to define some behavior. In the middle you see an empty list of events. Below it there is a button labeled Add Event. Press it and you will see all possible events. Select the Create event. This is now added to the list of events. At the far right you see all the possible actions in a number of groups. From the move group choose the action with the 8 red arrows and drag it to the action list in the middle. This action will make the object move in a particular direction. Once you drop it in the action list, a dialog pops up in which you can indicate the direction of motion. Select all 8 arrows to choose a random direction. You can leave the speed as 8. Now close the dialog. So now the ball will start moving at the moment it is created. Secondly, we have to define what should happen in the case of a collision event with the wall. Again, press Add Event. Click on the button for collision events and in the drop down menu select the wall object. For this event we need the bounce action. (You can see what each action does by holding the mouse cursor still above it.) Finally, we need to define what to do when the user presses the left mouse button on the ball. Add the corresponding event and select the left mouse button from the pop-up menu. For this event we need a few actions: one to play a sound (can be found in the group of main1 actions) and one to change the score (in the group score) and two more to let the ball jump to a new random position and moving in a new direction (in the same way as in the creation event). For the sound action, select the correct sound. For the score action, type in a value of 1 and check the Relative box. This means that 1 is added to the current score. (If you make a mistake you can double click the action to change its settings.)


Our objects are now ready. What remains is to define the room. Create a new room in the game, again from the Resources menu. At the right you see the empty room. At the left you find some tabs, one for setting the background, one for setting some global properties like the width and height of the room, and one where you can add instances to the room. At the bottom you can select an object in the pop-up menu. By clicking in the room you can place instances of that object there. You can remove instances using the right mouse button. Create a nice boundary around the room using the wall object. Finally, place 1 or 2 ball objects in the room. Our game is ready.


Now it is time to test our game. Press the Run button (the green triangle on the button bar at the top of the window) and see what happens. If you made no mistakes, the ball starts moving around. Try clicking on it with the mouse and see what happens. You can stop the game by pressing the <Esc> key. You can now make further changes.

Congratulations. You made your first little game.

Name Entry

Name Entry is when you get your name in the text.

This seems quite advanced but is really easy. What you have to do is

Create an object, give it any name. Create a Create event and click on the control tab at the side and drag and drop

Select a variable and set the information too:

variable: global.name

value: 0

Then click Ok.

Now you need to make sure that the game asks for their name. To do this you need to go onto the control tab again. Drop and drag Excute a peice of the code and type in

 {
 global.name=get_string('Here you type whatever question you want the computer to ask the player',)
 }

Then whenever you want to use the name they type in a message, You would for example type in the message:'Hello '+global.name+'!' and you would get if the user typed Samuel in you would get Hello Samuel! You have to get the flying commas in otherwise it won't work.

[img]http://upload.aniboom.com/Pages/Application/Animachines/Shapeshifter/FlashServices/tempFrames/1581880797_.gif[/img]