Tank Game Int 10 Unit 3 Game Maker

  • Slides: 20
Download presentation
Tank Game Int 10 Unit 3 – Game Maker

Tank Game Int 10 Unit 3 – Game Maker

Unit Overview Install Game. Maker on H: Game. Maker Terminology Introduction to GM(Tank Game

Unit Overview Install Game. Maker on H: Game. Maker Terminology Introduction to GM(Tank Game tutorial) Evaluating Video Games Planning Video Games Make Your Own

Game. Maker Terminology rooms: ◦ provide the 2 d space used to make game

Game. Maker Terminology rooms: ◦ provide the 2 d space used to make game levels and worlds. backgrounds: ◦ An image, tile, colour or combination of the three that represents a room objects: ◦ Interactive elements of the game/ room sprites: ◦ Images that are usually used to represent objects.

Game. Maker Terminology – Cont’d Instances ◦ An instance is a copy of a

Game. Maker Terminology – Cont’d Instances ◦ An instance is a copy of a Game Maker object that is created during runtime. sounds: ◦ In various formats can be loaded and played in Game Maker. scripts: ◦ A script itself is a bit of GML code that can be called either directly from GML in the Execute Script action of an object.

Tank Game Tutorial Steps to create game: 1. Create rooms, backgrounds, sprites and objects

Tank Game Tutorial Steps to create game: 1. Create rooms, backgrounds, sprites and objects 2. Make the tank move 3. Make the tank shoot in the right direction 4. Destroy enemies and bullets 5. Make enemies MORE POWERFUL!

Naming Sprites, Sounds & Objects Name every: ◦ sprite ◦ sound ◦ Object spr_XXX

Naming Sprites, Sounds & Objects Name every: ◦ sprite ◦ sound ◦ Object spr_XXX snd_XXX obj_XXX Imagine for example that you have a sprite called "Bullet", an object called "Bullet" and a sound called "Bullet". Do use letters, numbers and underscores when making a name. Do Not use spaces or weird characters like slashes, asterisks, dollar signs, ampersands, and similar. Also, don't start with a number, use it only later in the name.

Step 1 - Set up the Game area Start Game Maker and create 4

Step 1 - Set up the Game area Start Game Maker and create 4 rooms where the action will happen: ◦ Title, lvl 1, lvl 2, lvl 3, end rooms Click the 'Add Room' icon Choose a background colour In settings, make the room caption the name of the room

Step 2 - Add In the Sprites Click the 'Add Sprite' icon Name it

Step 2 - Add In the Sprites Click the 'Add Sprite' icon Name it spr_tank Click Load Sprite, and find the tank image. Repeat steps for enemy tank, bullet, and wall sprites ◦ Find sprites in resources packs or on line

Step 2 - Add In the Sprites For tank, enemy tank, and bullet ◦

Step 2 - Add In the Sprites For tank, enemy tank, and bullet ◦ Use the sprite editor in GM ◦ Make sure the sprite canvas has the same height and width Transform resize canvas (unlock aspect ratio) ◦ Modify Mask Full image ellipse ◦ Center Origin For wall sprite ◦ Leave origin x=0, y=0 ◦ Modify mask Automatic precise

Step 2 - Add In the Sprites For spr_tank ◦ We need to also

Step 2 - Add In the Sprites For spr_tank ◦ We need to also create right, down, and left tank sprites Right click spr_tank Duplicate Rename spr_tank_r(ight) Sprite editor Transform rotate (90 o to the right) Repeat for spr_tank_d(own) and spr_tank_l(eft)

Step 3 - Create the objects Click the Add Object icon ◦ Name it

Step 3 - Create the objects Click the Add Object icon ◦ Name it obj_tank Choose the tank sprite to represent the object ◦ Only add spr_tank (there should only be one tank object!) ◦ don't make it solid. Repeat for enemy tank and bullet Add in a wall object. ◦ Name it obj_wall choose the Wall sprite ◦ make it solid.

Step 3 - and add them to the room In the lvl 1 room

Step 3 - and add them to the room In the lvl 1 room window click on the “objects” tab Click on the add objects icon Add 1 spr_tank and spr_enemy_tank Add walls around the outside Select objects and left click to add to room

Tank Game Tutorial Make the Tank Move To make the tank move: 1. Make

Tank Game Tutorial Make the Tank Move To make the tank move: 1. Make the tank jump to a new location when you press the key in that direction 2. Change the sprite to make the tank face the right direction Event Press Left Button Actions Jump to new position Change sprites

Tank Game Tutorial Make the tank shoot in the right direction This is a

Tank Game Tutorial Make the tank shoot in the right direction This is a little more complex, here are the general steps: 1. Create a variable named “direction” 2. Assign a value to that variable for each direction button you press 3. Test for variable value when firing bullet.

Tank Game Tutorial Make the tank shoot in the right direction 1. In obj_player

Tank Game Tutorial Make the tank shoot in the right direction 1. In obj_player property pane 2. Event = create 3. Action = set variable (controls tab) to 90

Tank Game Tutorial Make the tank shoot in the right direction 2. Assign a

Tank Game Tutorial Make the tank shoot in the right direction 2. Assign a value to that variable for each direction button you press (<left>, <up>, <right>, and<down>)

Tank Game Tutorial Make the tank shoot in the right direction 3. 1. 2.

Tank Game Tutorial Make the tank shoot in the right direction 3. 1. 2. 3. Test for variable value when firing bullet. Event = press<Space> Action = create moving instance (main 1) Fill values in to dialogue box

Tank Game Tutorial Destroy enemies and bullets 1. If we don’t destroy bullets the

Tank Game Tutorial Destroy enemies and bullets 1. If we don’t destroy bullets the continued creation of them will crash the computer Ø How can we destroy bullets? Ø Hint: put the code in the obj_bullet property pane and destroy “self” 2. 3. How can we make enemies move? Ø What are some different ways to get the enemy to move? Ø To shoot? (you will have to create a separate obj_e_bullet) How can we destroy enemies?

Finish Up The Game… Create a functioning game with: 1. Setup 1. 2. 3.

Finish Up The Game… Create a functioning game with: 1. Setup 1. 2. 3. A starting screen with buttons Themed images for backgrounds Walls the player and enemies have to maneuver around (can’t go through) 2. A main player that: 1. Moves in all directions 2. Faces all directions it moves 3. Doesn’t move when the keys aren’t being pressed 3. Main player shoots: 1. In the direction it is facing 2. Destroyed when off screen/ or hits another objeccct 3. Only 4 projectiles at a time 4. Enemy object disappears when projectile hits it

Game Maker Challenge 5. The game ends: 1. “Die” after 3 hits 1. Go

Game Maker Challenge 5. The game ends: 1. “Die” after 3 hits 1. Go to losing screen 2. “Win” when all enemy objects from a level are gone 1. When all levels are completed (Minimum three) 2. In a wining room 6. Extensions (examples): 1. Make the enemy characters move around and shoots at ma player 2. Have power up objects 3. Make player have multiple lives as well as multiple hits to die 4. Have it take multiple shots to destroy enemies 5. Other…