Presentation is loading. Please wait.

Presentation is loading. Please wait.

Tank Game Int 10 Unit 3 – Game Maker.

Similar presentations


Presentation on theme: "Tank Game Int 10 Unit 3 – Game Maker."— Presentation transcript:

1 Tank Game Int 10 Unit 3 – Game Maker

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

3 GameMaker Terminology
rooms: provide the 2d 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.

4 GameMaker 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.

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

6 Naming Sprites, Sounds & Objects
Name every: sprite  spr_XXX sound  snd_XXX Object  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.

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

8 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

9 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

10 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 (90o to the right) Repeat for spr_tank_d(own) and spr_tank_l(eft)

11 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.

12 Step 3 - and add them to the room
In the lvl1 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

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

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

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

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

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

18 Tank Game Tutorial Destroy enemies and bullets
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” 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?

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

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


Download ppt "Tank Game Int 10 Unit 3 – Game Maker."

Similar presentations


Ads by Google