Tank Game Part 2 of 6. Firing Shells Coming up… Players Scores Large Explosions Small Explosions Damage Health Bars Parent Shell Destructible Walls Reappear.

Slides:



Advertisements
Similar presentations
Getting Started with PowerPoint
Advertisements

GAME:IT Junior Learning Game Maker: The Control Tab.
GAME:IT Junior Ping Pong Objectives: Review skills from previous lessons Create a 2-player game Create a scoring display system Using old and new skills,
Create a Simple Game in Scratch
Create a Simple Game in Scratch
Harry Potter Scratch Game
After attending this workshop, students should be able to complete the following tasks involving MS Word:
A Christmas Scratch game
Code Club Session 3 Shark Eats Fish. Picture of finished product here.
This game is loosely based on the Whack-A- Mole arcade game.  Each game starts with 45 seconds of play.  Moles randomly pop out of holes on the landscape.
Using the Unity 98 Cordless Response System Directions : Courtesy of IHC public relations.
ABC’s of PowerPoint (Office 2007) Part 1: Basic Vocabulary Part 2: Cursors Part 3: Insert Your Text Part 4: Insert Your Pictures Part 5: Basic Tools &
GAME:IT Junior Bouncing Ball Objectives: Create Sprites Create Sounds Create Objects Create Room Program simple game.
GameMaker.  A lot of Different Definitions  Easier to Say What is NOT a Game  Movie is Not a Game  No Active Participation  Final Outcome is Fixed.
GameMaker Workshop Geoff Cameron Sarah Scialli. What this workshop will teach you GameMaker GameMaker No Programming Required No Programming Required.
Game Design Creating a game called PING Phase 3: Steps for building basic game.
Creative Commons Attribution 3.0 creativecommons.org/licenses/by/3.0 Key Abstractions in Game Maker Foundations of Interactive Game Design Prof. Jim Whitehead.
Backgrounds, Inheritance in GameMaker (BrickMania 1 of 2) Foundations of Interactive Game Design Professor Jim Whitehead January 28, 2008 Creative Commons.
GAME:IT Bouncing Ball Objectives: Create Sprites Create Sounds Create Objects Create Room Program simple game.
Game Maker Day 2 Making a Maze Game.
VIDEO GAME PROGRAMMING Video Game Programming Level One – Breakout INSTRUCTOR Big Dan Teague TEACHER’S ASSISTANT Delmar O'Donnell.
We will be creating a spaceship that simulates real movements in space. The spaceship will fire a laser beam that can destroy targets. The spaceship will.
Art 315 Lecture 5 Dr. J. Parker AB 606. Last time … We wrote our first program. We used a tool called GameMaker. The program we wrote causes a ball to.
KeyListener and Keyboard Events Another type of listener listens for keyboard entry – the KeyListener which generates KeyEvents –to implement KeyListener,
Excel CREATING A WORKSHEET AND CHART. Personal Budget Worksheet We will create a personal budget worksheet that shows you income each month and your expenses.
How to make a Shooting Target game in Scratch!. WE ARE GOING TO MAKE A TARGET GAME. This game will have: A Target that will move when clicked. A Timer.
Here’s your animation screen test Start the slide show; click an action box Make text disappear. Use connectors to link text or images. Add and animate.
11 Adding Tomato Targets Session Session Overview  We now have a game which lets a player bounce a piece of cheese on a bread bat  Now we have.
GAME:IT Helicopter Objectives: Review skills in making directional sprites Create objects that shoot and destroy for points Create random enemies on the.
Power Point Presentations “A how to primer”. Start with a “blank presentation” Instructions 1. Launch (or open) power point. 2. Close the office assistant,
GAME:IT Pinball Objectives: Review skills from Introduction Introduce gravity and friction Introduce GML coding into programming.
Game Maker Terminology
Piñata Game: Keeping Score in Alice By Maggie Bashford Professor Susan Rodger Duke University July
Game Maker – Getting Started What is Game Maker?.
Shooters in GameMaker J Parker.
Creating a Simple Game in Scratch Barb Ericson Georgia Tech June 2008.
PowerPoint Presentation Part I Creating a PowerPoint Presentation The Basics.
Game Maker Galactic Mail Advanced Group: Complete Galactic Mail, then start developing an independent project.
Game Maker Tutorial.
Typing and Formatting a Research Paper WORD 2013.
2D Platform Game Game Maker Terminology. Object  Item in a game that has behavior, such as a main character who can move.
Create a Halloween Computer Game in Scratch Stephanie Smullen and Dawn Ellis Barb Ericson October 2008.
Tutorial for Arrays and Lists. Description This presentation will cover the basics of using Arrays and Lists in an Alice world It uses a set of chickens.
Galactic Mail Part 2. Winning and Losing Exploding Asteroids Including Scoring Adding Levels And more.
Game Maker Evil Clutches.
Tank Game Part 3 of 6. Secondary Weapons and Pick ups Pick ups will appear randomly in the battle area and can be collected by driving into them. Each.
GAME:IT Junior Paddle Ball Objectives: Review skills from Introduction Create a background Add simple object control (up and down) Add how to create a.
GAME:IT Paddle Ball Objectives: Review skills from Introduction Create a background Add simple object control (up and down) Add how to create a simple.
Choose Sprite. Add collision event for object and add score action. Set your score to plus 100 and check relative.
Game 4: Pac Man Tutorial. New events/actions to learn: Animated sprites Change instances – allows you to change objects into other objects. Change sprites.
GAME:IT Mario Creating Platform Games Level 4 with GML Game Maker Language (GML) allows users more flexibility in game design. GML is similar to how real.
Creating a Simple Game in Scratch Barb Ericson Georgia Tech May 2009.
Power Point Technical Directions. Change Font: Size, Type, Color Size: –On the top toolbar, click on the arrow next to the number in a white box (not.
Game Maker Tutorials Introduction Clickball IntroductionClickball Where is it? Shooting Where is it?Shooting.
Create a Halloween Computer Game in Scratch
Street Racing Game.
Created by Stacey Wilson
Game Maker Intro to Programming Game Maker Pop Quiz (Both Groups)
: Animated text countdown (Advanced)
Competitive Multiplayer Game
Tank Game Part 4 of 6.
Tank Game Part 6 of 6.
Tank Game Part 2 of 6.
Tank Game Part 4 of 6.
Game Maker Intro to Programming Game Maker Pop Quiz (Both Groups)
Tank Game Int 10 Unit 3 – Game Maker.
Creating a Simple Game in Scratch
Presentation transcript:

Tank Game Part 2 of 6

Firing Shells Coming up… Players Scores Large Explosions Small Explosions Damage Health Bars Parent Shell Destructible Walls Reappear Creating shell objects Firing Events 2

Recording the Players score in the Controller Object 1) Create Font 2) fnt_score 3) Arial 4) Bold 5) Digits 6) OK 3

Setting The Scores 1) Open the obj_controller 2) Open the ‘Game Start’ event 3) Set Variable 4) variable: global.score1 value: 0 5) OK 4

Now Set Score2 2) Set Variable 3) variable: global.score2 value: 0 5) OK 1) Open the ‘Game Start’ event 5

Draw Event for Setting the Font 1) Add Event Draw 2) Set Font 3) Font: fnt_score Align: right 4) OK 6

Make it Dark Red 1) Set Color 2) Click Here 3) Select Dark Red 4) Ok, OK 7

Draw the score1 Variable 1) Draw Variable 2) variable: global.score1 X: 300 Y: 10 3) OK 8

Set Font to Align Left 1) Set Font 2) Font: fnt_score Align: left 3) OK 9

Make it Blue 1) Set Color 2) Click Here 3) Select Dark Blue 4) OK, OK 10

Draw score2 1) Draw Variable 2) Variable: global.score2 C: 340 Y:10 3) OK 11

Summary of Draw Event 12

Explosions!! 2) spr_explosion_large 1) Create a sprite 3) Load Explosionlarge from resources/chapter10 4) Center 13

Large Explosion Sound 1) Create Sound 2) snd_explosion_large 3) Load Sound 4) Explosion_large 5) Open 6) OK 14

obj_explosion_large 1) Create Object 2) obj_explosion_large 3) snd_explosion_large 4) depth: -10 5) Create Event 6) PlaySound 7 Sound: snd_explosion_large Loop: false 8) OK 15

Animation End 1)Add Event 2)Other 3)Animation end 16

Restart Room 1) Restart Room 2) You can add a transition if you would like 3) OK 17

Small Explosion Object 1) Create Sprite 2) spr_explosion_small 3) Load Sprite Resources/chapter10/Explosion_small 4) Center the origin 18

Explosion Small Sound 1) Create Sound 2) snd_explosion_small 3) Load Sound Resources/chapter10/Explosion_Small 19

Obj_explosion_small 1) Create Object 2) obj_explosion_small 3) spr_explosion_small 4) Depth: -10 5) Add Event Create 6) Play sound 7) snd_explosion_small Loop: false 20

Animation End Event 1)Add Event 2)Other 3)Animation end 21

Destroy Instance 1) Destroy Instance 2) OK 22

Time For Damage The Parent Tank object will be responsible for initializing the damage variable, checking for damage, and drawing the tank’s health bar on the screen. It will also be responsible for blowing up the tank when the damage reaches 100. But... Since the parent is the parent to both tanks we need a mechanism for determine who gets the points for the kill 23

Parenting object_index is a variable that records a number corresponding to the type of object it is. Every object has its own unique number which is accessed by using the object name as a variable (object_tank1, object_tank2, …) By competing object_index with obj_tank1 we can tell if the instance is an instance of player one’s tank or an instance of player two’s. 24

Stepping into Damage We’ll check the tank’s damage in the Step event of the parent tank object and increase the appropriate score if it is larger than 100. Then we’ll create a large explosion and destroy the tank. The large explosion will automatically restart the room once the animation is finished. 25

Damaging Parents 1) Open obj_tank_parent 2) Open the Create event 3) Set Variable 4) Variable: damage Value:0 5) OK 26

Checking Damage 1)Add Event 2)Step 3)Step 4) Test Variable 5) Variable: Damage Value:100 Operation: smaller than 27

Exit if Damage < 100 1) Exit 28

Check the Index 1) Test Variable 2) variable: object_index Value: obj_tank1 Operation: equal to 3) OK 29

If Tank1 is shot, add 1 to tank_2’s score 1) Set Variable 2) variable: global.score2 Value:1 3) Check the relative box. 4) OK 30

Else add 1 to tank_1’s score 1) Else 2) Set Variable 3) variable: global.score1 Value: 1 4) Check the Relative box 5) OK 31

Explode!!!!!! 1) Create Instance 2) object: obj_explosion_large 3) Check the Relative box 4) OK 32

Destroyed! 1) Destroy Instance 2) OK 33

Parents and Health Bars It would be easiest to use draw the health bar form the parent, but the two tanks have their own draw events which would take priority. So… We will use the Call Parent event action in the two tanks’ own Draw event to make sure that the parent’s Draw event is called as well. 34

Setting Health 1) Still in the obj_tank_parent 2) Add Event Draw 3) Set health 4) damage 5) OK 35

Drawing Health 1) Draw Health 2) X1: -20 Y1: -35 X2: 20 Y2: -30 3) Check the Relative Box 4) OK This will draw the tank’s health bar just above the tank itself. 36

Phone Home 1) Open obj_tank1 2) Open the Draw Event 3) Call Parent 4) OK 37

Do the same with Tank2 1) Open obj_tank2 2) Open the Draw Event 3) Call Parent 4) OK 38

Now to the Shells Only want the tank shells to damage the opponent We will create a separate shell object for each tank and put common behavior in a shell parent object We’ll also use an alarm clock to give shells a limited life span( ie range) Alarm clocks will also be used to temporarily demolish the second wall type when they are hit by shells. We’ll move the walls outside the room and use an alarm event to bring them back to their original position after a period of time. 39

Parent Shell 1) Create Sprite 2) spr_shell 3) Load Sprite: resources\chapter10\Shell.gif 4) center 40

Obj_shell_parent…Alarm 1) Create Object 2) obj_shell_parent 3) No sprite 4) Add event, Create 5) Create Alarm 5) Number of Steps: 30 6) OK 41

Add Alarm Event 1) Add Event 2) Alarm Alarm 0 42

Destroy 1) Destroy Instance 2) OK 43

End Step 1)Add Event 2)Step 3)End Step 4) Change Sprite 5) sprite: spr_shelll Subimage: direction/6 Speed: 0 44

Small Explosion 1)Add Event 2)Collision 3)Obj_wall1 4) Create Instance 5) object: obj_explosion_small 6) Check 45

Destroy the Shell 1) Destroy Instance 2) OK 46

Hitting Wall2 1)Add Event 2)Collision 3)Obj_wall2 4) Create Instance 5) obj_explosion_small 6) Check the Relative Box 7) OK 47

Move the Wall 1) Jump to Position 2) Applies to Other 3) x: Y: ) OK 48

Set Alarm for the Wall 1) Set Alarm 2) Applies to: OTHER 3) Number of steps: 300 In alarm no: Alarm 0 4) OK 49

Destroy the Shell 1) Destroy Instance 2) OK 50

Shell Hitting Shell 1)Add Event 2)Collision 3)Obj_shell_parent 4) Create Instance 5) Obj_explosion_small 6) Check the Relative box 7) OK 51

Destroy Shell 1) Destroy Instance 2) OK 52

Where’s Wall2-y? Now we need to have obj_wall2 return. 53

Check if old spot is Empty 1) Open obj_wall2 2) Add Event Alarm Alarm 0 3) Check Empty 4) x: xstart Y: ystart Objects: ALL 5) All 54

Jump to Start 1) Jump to Start 2) OK 55

Else Have the Alarm Count Down 5 1) Else (in the control tab) 2) Set Alarm 3) Number of steps: 5 In alarm no: Alarm 0 4) OK 56

Obj_shell1 1) Create Object 2) obj_shell1 3) spr_shell 4) obj_shell_parent 5) Add Event Collision Obj_tank2 6) Set Variable 7) Other 8) Variable: damage Value 10 9) Check the Relative box. 10) OK 57

Create Small Explosion 1) Create Instance 2) obj_explosion_small 3) Check the Relative box. 4) OK 58

Destroy the Shell 1) Destroy Instance 2) OK 59

For the Other Shell Do the same for Shell2 Copy duplicate obj_shell1 Rename it as obj_shell2 On the Collision event, right click -> Change Event -> Collision -> obj_tank1 60

Fire in the Hole Now to make the tanks fire shells Tank1 will fire obj_shell1 when the space bar is pressed. Tank2 will shoot obj_sheel2 when the Enter key is pressed We’ll also limit the speed with which the player can fire shells using a can_shoot variable To create bullets moving in the same direction as the tank, we will use the Create Moving action and pass in the tank’s own direction variable. 61

Tank Shooting Events 1) Open the obj_tank_parent 2) Select the Create event. 3) Set Variable 4) variable: can_shoot Value: 0 5) OK 62

Each Step add to can_shoot 1) Put a Set Variable on the top of the actions list. 2) Variable: can_shoot Value: 1 3) Check the relative box 4) OK 63

Obj_tank1 Key Press – Space Bar for shooting 1)Add Event 2)KeyPress 3) 64

Check can_shoot 1) Test Variable 2) variable: can_shoot Value_0 Operation: smaller than 3) OK 65

Exit 66

Start the shell 1) Create Moving 2) object: obj_shell1 X: 0 Y: 0 Speed: 16 Direction: direction 4) OK 3) Check Relative 67

Set the can_shoot to -10 1) Set Variable 2) variable: can_shoot Value: -10 3) OK 68

Now for Tank2 Repeat slides 99 – 103 for Tank2 but use the Key Press event and obj_shell2 for the create moving. 69

Time For Testing and Correcting Do both tanks drive correctly? Do the scores show up in red and blue? Do the health bars work? What happens when one tank destroys another tank? When you shoot an obj_wall2 does it disappear and return later? … 70