Game Maker: Maze Tutorial - Weebly

10m ago
13 Views
1 Downloads
1.56 MB
38 Pages
Last View : 15d ago
Last Download : 3m ago
Upload by : Camille Dion
Transcription

Game Maker: Maze Tutorial TABLE OF CONTENTS WHAT IS GAME MAKER? . 2 GAME MAKER SCREEN . 2 LESSON 1 – THE CLOWN GAME . 4 SPRITES - CLOWN . 4 BACKGROUND – CLOWN . 6 SOUND – BOUNCE . 6 OBJECTS – WALL & CLOWN . 6 CREATE EVENT – THE CLOWN . 7 ALARM EVENT – THE CLOWN . 9 COLLISION EVENT – THE CLOWN HITS A WALL . 9 MOUSE EVENT – HIT THE CLOWN . 10 ROOMS – ENTER THE CLOWN. 11 LESSON 2 – THE MAZE GAME . 12 SPRITES – BASIC WALL, PERSON & GOAL. 12 OBJECTS – BASIC WALL, PERSON & GOAL . 12 EVENTS/ACTIONS – PLAYER MOVEMENT . 12 ROOMS – MAZE 1 . 14 LESSON 4 – MAZE GAME PART 2 . 15 SPRITES – DIAMONDS & 3-D WALLS . 15 SOUNDS – MUSIC & SOUND FX . 16 BACKGROUND – ROOM & SPLASH BACKGROUND . 16 FONTS – SCORE FONT . 17 OBJECTS – DIAMONDS & 3-D WALLS . 17 CONTROLLERS . 20 ROOMS – SPLASH PAGE . 21 LESSON 5 – MAZE GAME PART 3 . 24 SPRITES – MONSTERS, BOMBS & BLOCKS . 24 SOUNDS – OTHER SOUND FX . 25 OBJECTS – MONSTERS, BOMBS & BLOCKS . 26 MONSTER COLLISIONS. 27 THE BLOCK. 28 MONSTER MOVEMENT . 29 THE HOLE . 31 THE BOMB, TRIGGER & EXPLOSION . 31 PLAYER SPRITE UPDATE . 33 SOUNDS - LIFE . 33 OBJECTS – PLAYER & LIFE . 33 ROOMS – ADDITIONAL . 34 LESSON 6 – COMPLETING THE MAZE GAME . 36 SPRITES – ONE RING TO RULE THEM ALL . 36 GAME INFORMATION . 37 1 P a g e

Game Maker: Maze Tutorial WHAT IS GAME MAKER? Game Maker is a program that can be used to create games quickly and easily, and without the need to learn a programming language. Although the program allows you to create a game using the Game Maker scripting language (GML), it is possible to create a game without using any programming code. Game Maker works by using a series of events and actions to perform certain tasks in the game. An example of this could be that when the left arrow key on your keyboard is pressed (event), a player on the screen will move left (action). A summary of all the Game Maker events and their primary function is included after the final lesson. The following tutorials are based on the official PDF files available on the St Peters Intranet as well as from the official Game Maker website. They have been modified slightly to make them easier to follow and understand. Before You Start You will need to copy the Game Maker folder from the S:/Resources directory to your home (H:) drive. GAME MAKER SCREEN After you start Game Maker the following screen should appear. Click on the Continue Using the Lite Edition button. 2 P a g e

Game Maker: Maze Tutorial If you are starting Game Maker for the first time it will be in Basic Mode. You will need to switch to Advanced Mode as it has additional options that you will need a little down the track. To change to Advanced Mode, click on the File menu and select Advanced Mode. The main components used to create games in Game Maker include the following: Component Description Prefix Example Sprites This can be an image or a series of images such as animated gifs. Sprites contain additional properties such as transparency, width, height, bounding box, collision detection. spr sprPlayer Objects These are the ‘living' actors that are given behaviours which respond to events. For example, the arrow keys (events) will initiate their movement across the screen (actions). obj objPlayer Sounds This can include sound fx (e.g. bouncing ball, laser shot) or background music for the game. Game Maker allows the mp3, midi or wav format. snd sndMusic Backgrounds These are used to add background images to the game. This background can either be static (still) or animated. bgr bkdRoom Room Rooms are the stage where the objects ‘act'. - - The other components of the Game Maker screen (paths, scripts, time lines) are used in the Advanced Mode. They will not be needed at this stage of the tutorial. 3 P a g e

Game Maker: Maze Tutorial LESSON 1 – THE CLOWN GAME You are going to create a simple game that involves using your mouse to click onto a clown that is moving around the screen. Resource Files The files needed for this tutorial are located in the Lecture Resources/Resources 2 directory in the Game Maker folder that was copied earlier. SPRITES - CLOWN 1. Create a new Game Maker file (File New) then save as CLOWN. Remember to save the file every few minutes. 2. You will need to add a number of sprites for this game. To do this right-click on the Sprites folder and select Create Sprite. 4 P a g e

Game Maker: Maze Tutorial 3. Click on the Load Sprite button and select the clown.bmp file from the Resources 2 folder. Ensure that the Remove Background box is checked (this will make the background transparent) then click Open. Type sprClown in the Name box then click OK. 4. Repeat the last two steps and load the wall image using an appropriate sprite name, e.g sprWall. 5 P a g e

Game Maker: Maze Tutorial BACKGROUND – CLOWN 5. Right-click the Backgrounds folder and select Insert Background. 6. Click on the Load Background button and select the background.bmp file then click Open. Type background in the Name box then click OK. SOUND – BOUNCE 7. Right-click the Sounds folder and select Insert Sound. 8. Click on the Load Sound button and select the bounce.wav file then click Open. Type sndBounce in the Name box then click OK. 9. Repeat the last two steps for the click.wav and music.mid files using appropriate sound names, e.g. sndClick, sndMusic. OBJECTS – WALL & CLOWN 10. Right-click the Objects folder and select Insert Object. 11. Click on the Object Selection button and select sprWall. Type objWall in the Name box and tick the Solid and Visible checkboxes then click OK. 6 P a g e

Game Maker: Maze Tutorial 12. Repeat the last two steps for the sprClown sprite but do not make it solid. Events/Actions Attaching events and actions to objects gives ‘life’ or interactivity to the game. An object might react to an event (such as a collision with the wall) and it’s re-action might be that it bounces back off the wall. There are many events and actions that can shape your game. Rather than explain the function of each event and action available in Game Maker, you will learn some of these as you construct the Clown game. Use the Help menu in Game Maker if you wish to learn a little more about them. CREATE EVENT – THE CLOWN 13. Ensure that the objClown object is active then click the Add Event button and select Create. 7 P a g e

Game Maker: Maze Tutorial 14. In the Main1 action list select the Play a Sound action. Select the sndMusic sound file and set the loop value to true. This will cause the music file to repeat forever. Click OK. 15. In the Move action list select the Move Fixed action. Click all 8 directional buttons. Don’t include the centre direction as this will stop the object from moving. Set the speed to 4 (you can change this to a higher value if you think the clown is moving too slowly) then click OK. Note: By selecting the 8 different directions, Game Maker will randomly choose which direction to move at the start of the game. 16. To make the game less predictable we will add an alarm clock. In the Main2 action list select the Set Alarm action. Set the number of steps to 50 and the in alarm no to Alarm 0. 8 P a g e

Game Maker: Maze Tutorial ALARM EVENT – THE CLOWN 17. Click the Add Event button and select Alarm then Alarm 0. 18. From the Move action list add the Move Fixed 19. From the Main2 action list add the Set Alarm action. Click all 8 directional buttons and set the speed action. Set the number of steps to 50 and the in alarm to 0 and check the relative box then click OK. no to Alarm 0. COLLISION EVENT – THE CLOWN HITS A WALL Ensure that the objClown is still open 20. Click the Add Event button and select Collision with objWall event. In the Move action list select the Bounce action. Accept the default settings and click OK. 9 P a g e 21. In the Main1 action list select the Play a Sound action. Select the sndBounce sound file and set the loop to false (this will play the file only once). Click OK.

Game Maker: Maze Tutorial MOUSE EVENT – HIT THE CLOWN 22. Click the Add Event button and select Mouse then Left button. In the Main1 action list select the Play Sound action. Select the sndClick sound file and set the loop to false then click OK. 23. In the Score action list select the Set Score action. Set the new score value to 10 and check the Relative box (this will ensure that the score keeps accumulating by 10 points) then click OK. 24. In the Move list, add the Jump To Random action and set both snap options to 0. 25. In the Move list add the Move Fixed action. Click the middle (stop) directional button, set the speed to 0.5 and check the Relative box (this will ensure that the speed of the clown gradually increases each time you hit it) then click OK. Check that the events and actions match the list below: Create 10 P a g e Alarm 0 Collision with objWall Left pressed

Game Maker: Maze Tutorial ROOMS – ENTER THE CLOWN 25. Right-click the Rooms folder and select Insert Room. 26. Because the size of the sprites are 32 x 32 pixels it would make placing the objects in the room a lot easier if the Snap x and Snap y values were set to 32 (located at the top of the room dialog). 27. Click on the background tab then click the object selection button created earlier. and select the background that was 28. It is now time to add the objects that will form the basis of the clown game. Click on the Objects tab then click the object selection button and select the objWall object. 29. Use the left mouse button to place the wall around the boundary of the room. If you make a mistake use the right-mouse button to remove the object from the Stage. 30. Click the object selection button and select the objClown object and place one instance in the middle of the room. 31. Save the file then press the Run Game 11 P a g e button to play and test the game.

Game Maker: Maze Tutorial LESSON 2 – THE MAZE GAME You are going to create a maze game that involves using your keyboard to move your player around a number of rooms. Resource Files The files needed for this tutorial are located in the Lecture Resources/Resources 3 directory in the Game Maker folder that was copied earlier. SPRITES – BASIC WALL, PERSON & GOAL 1. Create a new Game Maker file (File New) then save as MAZE. Remember to save the file every few minutes. Add the following sprites: File Name Remove Background wall.gif sprWall No person.gif sprPerson Yes goal.gif sprGoal Yes OBJECTS – BASIC WALL, PERSON & GOAL 2. Create objects for all the sprites above (objWall, objPerson, objGoal). Make sure that the objWall object is solid. EVENTS/ACTIONS – PLAYER MOVEMENT 3. Ensure that the objPerson object is active (i.e. double-click objPerson) then click the Add Event button and select Collision, objWall. 12 P a g e

Game Maker: Maze Tutorial 4. In the Move action list select the Move Fixed action. Click the middle directional button (stop) then click OK. In other words, when the player hits a wall it will stop moving. Therefore, it is not important what value the speed is. 6. In the Control action list select the Check Grid action. Type the value 32 into both the snap hor and snap vert box. This action will make sure that the player doesn't get stuck anywhere in the maze if the sprite isn't aligned properly. 7. In the Move action list select the Move Fixed action. Click the left button and set the speed to 4 then click OK. 5. Click the Add Event button and select Keyboard, Left . 8. Using the table below to add the remaining Events and Actions for the objPerson object: Event Action List Control Keyboard right Move Control Keyboard down Move Control Keyboard up Action Check Grid Move Fixed Check Grid Move Fixed Check Grid Move Settings snap hor: 32; snap vert: 32 Direction - Right button; Speed - 4 snap hor: 32; snap vert: 32 Direction - Down button; Speed: 4 snap hor: 32; snap vert: 32 Direction: Up button; Speed: 4 Move Fixed Control Keyboard no key Check Grid Move Direction - Stop button (middle); Speed: 4 Move Fixed 13 P a g e snap hor: 32; snap vert: 32

Game Maker: Maze Tutorial 9. The events/actions for the objPerson object will allow the user to use the arrow keys to move the player up, down, left and right. The no key event is included so that when the user releases any of these keys the player will stop moving. 10. Open the objGoal object and add the following events/actions: Event Action List Main1 Main1 Action If next room exists Go to next room Settings - Transition (optional) Collision objPerson Control Main 2 Else Restart game - - 11. The events/actions for the objGoal object will allow the player to move to the next room (if it exists) once it collides with objPerson object. ROOMS – MAZE 1 12. Add a new room (right-click on Rooms folder, Add Room) 13. Click the settings tab and change the room size to 480 x 480, caption to Simple Maze and the snap x and snap y values to 32. 14. Click the objects tab then select the appropriate object to create the following room using the objWall, objGoal and objPerson objects. 15. Save the game and test. 14 P a g e

Game Maker: Maze Tutorial LESSON 4 – MAZE GAME PART 2 This is a continuation of the maze game created in the last tutorial. Open the maze file from lesson 3. In this lesson, you will create an additional room in which you will need to collect diamonds before you can proceed to the next level. You will adjust the walls of the room using different sprites so that it looks a little more realistic. Resource Files The files needed for this tutorial are located in the Lecture Resources/Resources 3 directory in the Game Maker folder that was copied earlier. SPRITES – DIAMONDS & 3-D WALLS 1. Add the following sprites: File Name Remove Background wall corner.gif wall corner No wall horizontal.gif wall horizontal No wall vertical.gif wall vertical No diamond.gif sprDiamond Yes 2. You will also need to create a sprite manually. Right-click the Sprites folder and select Add Sprite. 3. Click the Edit Sprite button then click the File New to create a new sprite. Set the width and height to 32 then click OK. Double-click the transparent sprite that should now be visible on your screen. This will take you into the Image Editor window. 4. Using the Fill Bucket 15 P a g e select a red colour from the palette then click on the image.

Game Maker: Maze Tutorial 5. Click the close and save button Background box. twice then name the sprite sprDoor and uncheck the Remove SOUNDS – MUSIC & SOUND FX 6. Add the following sounds: File Name background music sndMusic diamond sndDiamond door sndDoor goal sndGoal BACKGROUND – ROOM & SPLASH BACKGROUND 7. Right-click the Backgrounds folder and select Add Background. 8. Click on the Load Background button and select the background2.bmp file, type bkgd main in the name box then click OK. 9. Create a Splash Page image background similar to the example below using Fireworks or Photoshop. The image size should be 550 x 500 pixels. When you have finished, save the image as background start (the format can be either a gif, jpeg or png file). 10. Right-click the Backgrounds folder and select Add Background. 11. Click on the Load Background button and select the start background file. Type background start in the name box then click OK. 16 P a g e

Game Maker: Maze Tutorial FONTS – SCORE FONT 12. Right-click the Fonts folder and select Add Font. Modify the settings as shown below: OBJECTS – DIAMONDS & 3-D WALLS 13. Create objects for each of the sprites created earlier using the names objCor, objHor, objVer, objDiamond and objDoor. Make all wall objects solid. Use the image as a guide to replace the old wall with the new wall objects 17 P a g e

Game Maker: Maze Tutorial 14. Set the Parent property to objWall as shown below. Because we want all the walls to behave like the objWall object that was created in the last lesson, setting the parent property will save time as we don't have to create a collision event for each wall type. Make sure that the other wall types have the objWall as the parent. 15. The objDiamond object is going to be used to accumulate points in the maze. Using the table below create the following events/actions for the objDiamond object: Event Action List Score collision, objPerson Main1 Main1 Action Set the score Play sound Destroy instance Settings new score: 10; relative sound: sndDiamond; loop: false applies to: self Events/Actions Summary The sequence of events and actions will result in a score of 10 being added each time a diamond is collected. The sndDiamond sound will then be played followed by the removal of the diamond from the screen. 18 P a g e

Game Maker: Maze Tutorial 16. Open the objGoal object. It should still have a list of actions that you added in the previous lesson. Using the table below add the following actions to the collision with objPerson event: Event Action List Action Settings Score new score: 100 relative Main1 sound: sndGoal, loop: false Main2 milliseconds: 1000 Main1 Control Main1 collision, objPerson Transition: fade out and in Control Control Main2 Congratulations! Score new score: 500 relative Score Main2 Control The final list of actions should look like the diagram below. 19 P a g e

Game Maker: Maze Tutorial Events/Actions Summary The sequence of events and actions will result in a score of 100 being added followed by the sndGoal sound being played and a pause of 1 second. The game will then check if another room exists. If the room exists then the game will proceed to that room. Otherwise, a congratulations message will appear, a score of 500 will be added, the highscore table will be shown followed by the game restarting. Note the use of the start and end block. The start and end block actions must be used each time an If action (e.g. If the number of instances is a value) is followed by two or more other actions (e.g. Play sound and Destroy instance actions). 17. Using the table below add the following events/actions for the objDoor object: Event Action List Control Control collision, objPerson Main1 Main1 Control Action If the number of instances is a value Settings object: objDiamond; number: 0; operation: Equal to Start of block Play sound Destroy instance sound: sndDoor; loop: false applies to: self End of block Events/Actions Summary The sequence of events and actions will result in the objDoor object being used to block the objGoal object in the maze. The door will open (i.e. it will disappear) and the sndDoor sound played after all the diamonds have been collected by the player, i.e. when the number of diamonds is equal to 0. CONTROLLERS Controllers are objects that perform actions based on events but are not actually seen by the player and therefore do not require any sprites to be created. The maze game requires two controllers: the first controller will be used at the start of the game (to reset the score amongst other things) while the second one will be used in every room (e.g. to keep track of the score, etc.). 18. Right-click the Objects folder and select Insert Object. Type controller start in the Name box and uncheck the Visible box. 20 P a g e

Game Maker: Maze Tutorial 19. Using the table below add the following events/actions for the controller start object: Event Action List Action new score: 0 Score Main1 Create Settings show score: don't show; show lives: don't show Score new lives: 3 sound: sndMusic; loop: true Keypress any key Main1 transition: fade out and in Events/Actions Summary The sequence of events and actions will result in the score being reset to 0, background music being played and the scores being hidden. When a key is pressed the game will move to the next room. 20. Right-click the Objects folder and select Insert Object. Type controller main in the Name box and uncheck the Visible box.Using the table below add the following events/actions for the controller main object: Event Draw Action List Action Settings Draw font: score font Draw color: red Score x: 0, y: 0, caption: Score; Relative text: Lives; x: 90; y: 0; relative x: 150; y: 0; sprite: sprHeart Events/Actions Summary The sequence of events and actions will result in the controller being used to set the font colour and position of the score. ROOMS – SPLASH PAGE 21. Add a new room (right-click on Rooms folder, Add Room) 22. Click the settings tab and change the room size to 480 x 512, caption to A-Mazing! , the snap x and snap y values to 32 and room start in the Name box. 23. Click the background tab then click the add 21 P a g e button and select the background start background.

Game Maker: Maze Tutorial 24. Click the objects tab then select the controller start object and place anywhere in the room. The object appears as the following symbol in the room. 25. Open room1 and modify the room size to a height of 512. Place the controller main object in the bottom left corner. 26. Add a new room (right-click on Rooms folder, Add Room) to create room2. 27. Click the settings tab and change the room size to 480 x 512, caption to Collect all the diamonds! , the snap x and snap y values to 32 and type room2 in the Name box. Place the controller main object in the bottom left corner as well as the other objects so that it looks like the example below. 22 P a g e

Game Maker: Maze Tutorial 28. Re-order the rooms by dragging the room up or down so that they are in the following order: room start, room1, room2. 29. Save the game and test. If you are finding that the player gets stuck when it hits the wall, you will need to open the each of the sprites and uncheck the Precise Collision Checking option. 23 P a g e

Game Maker: Maze Tutorial LESSON 5 – MAZE GAME PART 3 This is a continuation of the maze game created in the last tutorial. Open the maze file from lesson 4. In this lesson, you will add the extra challenge of trying to avoid monsters in the maze. You will also use bombs to explode walls. Resource Files The files needed for this tutorial are located in the Lecture Resources/Resources 3 directory in the Game Maker folder that was copied earlier. SPRITES – MONSTERS, BOMBS & BLOCKS 1. Add the following sprites: File Name Remove Background monster1 nice.gif sprMonsterlr Yes monster2 nice.gif sprMonsterud Yes monster3 nice.gif sprMonsterall Yes person.gif sprLives Yes bomb.gif sprBomb Yes trigger.gif sprTrigger Yes explosion.gif sprExplosion Yes block.gif sprBlock Yes Open the sprMonsterlr to view the image. Click on the next subimage button . You should notice that the sprite is made up of a number of different images (similar to an animated gif). We will take advantage of this a little later in the tutorial as we will be able to display the relevant view of the monster sub-image depending on which direction it is going. Look at the other sprites to see their sub-images. 2. You will also need to create a new sprite manually. Right-click the Sprites folder and select Add Sprite. 3. Click the Edit Sprite button then select the File menu and New. Enter 32 for both the Width and Height values then click OK. 24 P a g e

Game Maker: Maze Tutorial 4. Double click on the blank sprite. This will take you into the Image Editor window. Using the Fill Bucket select a green colour then click on th

Game Maker: Maze Tutorial 2 Page WHAT IS GAME MAKER? Game Maker is a program that can be used to create games quickly and easily, and without the need to learn a programming language. Although the program allows you to create a game using the Game Maker scripting language (GML), it is possible to create a game without using any programming code.

Related Documents:

Game Maker V7000 Chop Top* VMPL0Cxxx G678 G595 Game Maker V7000 Casino* VMPL0Wxxx G676 G595 Game Maker V7000 Slant Round Top VMPL0Dxxx G679 Game Maker V7000 14" VMPL0Nxxx G588 G591 Game Maker V7000 20" VMPL0Qxxx G612 G583 Game Maker V7000 Bartop VMPL0Fxxx Game Maker V7000 Slant (France) VMPL0Sxxx G605/G679 G708# Game Maker .

designing a game. A good game is exciting, surprising and addictive. There should be clear goals for the player, and the user interface should be intuitive. The game we are going to make is a maze game. Each room consists of a maze. To escape the maze the player must collect all diamonds and then reach the exit. To do so the

Creating a 3D game in OpenGL is both challenging and rewarding. There are many resources and libraries available to create a very realistic and high-end video game. We were able to make use of these resources to create a 3D maze game called the Crystal Maze. This game requires navigating through a 3D maze as well as solving riddles and

Reading (R-CBM and Maze) Grade 1 Grade 2 R-CBM Maze R-CBM Maze Tier 2 Tier 1 Tier 2 Tier 1 Tier 2 Tier 1 Tier 2 Tier 1 Fall 0 1 21 55 1 4 Winter 14 30 1 3 47 80 4 9 Spring 24 53 3 7 61 92 8 14 Grade 3 Grade 4 R-CBM Maze R-CBM Maze Tier 2 Tier 1 Tier 2 Tier 1 Tier 2 Tier 1 Tier 2 Tier 1 Fa

upon time all students will begin the maze and upon completion they will record how long it took them to make it through the maze to the nearest second. Students record their maze completion time value on a post-it note to be collected by the teacher. Class maze completion times are written in an appropriate column on the board (male or female).

MAZE RUNNER. ou’ve probably played a maze game . before, but have you ever tried making one? Mazes can be tricky to complete, but they’re easy to program. In this chapter, you’ll create a game that lets the player guide a cat through a maze to reach its goal—a delicious apple! You’ll learn how to move the cat with the

1. Preheat Breakfast Sandwich Maker until green PREHEAT light comes on. Lift cover, top ring, and cooking plate. 2. Place half of croissant, cut-side up, in bottom ring of Breakfast Sandwich Maker. Top with cheese, apple slices, and bacon. 3. Lower cooking plate and top ring. Add egg to cooking plate. Pierce yolk with a fork or toothpick. 4.File Size: 4MBPage Count: 16Explore further47 Breakfast Sandwich Maker Recipes ideas - Pinterestwww.pinterest.comRecipes for Sandwich Maker - Hillbilly Housewifewww.hillbillyhousewife.comHamilton Beach Breakfast Sandwich Maker Hamilton Beachwww.hamiltonbeach.co.ukBreakfast Sandwich Maker - HamiltonBeach.comhamiltonbeach.comBreakfast Sandwich Maker - HamiltonBeach.cahamiltonbeach.caRecommended to you b

Why the AMC’s are Trivial Brandon Jiang January 24, 2016 1 How to Use this Document This could possibly be used as a sort of study guide, but its main intent is to of- fer students some direction to prepare for this contest other than just doing past problems. Note that it is assumed that the reader is mathematically capable of understanding the standard curriculum at school. If not, the .