Game Maker: Platform Game

Similar documents
2D Platform. Table of Contents

VACUUM MARAUDERS V1.0

Tutorial: A scrolling shooter

Objectives: Create Sprites Create Sounds Create Objects Create Room Program simple game

GAME:IT Junior Bouncing Ball

CONCEPTS EXPLAINED CONCEPTS (IN ORDER)

Competitive Games: Playing Fair with Tanks

Tutorial: Creating maze games

GAME:IT Junior Bouncing Ball

Overview. The Game Idea

GAME:IT Bouncing Ball

04. Two Player Pong. 04.Two Player Pong

Scrolling Shooter 1945

COMPUTING CURRICULUM TOOLKIT

G54GAM Lab Session 1

Game Maker Tutorial Creating Maze Games Written by Mark Overmars

Before you start, you must go into Advanced Mode. Go to: File > Advanced Mode. You know you are in Advanced Mode when the checkmark appears.

More Actions: A Galaxy of Possibilities

Space Invadersesque 2D shooter

Star Defender. Section 1

1 Shooting Gallery Guide 2 SETUP. Unzip the ShootingGalleryFiles.zip file to a convenient location.

GameMaker. Adrienne Decker School of Interactive Games and Media. RIT Center for Media, Arts, Games, Interaction & Creativity (MAGIC)

Beginner s Guide to Game Maker 4.3 Programming. Beginner s Guide to Game Maker 4.3 Programming

Annex IV - Stencyl Tutorial

In this project you ll learn how to create a platform game, in which you have to dodge the moving balls and reach the end of the level.

PING. Table of Contents. PING GameMaker Studio Assignment CIS 125G 1. Lane Community College 2015

BE SURE TO COMPLETE HYPOTHESIS STATEMENTS FOR EACH STAGE. ( ) DO NOT USE THE TEST BUTTON IN THIS ACTIVITY UNTIL THE END!

GAME PROGRAMMING & DESIGN LAB 1 Egg Catcher - a simple SCRATCH game

Your First Game: Devilishly Easy

KEEPING SCORE: HOW TO USE SCORES, LIVES AND HEALTH

TEMPLE OF LOCKS V1.0

The Games Factory 2 Step-by-step Tutorial

PLANETOID PIONEERS: Creating a Level!

CISC 1600, Lab 2.2: More games in Scratch

In this project you ll learn how to create a game, in which you have to match up coloured dots with the correct part of the controller.

Lesson 8 Tic-Tac-Toe (Noughts and Crosses)

5.0 Events and Actions

Copyright 2017 MakeUseOf. All Rights Reserved.

In this project we ll make our own version of the highly popular mobile game Flappy Bird. This project requires Scratch 2.0.

THE TECHNOLOGY AND CRAFT OF COMPUTER GAME DESIGN An introductory course in computer game design

Programming with Scratch

Module 4 Build a Game

COLLISION MASKS. Collision Detected Collision Detected No Collision Detected Collision Detected

Quintic Software Tutorial 3

C# Tutorial Fighter Jet Shooting Game

Quilt Pro 6 Lesson Quilt in a Quilt

Create a game in which you have to guide a parrot through scrolling pipes to score points.

Lesson 2 Game Basics

Introduction Installation Switch Skills 1 Windows Auto-run CDs My Computer Setup.exe Apple Macintosh Switch Skills 1

The Beauty and Joy of Computing Lab Exercise 10: Shall we play a game? Objectives. Background (Pre-Lab Reading)

Using Game Maker. Getting Game Maker for Free. What is Game Maker? Non-event-based Programming: Polling. Getting Game Maker for Free

Using Game Maker. Oregon State University. Oregon State University Computer Graphics

2

Target the Player: It s Fun Being Squished

Flappy Parrot Level 2

DESIGN A SHOOTING STYLE GAME IN FLASH 8

Game Design Curriculum Multimedia Fusion 2. Created by Rahul Khurana. Copyright, VisionTech Camps & Classes

A. creating clones. Skills Training 5

the gamedesigninitiative at cornell university Lecture 3 Design Elements

Perspective Shadow Text Effect In Photoshop

TEXT PERSPECTIVE SHADOW EFFECT

the gamedesigninitiative at cornell university Lecture 3 Design Elements

Memory. Introduction. Scratch. In this project, you will create a memory game where you have to memorise and repeat a sequence of random colours!

THE LOST CITY OF ATLANTIS

Meteor Game for Multimedia Fusion 1.5

Arcade Game Maker Product Line Requirements Model

Clickteam Fusion 2.5 [Fastloops ForEach Loops] - Guide

Pong Game. Intermediate. LPo v1

Scratch Programming Lesson 13. Mini Mario Game Part 4 Platforms

Scratch for Beginners Workbook

In this project, you will create a memory game where you have to memorise and repeat a sequence of random colours!

Photoshop: a Beginner s course. by: Charina Ong Centre for Development of Teaching and Learning National University of Singapore

FLAMING HOT FIRE TEXT

House Design Tutorial

Create a Simple Game in Scratch

Photoshop Backgrounds: Turn Any Photo Into A Background

Photoshop CS6 automatically places a crop box and handles around the image. Click and drag the handles to resize the crop box.

U-MARQ Universal Engraving. Bitmap Function. Chapter 12 Bitmaps. Bitmap Menu. Insert Bitmap

Workshop 4: Digital Media By Daniel Crippa

Storyboard for Playing the Game (in detail) Hoang Huynh, Jeremy West, Ioan Ihnatesn

MIRROR IMAGING. Author: San Jewry LET S GET STARTED. Level: Beginner+ Download: None Version: 1.5

Development Outcome 2

Introduction to Turtle Art

This Photoshop Tutorial 2012 Steve Patterson, Photoshop Essentials.com. Not To Be Reproduced Or Redistributed Without Permission.

Kodu Game Programming

Add in a new ghost sprite, and a suitable stage backdrop.

15 TUBE CLEANER: A SIMPLE SHOOTING GAME

NWN ScriptEase Tutorial

CS180 Project 5: Centipede

The original image. As I said, we ll be looking at a few different variations on the effect. Here s the first one we ll be working towards:

House Design Tutorial

Cannon Ball User Manual

Getting Started. with Easy Blue Print

Lecture 1 - Getting to know Game Maker

In this project you ll learn how to code your own musical instruments!

House Design Tutorial

Introduction. The basics

Creating Computer Games

Working with Photos. Lesson 7 / Draft 20 Sept 2003

SAVING, LOADING AND REUSING LAYER STYLES

Transcription:

TABLE OF CONTENTS LESSON 1 - BASIC PLATFORM...3 RESOURCE FILES... 4 SPRITES... 4 OBJECTS... 5 EVENTS/ACTION SUMMARY... 5 EVENTS/ACTION SUMMARY... 7 LESSON 2 - ADDING BACKGROUNDS...8 RESOURCE FILES... 8 SPRITES... 8 OBJECTS... 10 BACKGROUNDS & TILE SETS... 10 ROOMS... 11 LESSON 3 - MONSTERS... 15 RESOURCE FILES... 15 SPRITES... 15 SOUNDS... 16 OBJECTS... 16 MONSTER COLLISIONS... 16 EVENTS/ACTION SUMMARY... 17 OTHER COLLISIONS... 18 MONSTER MOVEMENT... 19 1 P age

ROOMS... 21 LESSON 4 - CLIMBING... 22 RESOURCE FILES... 22 SPRITES... 22 OBJECTS... 22 CLIMBING LADDER... 23 RAMP... 25 ROOMS... 26 GAME VIEW - SCROLLING... 27 LESSON 5 - AMMUNITION & MOVING PLATFORMS... 29 RESOURCE FILES... 29 SPRITES - AMMUNITION... 29 OBJECTS... 29 ROOMS... 31 SPRITES DISAPPEARING PLATFORMS... 31 OBJECTS... 32 ROOM... 32 SCORE PANEL... 33 SPRITES... 33 OBJECTS - BONUS... 33 OBJECTS GAME CONTROLLER... 33 ROOM... 35 EXTENSION... 35 2 P age

LESSON 1 - BASIC PLATFORM For this tutorial you are going to create a simple platform game and is based on an article written by Carl Gustafsson. Some popular examples of the platform game include Mario Bros and Sonic the Hedgehog. The following are traits usually found in platform games: The world is usually viewed from the side The player can sometimes fly, climb ladders and jump over obstacles The player usually tries to avoid enemies/monsters that could cause it to lose energy or their life There are multiple levels which get progressively more challenging as the player goes further There is an overall goal (e.g. save a princess) which the player strives to accomplish We will be building towards a more complex platform game but initially the lessons will be to establish a relatively basic platform game so that you can get the hang of some new GameMaker events and actions. 3 P age

RESOURCE FILES If you haven't done so already, you will need to copy the GameMaker folder from the S:\Computer Department\Computer Studies directory. The files required for this tutorial are located in the Lecture Resources/Resources 4. SPRITES 1. Create a new Game Maker file (File>New) then save as platform1. 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 Insert Sprite. 3. Click on the Load Sprite button and select the ball.gif file. Type sprball in the Name box and remove the background then click OK. 4. You will also need to create a sprite manually. Right-click the Sprites folder and select Insert Sprite. 5. Click the Edit Sprite button then double-click the sprite. This will take you into the Image Editor window. 6. Using the Fill Bucket select a black colour then click on the image. Resize the image so that it is 16 x 16 pixels. Click the close and save button twice then name the sprite sprblock and ensure that the background has not been removed. 4 P age

OBJECTS 7. Create objects for the two sprites created earlier and name them objball and objblock. Make objblock solid. Ensure that objball is not a solid, then using the table below, add the following events/actions for the objball object. keyboard, <left> x: -4, y: 0, relative Move x: -4, y: 0, relative keyboard, <right> x: 4, y: 0, relative Move x: 4, y: 0, relative keyboard, <up> x: 0, y: 1, relative Move vert speed: -10 collision, objblock Move direction: direction; maximum: 12 Move vert speed: 0 EVENTS/ACTION SUMMARY The combination of events and actions will allow the ball to move left or right depending on whether or not there is an obstacle blocking its path. 8. Add a new room (right click Room folder>insert Room) then click the settings tab and change the room size to a width of 640 and height of 480. Change both the snap X and snap Y values to 16. 5 P age

9. Add the relevant objects shown in the image below... 10. Test the game by pressing F5. When you click the left or right arrow key the ball should move in the appropriate direction. When you click the up arrow the ball should move straight up without stopping. We clearly need to add some more events and actions to give the ball a more realistic trajectory. In other words, after jumping up, it will fall back down in the same way that gravity works on Earth. 6 P age

11. Ensure that the objball Properties window is active by double-clicking on it. Now add the following actions to the Step event. Step, step x: 0, y: 1, relative Move direction: 270, gravity: 0.5 EVENTS/ACTION SUMMARY Move direction: 270, gravity: 0 variable: vspeed, value: 12, operation: larger than variable: vspeed, value: 12 The Step event works by checking exactly what the objball is doing at each moment during the game. The first two actions check that there isn't a solid object underneath the ball and then allows the ball to drop back to the ground using a gravity value of 0.5. Otherwise, gravity is set to zero. The last two actions prevent the vertical speed from exceeding 12. As can be seen from the diagram below, setting the direction to an angle of 270 ensures that the player moves down. 12. Save and test the game again to make sure it works correctly. 7 P age

LESSON 2 - ADDING BACKGROUNDS This is a continuation of the platform game created in the last lesson. Open the platform1 file from lesson 1. Save the file as platform2. RESOURCE FILES The files needed for this tutorial are located in the Lecture Resources/Resources 4 directory in the Game Maker folder that was copied earlier. SPRITES The current platform game needs a little more refinement to make the interface look more attractive and professional. For example, the player (which is currently the ball) will be changed into something more meaningful like a person. The background is a little dull and will also require some major changes. 1. Two different sprites (one for when the player moves left and another when they move right) are needed. Add the following sprites: File Name Remove Background player_left.gif sprleft Yes player_right.gif sprright Yes Uncheck the Precision collision checking box and set the Bounding Box for both sprites to manual. This is to prevent the sprites from being caught in a wall or a ceiling as they are different sizes. 2. You will also need to create two more sprites manually. Because these sprites will be smaller versions of sprblock, it would be easier to duplicate the sprite created in the last lesson. Right-click the sprblock sprite and select Duplicate then type sprblockh in the name box. 3. Click the Edit Sprite button and then double-click the image to edit the sprite... 8 P age

...Select the Transform menu and choose Stretch. Uncheck the Keep aspect ratio box and change the height to 8 pixels then click OK. Set the Origin Y value to 8. Save and close the sprite. 4. Duplicate the sprblock sprite again. Name the new sprite sprblockv and modify the settings so that its width is 8 pixels and the height is 16 pixels. 9 P age

OBJECTS As mentioned earlier, the player will now take the shape of a person, and depending on whether they press the left or right arrow key, the player object will face left or right. 5. Select the objplayer object and change the sprball sprite to sprright. Now add the following to the current list of events/actions that have been already applied to the objplayer object. Ensure that they are the first actions for each keyboard event. Keyboard <left> sprite: sprleft, subimage: 0, speed: 1 Keyboard <right> sprite: sprright, subimage: 0, speed: 1 6. Create objects for sprblockh (objblockh) and sprblockv (objblockv) and set the parent to Block for both objects. Ensure that the Visible property for all the blocks is unchecked. The reason for this is that the background tile that we will be adding to the game a little later will have its own 'objects' which need to be visible during gameplay. BACKGROUNDS & TILE SETS Two types of backgrounds will be used in the platform game. The first is a sky image that will appear behind all other images in the background. The second is a tile set that will be used to draw the different objects in the room. A tile set is collection of smaller images called TILES (typically of uniform size) which have been combined into a single larger image. TILE SETS are often used in 2D video games to create complex maps from reusable TILES within the set. When a TILE SET based map is displayed, the TILES that are stored within it are used to reassemble the map for display. This technique is seen in games designed to run on portable systems such as Nintendo's Game Boy Advance system or a cellular phone. Using TILE SETS reduces the amount of system memory required to display maps since it allows for the same TILES to be reused multiple times in a map. It also reduces amount of artwork needed for individual maps since many different ones can be created 10 P age

from the same TILESET. In order for maps made from TILE SETS to appear more distinctive, games typically display them with a different TILE SET for each unique environment. (From: URL - http://en.wikipedia.org/wiki/tile_set; Accessed: 14/10/08) 7. To add the sky background, right-click the Background folder and select Create Background. Click the Load Background button and select sky.gif (located in the GameMaker/Background folder). Change the name to bkdsky then save and close. 8. Repeat the above step and add the tiles.gif to the background. Check the Transparent and Use as tile set boxes and type 1 into the horizontal and vertical sep: boxes. Change the name to bkdtiles then save and close. ROOMS 9. Double-click the room to edit the room then remove all the objects that were created in the last lesson. Click on the Tiles tab and select bkdtiles. 11 P age

10. Click on the grey post in the top left corner of the tile set to select it then click in the different parts of the room to add it where needed. 11. Repeat this process by selecting the other objects in the tile set and place them where needed until the room looks like the example below. 12. To make the bkdsky visible, click the Backgrounds tab and modify the settings as shown below: 12 P age

13. The tile set images although visible are not solid and won't allow the player to walk on the or collide with them. Click the Objects tab and cover the tiled images using the various blocks. The blocks if you recall have been made invisible but are solid, so the game will give the impression that the player is walking on the various images that have been placed from the tile set. 14. Repeat the above step until all tile elements are covered with blocks. For the smaller objects such as the cloud and platform edges, you will need to change the snap settings for the room to 8 x 8. By doing this, you can now add the block objects objblockh and objblockv to fill in the smaller sections. 13 P age

15. Change the snap settings back to 16 x 16 then add the objplayer object to the room as shown. Save and test the game. The player should be able to walk and jump along the platforms. 14 P age

LESSON 3 - MONSTERS This is a continuation of the platform game created in the last lesson. Open the platform2 file from lesson 2. Save the file as platform3. RESOURCE FILES The files needed for this tutorial are located in the Lecture Resources/Resources 4 directory in the Game Maker folder that was copied earlier. SPRITES To help generate and maintain the player's interest more features need to be included in the game. For example, there might be some monsters that need to be avoided or some objects that can be collected that will increase the player's score. 1. Add the following sprites to the platform game: File Name Remove Background monster_1_left.gif sprmonsterl Yes monster_1_right.gif sprmonsterr Yes monster_1_flat.gif sprmonsterflat Yes monster_2_left.gif sprflyingl Yes monster_2_right.gif sprflyingr Yes mushrooms.gif sprmushroom Yes levelexit.gif sprlevel Yes Uncheck the Precision collision checking box and set the Bounding Box for all sprites to manual. 2. You will also need to create two more sprites from scratch. Duplicate sprblock and name this sprite sprmarker then change the fill colour to blue. Duplicate sprblockh and name this sprite sprdeath then change the colour to red. 15 P age

SOUNDS 3. Add the following sounds to the platform game: File boing.wav ao.wav ploup.wav harp.wav Name monsterkill killplayer getmushroom finishlevel OBJECTS 4. Create objects for each of the new sprites using the image below as a guide: MONSTER COLLISIONS There are two types of monsters that the player will encounter - the walking monster and the flying monster. The way that the players reacts to each monster will also be different. For example, the player will be able to destroy the walking monster by jumping on top of it. All other collisions with other monsters will result in the player losing a life. 5. Add the following events/actions to objplayer: 16 P age

collision, objmonster vspeed> 0 and y < other.y+8 Score Move sound: killmonster score: 50, relative no move, other Applies to: other; Change into: objmonsterdead, perform events: yes sound: killplayer Main2 milliseconds: 1000 transition: fade out/in collision, objflyer sound: killplayer Main2 milliseconds: 1000 transition: fade out/in EVENTS/ACTION SUMMARY The first action is checking to see if the player is in the air and above the monster. If this condition is met, then the player will be able to destroy the monster. The actual sequence of events following the player jumping on top of the walking monster is as follows: Play sound of killing monster, Add 50 to score, Stop the monster from moving, Change the normal 'alive' monster sprite into the dead monster. For all other collisions with the monster, the player dies and the room is then restarted. 17 P age

OTHER COLLISIONS There are some other collisions that the player will encounter during the course of the game. They include: Mushroom - This will add points to the player's score and destroy the mushroom Level Exit - This will proceed to a new room if it exists, otherwise it will display the high score table and restart the game Death - This will kill the player and restart the room Another event (other, outside room) will check if the player has moved beyond the height of the room, and will result in the player losing a life and the room restarting. 6. Add the remaining events/actions to the objplayer object: collision, objmushroom sound: getmushroom Score score: 10, relative destroy: other collision, objlevelexit sound: finishlevel milliseconds: 1000 Score Main2 background: bkdsky 18 P age

collision, objdeath sound: killplayer Score milliseconds: 1000 Score New lives: -1; relative other, outside room variable: y, value: room_height, operation: larger than sound: killplayer milliseconds: 1000 MONSTER MOVEMENT Each of the monsters will follow a similar movement pattern during the game. The only difference is that one of the monster types will appear to be flying. Both monsters will move in a particular direction until they encounter either a block or a marker, after which they will reverse their direction. To take into account this direction switch, the monster sprite will change into either a left-facing or right-facing monster. 7. Add the following events/actions for objmonster: Create Move direction: right, speed: 4 Step, End Step variable: hspeed, value: 0, operation: larger than sprite: sprmonsterr, speed: 1 sprite: sprmonsterl, speed: 1 collision, objblock collision, objmarker Move Move 19 P age

8. Add the following events/actions for objflyer: create Move direction: right, speed: 3 step, end step variable: hspeed, value: 0, operation: larger than sprite: sprflyingr, speed: 1 collision, objblock collision, objmarker Move Move sprite: sprflyingl, speed: 1 The variable hspeed is used to determine the direction that the monster is travelling, and hence which sprite (left or right monster) it must change into. When hspeed is greater than 0, this means that the monster is moving from left to right. 9. Add the following events/actions for objmonsterdead: create Main2 no. of steps: 10, in alarm no: Alarm 0 alarm, alarm 0 self 9. Add the following events/actions for objmushroom: create Main2 sprite: sprmushroom, subimage: random(10), speed: 0 When the mushrooms are added to the game in the next step, they will all appear to look the same. However, by using the event/action created above, the game will change the appearance of the mushroom to one of ten possible sub-images available within this sprite. 20 P age

ROOMS 10. The room will need to be modified to include the monsters, mushrooms, markers and the 'death pit'. Open the room and then select the Tiles tab. Replace the tile objects in the bottom right corner with the spikes shown in the image below: 11. Select the Objects tab and add the objects shown below. Save and test the game. 21 P age

LESSON 4 - CLIMBING This is a continuation of the platform game created in the last lesson. Open the platform3 file from lesson 3. Save the file as platform4. RESOURCE FILES The files needed for this tutorial are located in the Lecture Resources/Resources 4 directory in the Game Maker folder that was copied earlier. SPRITES This version of the game will include the addition of features such as the player being able to climb vines and walk up and down ramps. 1. Add the following sprite to the platform game: File Name Remove Background player_up.gif sprclimbing Yes Uncheck the Precision collision checking box and set the Bounding Box for all sprites to manual. 2. You will also need to create a new sprite. Duplicate sprblockv and name this sprite sprladder then change the backcolour to black and the fill colour to green. Make it transparent. OBJECTS 3. Create the object objladder using the sprite sprladder and set visible to false. 22 P age

CLIMBING LADDER 4. Modify the objplayer by adding the new events/actions as shown below. The following sequence of actions will check whether the player has made contact with the ladder. Step, step object: objladder, x:0, y:0, relative Move direction: 270; gravity: 0 variable: vspeed; value: 0 sprite: sprclimbing; subimage: 0; speed: 1 The complete set of actions for objplayer step event should like the following: 23 P age

The following sequence will actually move the player up and down the ladder if the player is in contact with it. Note that the settings for the collision at position and set vertical speed actions in the second block are the same as before. Keyboard <up> object: objladder, x:0, y:0, relative Move x:0, y:-3, objects: only solid, relative x:0, y:-3, relative x:0, y:1, objects: only solid, relative Move vert speed: -10 Keyboard <down> object: objladder, x:0, y:0, relative Move x:0, y:3, objects: only solid, relative x: 0, y:3, relative 24 P age

RAMP The following actions will allow the player to move up the ramp. Note, the first sequence of actions have not changed and will allow the player to continue moving left or right as well as moving down the ramp. Keyboard <left> sprite: sprleft, speed: 1 Move x:-4, y:0, objects:only solid, relative x:-4, y:0, relative Move x:-4, y:-8, objects: only solid, relative x:-4, y:-8, relative Move direction: 270, maximum: 8, against: solid objects Keyboard <right> sprite: sprright, speed: 1 Move x:4, y:0, objects:only solid, relative x:4, y:0, relative Move x:4, y:-8, objects: only solid, relative x:4, y:-8, relative Move direction: 270, maximum: 8, against: solid objects 25 P age

ROOMS 5. Using the vine image from the tile set as well as the objladder object that was created earlier, add the vines and ladder to the room as shown below. Add a ramp to the room using the example below as a guide. 26 P age

GAME VIEW - SCROLLING At present the entire room is visible when you play the game. A typical scrolling platform game displays only a portion of the screen at any given time and this view will depend on where the player is located. In other words, the game will follow the player's movements across the screen. 6. Open the room then click the View tab. Check the Enable the use of Views and the Visible when room starts boxes. 7. Enter 300 for W and 200 for H in both the View in room and Port on screen sections. This sets the dimensions of the view that will be seen at any given time. 8. Select objplayer from the Object following section and enter 64 for both Hbor and Vbor. Type 4 for both Hsp and Vsp. The Hbor and Vbor values determine how close the player can get to the view's border before the game starts scrolling. The Hsp and Vsp is the scrolling speed. The higher this value is the faster the scrolling speed. 27 P age

9. Save and test the game. The scrolling feature should work but the size of the actual game is a little small. 10. Double-click the Global Game Settings and change the Fixed scale value to 200% as shown. This will double the size of the room and all of its objects. Save and test the game. 28 P age

LESSON 5 - AMMUNITION & MOVING PLATFORMS This is a continuation of the platform game created in the last lesson. Open the platform4 file from lesson 4. Save the file as platform5. RESOURCE FILES The files needed for this tutorial are located in the Lecture Resources/Resources 4 directory in the Game Maker folder that was copied earlier. For the final version of the platform game, the following new features will be added: The player will be able to collect ammunition and shoot the monsters. There will be moving platforms as well as platforms that disappear when the player jumps on them. SPRITES - AMMUNITION 1. Add the following sprites to the platform game: File Name Remove Background bullet.gif sprbullet Yes ammunition.gif sprammunition Yes OBJECTS 2. Create objects objbullet and objammunition using the sprites created in the previous step. 3. When the game first starts, the player will have no ammunition to shoot. It is only when the player collects the ammunition object that it will then have the capability to fire bullets at the monster. Modify the objplayer by adding the new events/actions as shown below: Create variable: ammo, value: 0 collision, objammunition variable: ammo, value: 10, relative destroy: other 29 P age

Once the player has collected the ammunition, he will then be able to fire bullets at the monsters. The following sequence of events and actions will give the player the ability to shoot using the space bar: Key press <space> variable: ammo, value:0, operation: larger than variable: sprite_index, value: sprleft, operation: equal to object: objbullet, x:0, y:0, speed:12, direction:180, relative variable: sprite_index, value: sprright, operation: equal to object: objbullet, x:0, y:0, speed:12, direction:0, relative variable: ammo, value: -1, relative 4. The next sequence of events/actions will deal with the bullets being fired from the player's gun. Add the following events/actions to the objbullet object: collision, objblock destroy: self collision, objmonster sound: killmonster new score:50, relative destroy: other destroy: self collision, objflyer sound: killmonster new score:50, relative destroy: other destroy: self other, outside room destroy: self 30 P age

The events/actions created in this step will produce the following result: Collision with objblock - This will destroy the bullet when it hits any of the walls, platforms, etc. Collision with objmonster and objflyer - This will destroy the monster as well as the bullet and add 50 to the score (as well as play the killmonster sound). Outside room - This will destroy the bullet as soon as it leaves the room. ROOMS 5. Open the room and place the objammunition object anywhere in the room. Save and test the game. When the player collects the ammunition, they should be able to fire at and kill the monsters in the room. SPRITES DISAPPEARING PLATFORMS The new platform that you will be creating will be visible and solid to begin with, but as soon as the player makes contact with it, it will slowly disappear, causing the player to then fall. 6. Add the following sprite to the platform game: File Name Remove Background fallingblock.gif sprfallingblock Yes 7. This sprite needs to be made into an animated gif where it will start as a solid object then slowly fade away. Click the Edit Sprite button. 8. Click the Animation menu and select Disappear. Type 5 for the number of frames. 9. Ensure that the Remove Background option is selected then click OK. 31 P age

OBJECTS 10. Create an object for the falling block sprite created earlier and name it objfallingblock. The falling block will have the following properties: It will be solid in its initial state. When the player lands on the block it will slowly fade until it disappears. When the block has completely disappeared, the player will fall. 11. Create the following events/actions for the objfallingblock object: Create variable: image_single; value: 0 Step, step object: objplayer; x: 0; y: -2; relative variable:image_single; value: 0 variable: image_single; value: -1 Animation, end self ROOM 12. Modify the room to include the falling blocks in the bottom right corner (just above the pit) as shown below: 8. Save and test the game. 32 P age

SCORE PANEL Another useful feature found in most games is some type of scoring panel. As well as tracking the player's score during the game, it also can be used to display how many lives they have or the number of weapons they have at their disposal. The platform game will also give the user an opportunity to gain an extra life. SPRITES 9. Add the following sprite to the platform game: File Name Remove Background heart.gif sprbonus Yes OBJECTS - BONUS 10. Create the object objbonus using the sprite sprbonus created in the last step. 11. Modify the objplayer by adding the new events/actions as shown below: Collision, sprbonus sound: finishlevel loop: false new lives: 1 relative self OBJECTS GAME CONTROLLER A new object will be needed to control and display the scoreboard. Note: You will not need to create a sprite for this object as it won t be visible during the game. 12. Create a new object called objlifeler. 13. Create the following events/actions for the objlifeler object: 33 P age

Other, Game start Score new lives: 3 Score score caption: score lives caption: lives; health caption: health Other, No more lives Score background: sky border: show Main2 Draw Draw color: green Draw x1: view_xview + 5 y1: view_yview + 1 x2: view_xview + 100 y2: view_yview + 45 filled: filled Draw color: black Draw x1: view_xview + 5 y1: view_yview + 1 x2: view_xview + 100 y2: view_yview + 45 filled: outline Score Score x: view_xview+10 y: view_yview+10 image: sprlife x: view_xview+10 y: view_yview+28 score: Score variable: objplayer.ammo value: 0; operation: larger than x: view_xview+70 y: iew_yview+2 subimage: 0 34 P age

ROOM 14. Modify the room to include the objlifeler as shown below. Save then test the game. EXTENSION Create some more additional rooms with extra challenges to make the game more interesting. 35 P age