STEM Fuse GAME:IT MAKE AN A-MAZE-ING GAME In this assignment, you will create your own maze game using Game Maker. The game you create will be a simple maze game. The object of the game will be for the player to move through the game, encounter some enemies, and reach an end point. Creating the sprites for the game (Review) You will need to create at least 4 sprites for the game. *The Hero sprite which you should name spr_hero. *The Wall sprite which you should name spr_wall. *The Goal sprite which you should name spr_goal. *The Villain sprite which you should name spr_villain. 1. Select the Create a Sprite button on the toolbar. 2. In the Sprite Properties panel the appears, enter the name of your sprite. 3. Ensure that there is a check in the box next to the text Precise collision checking. 4. Select Edit Sprite to draw and edit your sprite. Note that sprites can also be loaded into GameMaker. These can be images created in other graphic applications or sprites you have used in games you have previously developed. 5. Double click on the image that appears. This will take you into the image editor where you can draw your
sprite. Before you start to draw your sprite in Image Editor, here are a few tips: Tip #1 The size of your canvas where you will draw your sprite is set by default 32px x 32px. This is a good size for tiles and objects within the game screen which is currently set at 640px x 480px. However, you may want to create sprites for characters and objects with different sizes. To change the canvas size so you have space to draw bigger objects and characters, select Transform from the menu and then choose Resize Canvas. Tip #2 The checkbox labeled Transparent indicates whether the rectangular background of the sprite image should be considered as transparent. Most sprites are transparent. The background is determined by the color of the leftmost bottommost pixel of the image. So make sure that no pixel of the actual image has this color. Tip #3 It s a good idea to use the Zoom In and Zoom Out tools when drawing and editing your sprite. By doing so, it will be easier to see what you are doing and you ll be able to create sprites in more detail. Tip #4 You can make your sprite an animation be adding additional images (called subimages). 6. In the image editor design your sprite. My hero sprite is shown here. Note the canvas size is still 32px x 32px. I have just zoomed in to be able to see what I was doing. 7. Once you are happy with your sprite, select the green check button in the top left corner. This will take you into the Sprite Editor panel, select the green check again to return to the Sprite Properties panel. Once there select, the OK button at the bottom. Your hero sprite will need 4 different views. Create (1) a front view (like the one here), (2) a back view, (3)a right facing and (4) a left facing view. To be later controlled by your up/down/right/left keys. Repeat the process outlined in steps 1-7 until you have set up all four sprites for your game hero, villain, goal, and wall. Note that the sprite you will use for the wall of your maze will need to be the same size 32px x 32px. You will place multiple copies of this sprite/object when you make the walls of your maze in a later step. Creating the rooms for your game We will be adding three rooms. These will be: *Title room Which we will name rm_title *Maze room which we will name rm_maze *Game Over Room which we will name rm_gameover To create each room we follow this process. 1. Select the Create a Room button on the toolbar. 2. In the Room Properties panel that appears, select the settings tab and name the room. Use the above names. 3. In the Caption for the room cell, type in a caption for your game. This will appear at the top of the game. 4. Select the green checkmark in the top left corner to save your room.
*****Repeat the process until you have set up all three rooms****** Putting your objects in the rooms We are now going to place the objects you have created in the room containing the maze. 1. Double-click on the rm_maze room on the left side folder 2. In the Room Properties panel that appears, select the Background tab and then click on the box containing the color to select the color you would like for your background. If you don t want to choose, then black should be your choice. 3. Set the values of the SnapX and SnapY cells to 32. 4. To put objects in the room, click on the Objects tab in the Room Properties panel. One of your objects will be displayed in the left section of the panel. To select a different object, simply click on this object and a menu will appear which will let you switch between objects. 5. Select the object you want to add and click on the room to add the object. If you put the object in the wrong spot, simply right click on it to remove it from the room. To add multiple copies of an object to the room quickly, simply hold down shift while clicking and dragging. Look at the beginning of this packet to see an example of a completed room. Adding text to a Room We are now going to create the Title room and Game Over room. Adding text in Game Maker requires a few steps. 1. When you add text to your game in Game Maker, by default the font is set to Arial and the size is 12 pts. You will most likely want to use a larger and more interesting font for the text in your Title and Game Over rooms. To do this, select the Create a Font button from the toolbar at the top. 2. In the font panel that appears, select the font you would like to use for your text, give this font a name such as fnt_main and increase the size of the font. select the OK button at the bottom. 3. Create a new sprite by selecting the Sprite button. 4. Name this sprite spr_title text. 5. Select Edit Sprite and enter the Sprite Editor. 6. You won t fit much text in the default image size of 32px x 32px, so select Transform > Resize Canvas. In the Resize Panel that appears, change the width to 300 px and the height to 100 px. You will need to uncheck the Keep aspect ratio box to do this. Select OK.
8. Select the Draw Text button from the toolbar at the left of the Image Editing Panel. 9. Double click on the Font area to select Font, Style and Size. 10. Enter your text in the Drawing a Text box that appears. Select OK. 10. Move your mouse over the text you have added and drag the text into the position you want it to be in. 11. When you are happy with the text, select the green check in the Image Editing panel. Then select the green check again in the Sprite Editor panel. Your text is now in a sprite that can be added to an object to display in the Title Room. 12. Select the Create an Object button to create the object for the title text. Name this object obj_titletext and select the sprite you just made Containing the text. Select OK from the bottom. 13. Double click on the room name rm_title to open the Title Room. 14. Select the Background tab and then select a background color for this room. 15. Select the Objects panel and select the title text object obj_titletext. Add this to the project page. To Add a Start Button We have nearly set up all of the elements of our game. However, at this stage, if we played the game, you would only be able to see the Title room. You would be stuck on this page as we haven t added a button for the user to click to move onto the main game area, the room called rm_maze. We need to create a start button for your game. To do this, Create a Sprite and name it spr_start. Then select the Edit Sprite option and go into the Image Editor panel and draw What you want your button to look like. You will then need to Create an Object and set up the object for the start button name it obj_start. Once you have done this, add the object to your title room. To program the start button: 1) Double click on the obj_start 2) Select the Add Event button Select the Mouse Event -- choose Left Button. 3) The action we would like to occur is on the Main 1 tab click on Next Room **what you just did is tell the computer when the left button is clicked go to the next room**
To program the Hero: 1) You will want to use the up/down/right/left arrow keys to determine direction. 2) You will activate the correct sprite direction (up arrow, the hero sprite faces away from you/ down arrow, the hero sprite faces you/right arrow, hero sprite faces right/ left arrow, faces left) 3) Add a collision event with the wall sprite select the move fixed action. Then select the stop button (center button) with speed set at 0. 4) You will also was a collision event with the villains. This could either end the game or deduct from some type of scoring system you will have to set up. 5) To win the game and get to the goal, you will need to set up a collision event with the goal. The special coding is that once you collide with the goal you will be transported to the third room Game Over. Create a Game Over room Using the techniques you learned in the Start room, create a Game Over room. Access is available only be collision with the villains or by reaching the goal. Must have (1) Graphic (2) Quit button (3) Restart Game button (items 2 and 3 need to be programmed) Must also include: Villains Keep it simple: (1) Once the villain collides with a wall, reverse direction. (2) If the villain collides with the hero, create another sprite to react (Hint: Have you ever watched the original 1960 s Batman movies they never showed you a punch landing only a big captions reading POW! WHAM! etc. ) You choose if you want the game to end or reduce some score. Demonstrate some form of animation! Possibilities: Your hero sprite, your villain spite, your collision with villain, hero reaching goal, etc Demonstrate some form of use of sound. Possibilities: Background music, collision music, movement of hero, reaching the goal. Grade and points based on: Difficulty/complexity of your 4 original sprites. Hero sprite movement. Hero Villain collision Completion of Hero to goal.
Does your programming work correctly? Do the 3 rooms work? Villain movement Some form of animation Application of Sound