Академический Документы
Профессиональный Документы
Культура Документы
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
PG
Make a SPRITE
Make an Object
Make a background
EVENTS
Make a Room
ACTIONS
Make a sound
15
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
Make a sprite
b) Name Sprite SP Always use SP as the first part of a sprites name c)Click EDIT SPRITE
e.g.
Edit
Add Empty
http://www.techxellenttraining.com.au
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
Width 96 Height 64
Width 64 Height 96
i)
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
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-
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.
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.
http://www.techxellenttraining.com.au
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
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 moving
Jump to start
Destroy Instance
Jump random
Play Sound
Bounce
Previous room
SCORE TAB
Set Score
Next room
Restart Room
http://www.techxellenttraining.com.au
10
Cont
CONTROL TAB
Questions
Check Question Set Alarm
Display message
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
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.
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 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.
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
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
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
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
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
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.
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
http://www.techxellenttraining.com.au
16
http://www.techxellenttraining.com.au
17