Вы находитесь на странице: 1из 17

Game

maker basics

These pages will show you how to do the basics of GameMaker. The sequence is shown below with the page numbers. For more advanced instructions and the exact EVENTS and ACTIONS for a particular game refer to the specific instructions for that game

No 1 2 3 4 5 6 7

Menu

Task

PG

No

Menu

Task Make an animated sprite EVENTS & ACTIONS

PG

Make a SPRITE

Make an Object

Make a background

EVENTS

Make a Room

ACTIONS

Make a sound

Run- test your game Write your game information

15

Techxellent Training Solutions 2012

http://www.techxellenttraining.com.au

MAKE A SPRITE
Menu Bar

Create .exe

Play

sprite

sprites: are the artwork ( images) that are used to make objects for the game

a) Click on Menu Bar

Make a sprite

b) Name Sprite SP Always use SP as the first part of a sprites name c)Click EDIT SPRITE

e.g.

d)Click Menu Bar

Edit

Add Empty

e) Click Show Preview

Techxellent Training Solutions 2012

http://www.techxellenttraining.com.au

f)Double click on Image0

g) Draw your sprite :You are now in the Image Editor. On the Image Editor menu bar Click the magnifying glass to enlarge the image so you can see it. This does not actually make the sprite bigger. This sprite is 32 x 32 pixels

h) Make your image larger On the Image Editor Menu bar click Transform click Stretch This opens the TRANSFORM dialogue box showing the current image size of 32 x 32 pixels. To change the sprites size click STRETCH If you want a rectangular sprite : un click Keep aspect Ratio. For a square sprite keep this ticked MAKE ALL SPRITES MULTIPLES OF 32

This is a large rectangular sprite oriented like this:

This is a large rectangular sprite oriented like this

This is a large square sprite oriented like this

Use these pixel sizes only: Width 32 Width 64 Height 32 Height 64

Width 96 Height 64

Width 64 Height 96

Tick- keep aspect ratio


Techxellent Training Solutions 2012

Un tick Keep aspect ratio


http://www.techxellenttraining.com.au

i)

Erase art Use the rubber in the left tool pallet

j) Create your image: this is done in a similar way to MS Paint. Any area that is left grey and white checks is clear Make sure you FILL THE ENTIRE canvas with your image or it will be too small to see in the game, like this -k) Save the image - When you have completed the image click the green tick in the left side of the Image Editors menu bar. You can re- edit at any time

Click the green tick on the next screen too

Then Click OK on the final screen

L) Re edit sprite :Your new sprite will appear in the Game resources column on the left. You can re edit this sprite any time by double clicking on it.

ANIMATED SPRITE
m) Make an animated sprite: Double click on your original sprite Click on Edit Sprite Click on image 0 in the right side box and then keyboard click CNTRL+ C ( copy) , then CNTRL+V ( paste ) This will give you a second image. Double click on image1 to change it a little
Techxellent Training Solutions 2012 http://www.techxellenttraining.com.au

Enlarge the image using the magnifying glass from the menu bar.

Use the eraser tool in the left side drawing tools box to remove part of the image that you wish to change Then draw in the new part of your image. When you have completed this click the green tick in the left side of the Image Editors menu bar. You can re- edit at any time

You will now have 2 slightly different images and a preview of the animation. You can repeat this copy paste edit change process, using image 1 if you want to improve the animation.

Or you can slow the animation down by copying and pasting image 0 two or three more times and then copy and paste image 1 two or three more times using keyboard click CNTRL+ C ( copy) , then CNTRL+V ( paste ). To make this animation play properly in the game you need to save it as a PNG strip and then replace the original sprite with the newly saved PNG strip . In the Sprite editors menu bar click File then click Save as PNG File. Locate this place to save the sprite : Save your sprite in Students Documents-GAMEMAKER WSGame Examples 1 Your Incursion TODAY-

Techxellent Training Solutions 2012

http://www.techxellenttraining.com.au

The animation will save as SP.._strip6.png ( the strip number will change depending on how many images you placed in your animation) Once you have done this click the image click the green tick in the left side of the Image Editors menu bar

Now we have to replace the original sprite with the animated strip that we have just created From this screen click load sprite. You should be taken automatically to the place where you saved your animated strip Click on your animated sprite, check that the correct name appears and then click OPEN.

Whilst the new sprite may look exactly the same as your old sprite its animation will perform differently in the game

Click OK.

You can repeat this process with any of your sprites

Techxellent Training Solutions 2012

http://www.techxellenttraining.com.au

MAKE AN AN
Menu Bar

object

object Objects are : the things in the game You place objects in yoru room. Objects are the things in your game such as balls, walls, characters etc. Some objects just sit (like walls) and other objects move around and react to things that happen such as mouse clicks and hitting other objects. Most objects require artwork to represent them in the game ( except for controllers) . You need to make your sprites first. Click on the OBJECT icon on the menu bar

Call your object OB . . Always name objects with OB at the start of the name and use the same end name as the sprite you will use.

in the Sprite box click the choose file icon and select the sprite artwork that you want to use for your object

You will usually click Visible and Solid for your objects ( except for controllers)

Once you have done this you will either start to program EVENTS AND ACTIONS for your object or just click OK and come back to this programming later.

Techxellent Training Solutions 2012

http://www.techxellenttraining.com.au

EVENTS AND ACTIONS


Events and actions are programmed for the OBJECTS in the game. These are what happens in the game that apply to the particular object you are programming. In this case its ob boy. The programming commands are on the left of the screen, note that there are a number of tabs we will be using down the side. To program Events and actions for an object you will need to double click the object in the game resources list to open the objects screen

To program an event click Add Event

The Add Event menu will appear. Mote that several of these icons have sub menus as shown. Note that you can only have a COLLISION EVENT if you have created at least one more object ( and sprite) that you can collide with

There is a difference between Keyboard and Key Press, make sure you use the correct one Mouse pressed is different to mouse button, use the correct one
Techxellent Training Solutions 2012 http://www.techxellenttraining.com.au

ADD EVENT MENU & SUB MENUS


The ones we will use the most are highlighted

Techxellent Training Solutions 2012

http://www.techxellenttraining.com.au

ACTIONS MENUS
The actions we will use the most are highlighted To add an action you must have specified an EVENT first. Then left click and hold the action you wish to select and drag it into the actions column and let it go. A configuration box will appear where you make your configurations for that action. One EVENT can have several ACTIONS

MOVE TAB
Move Fixed

MAIN 1 TAB

Create Object Jump to position

Create moving

Jump to start

Destroy Instance

Jump random

Play Sound

Bounce

Previous room

SCORE TAB
Set Score

Next room

Restart Room

Techxellent Training Solutions 2012

http://www.techxellenttraining.com.au

10

ACTIONS MENUS MAIN2 TAB

Cont

CONTROL TAB

Questions
Check Question Set Alarm

Display message

Start block End Block

Show info else

Restart game

End game

There are many more actions available but I have listed the main ones we will use in this session. It is important that you configure each action correctly or the game wont work Carefully follow the directions for programming events and actions for your objects. This will make things happen in your game

Techxellent Training Solutions 2012

http://www.techxellenttraining.com.au

11

CREATE A

background

backgrounds: are the images used as scenery for the rooms. Rooms have a background. This could be a plain colour or an image that you create yourself or use an imported image.

Click create a background on the menu bar

Name your background and then click Edit background

On the menu bar click Transform -

stretch

Enter 640 x 448 pixels and un tick keep aspect ratio. Then click OK

Create your room background using the same tools as you used to create your sprites. When you have finished click the green tick in the top left corner of the menu bar and then click OK Your background will appear in the background resources on the left
Techxellent Training Solutions 2012 http://www.techxellenttraining.com.au

12

CREATE A ROOM ( LEVEL)


ROOMS are where you place objects. They are like the stage setting in a play and have backgrounds that
are either plain colour or use the backgrounds you have created.

Create a room Click on Create a room icon on the menu bar. Look at the ROOM PROPERTIES menu bar

GRID You can change the grid size here but usually 32 x 32 is ok X is the Horizontal axis Y is the vertical axis the default size is 608 pixels the default size is 448 pixels. You may change the grid size and room size if required.

SELECT A BACKGROUND COLOUR

Click on the backgrounds tab

For a simple coloured background with no artwork simply select a colour from the colour menu. OR Use a background artwork that you have created

Then click on the file select icon and select the background you created Use the scroll bar to scroll down and tick STRETCH This will insert the background into the room

Techxellent Training Solutions 2012

http://www.techxellenttraining.com.au

13

PLACE OBJECTS IN THE ROOM For an object to do anything in a room it must be placed in the room: Now click on the OBJECTS tab

Click the file select icon to select your objects. Their names and images will be displayed on the screen. Left mouse click anywhere on the room grid to place the object in the room.

Repeat this process for all objects. They must all be placed in the room if you want them to appear in the game.

You should now have a background and all your objects showing in the room

Now click the settings tab for rooms Name your room and create a caption for the room , this will show in the games border

Make sure you tick the green tick to save your room when you have completed this task

Your room will now show in the rooms resource list

IMPORTANT The room that you want to load first in the game MUST appear first in this list. Click and drag the rooms into the order you want them to play in. You MUST NOT have an empty room as your first room or the game will not play

Techxellent Training Solutions 2012

http://www.techxellenttraining.com.au

14

CREATE A

sound

sounds: these can be used in games, either as background music or as effects associated with various actions you program for objects. To program a sound you must first create it.

Click on Create a Sound in the menu bar Name your sound with S at the start Click Load sound, navigate to your sound file resources and select a sound Play the sound by clicking the green triangle Stop the sound playing by clicking the red stop button Click OK Your sound will now appear in the sound resources list and you can use it in the ACTIONS section of the OBJECTS task

WRITE THE GAME INFORMATION ( HOW TO PLAY)


Click on the change game information in the menu bar

The Game Information editing screen will open. Type your How to play and game information here. Format your text etc using this screens menu bar. When you have completed this task tick the green tick in the top left corner of this menu bar. This information will only appear when you run your game if you program it to appear in the Events and Actions section of the Objects or if the player presses the F1 key

RUN (TEST) YOUR GAME


Click the run the Game ( green) triangle on the menu bar. This simply runs the game. For others to play your game without having the GameMaker software you have to turn your game into an .exe file. This is a stand-alone executable file that you can share and publish. Once you create an .exe
Techxellent Training Solutions 2012 http://www.techxellenttraining.com.au

15

file you cannot edit your game, its locked. Make sure that you save a copy of your game as another name ( e.g. version2 _Splat) . This means that you will always have a version of the game that you can still edit.

CREATE A STAND-ALONE EXECUTABLE FOR YOUR GAME


Click on the create a stand-alone executable for your game icon in the menu bar Make sure that you have saved another version of your game before doing this.

Trouble shooting
PROBLEM- Ive got nothing in the room, my game wont play ANSWER : See creating rooms- You probably have more than one room and the room that you have been working on is not first in the list. Drag this room into first position in the list PROBLEM- One of my sprites is flickering when I want it to be static. ANSWER : You have accidentally added another image to your sprite but its transparent with no artwork. Delete the empty sprite image from your sprite

PROBLEM I cant draw the sprite, no colour appears when I draw. ANSWER : Check that the Opacity setting in your sprite image editor isnt 0 ( no colour- transparent) It should be set at 255 PROBLEM- My BOUNCE ACTION doesnt work ANSWER : For objects to bounce against each-other the Object must be set as SOLID PROBLEM- My COLLISION EVENT doesnt work ANSWER : For objects to collide against each-other the Object must be set as SOLID PROBLEM My object doesnt move properly ANSWER : In your ACTIONS - MOVE / JUMP setting for the object , you should have checked RELATIVE PROBLEM- My scores dont show ANSWER : You either havent made the CONTROLLER object PROBLEM My scores dont grow

Techxellent Training Solutions 2012

http://www.techxellenttraining.com.au

16

Techxellent Training Solutions 2012

http://www.techxellenttraining.com.au

17

Вам также может понравиться