Tank Game Part 2 of 6.

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
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.
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.
Game Design Creating a game called PING Phase 3: Steps for building basic game.
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.
Introduction to Programming G50PRO University of Nottingham Unit 3 : Introduction To Scratch 2 Paul Tennent
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.
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.
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.
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.
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.
Tank Game Part 2 of 6. Firing Shells Coming up… Players Scores Large Explosions Small Explosions Damage Health Bars Parent Shell Destructible Walls Reappear.
SNIPING TUTORIAL – BY TMAN THE IDEA: The objective of this tutorial is to create a sniping effect. To create the sniping effect you need to create a scope.
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.
Index Background Costumes Making object walk smoothly Controlling an object with the keyboard Control an object with the mouse Changing costume when hit.
PowerPoint Tutorial.
Create a Halloween Computer Game in Scratch
Scratch for Interactivity
Street Racing Game.
Created by Stacey Wilson
Game Maker Intro to Programming Game Maker Pop Quiz (Both Groups)
User Interface & Bouncing Ball Game
MS PowerPoint 2010 Week 2.
: Animated text countdown (Advanced)
Directions for creating a PowerPoint
Competitive Multiplayer Game
Intro to GML.
The One Where You Scratch
Tank Game Part 4 of 6.
Tank Game Part 6 of 6.
European Computer Driving Licence
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
CSC 221: Introduction to Programming Fall 2018
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

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

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

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

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

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

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

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

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

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

Summary of Draw Event

Now Add a Controller Object to your Room Since the controller object does not have an associated sprite it will only show up as a question mark.

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

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

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

Animation End Add Event Other Animation end

2) You can add a transition if you would like Restart Room 1) Restart Room 2) You can add a transition if you would like Error: obj_explosion_large, end game, restart current room- Slide 52 3) OK

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

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

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

Animation End Event Add Event Other Animation end

Destroy Instance 1) Destroy Instance 2) OK

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

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.

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.

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

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

Exit if Damage < 100 1) Exit

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

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

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

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

Destroyed! 1) Destroy Instance 2) OK

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.

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

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

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

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

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.

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

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

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

Destroy 1) Destroy Instance 2) OK

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

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

Destroy the Shell 1) Destroy Instance 2) OK

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

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

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

Destroy the Shell 1) Destroy Instance 2) OK

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

Destroy Shell 1) Destroy Instance 2) OK

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

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

Jump to Start 1) Jump to Start 2) OK

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

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

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

Destroy the Shell 1) Destroy Instance 2) OK

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

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.

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

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

Obj_tank1 Key Press – Space Bar for shooting Add Event KeyPress <space>

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

Exit

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

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

Now for Tank2 Repeat slides 65-69 for Tank2 but use the Key Press <Enter> event and obj_shell2 for the create moving.

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? …