LESSON FOURTEEN TOPICS: HOW TO KEEP TRACK OF AMMO, AND HOW TO RESPOND TO RUNNING OUT OF AMMO.

Slides:



Advertisements
Similar presentations
Visual Lists By Chris Brown under Prof. Susan Rodger Duke University July 2012.
Advertisements

MS-Word XP Lesson 4.
Lesson 5+: Using He- Builder/She-Builder And Adding Text! Slides are adapted from aliceprogramming.net or
Coloring Randomly: Random Selection in Alice By Jenna Hayes under the direction of Professor Susan Rodger Duke University July 2008.
Lets Play Catch! Keeping Score in Alice By Francine Wolfe Duke University Professor Susan Rodger May 2010.
Visual Basic.NET BASICS Lesson 10 Do Loops. 2 Objectives Explain what a loop is. Use the Do While and Do Until loops. Use the InputBox function. Use the.
Scratch Programming Session 6 of 10 If-then-else statements interactions Final projects specifications.
Class-Level Variables in Alice By Jenna Hayes Under the direction of Professor Rodger Duke University, July 2008.
Wizard Game: Class-Level Variables in Alice By Jenna Hayes Under the direction of Professor Susan Rodger Duke University, July
Shorter of two objects and changing color Functions, events and setting the color Susan Rodger, Duke University June 2008.
Checking for Collisions Ellen Yuan Under the direction of Professor Susan Rodger at Duke University June 2014.
Making a Boat Racing Game in Alice By Jenna Hayes Under the direction of Professor Susan Rodger Duke University, July 2010.
1 Workshop 4 (B): Visual Basic Test Project Mahidol University June 13, 2008 Paul Evenson University of Delaware Bartol Research Institute.
To download PhotoStory: Go to On the left side under Product Resources, click on Downloads.
Python Programming Using Variables and input. Objectives We’re learning to make use of if statements to enable code to ask questions. Outcomes Build an.
Shorter of two objects and changing color V2 Functions, events and setting the color in sequence and randomly This is a modification of the Changing Color.
® IBM Software Group © 2006 IBM Corporation Programmatically Rendering and Hiding JSF Controls This section describes how to hide and show JSF controls.
Changing Camera Views! Part 2: Simple Scene Change & Lighting Fixes By Bella Onwumbiko under the direction of Professor Susan Rodger Duke University July.
Introduction to Arrays. definitions and things to consider… This presentation is designed to give a simple demonstration of array and object visualizations.
Checking for Collisions: Alternative Method Erin Taylor Under the Direction of Susan Rodger July 2015 Duke University.
Changing Color, Using Text Objects, and Random Selection in Alice By Jenna Hayes Under the direction of Professor Susan Rodger Duke University, July 2008.
Working with the VB IDE. Running a Program u Clicking the”start” tool begins the program u The “break” tool pauses a program in mid-execution u The “end”
By Melissa Dalis Professor Susan Rodger Duke University June 2011 Multiplication Table.
Making a Timer in Alice By Jenna Hayes under the direction of Professor Susan Rodger Duke University July
CS Class 05 Topics  Selection: switch statement Announcements  Read pages 74-83, ,
Piñata Game: Keeping Score in Alice By Maggie Bashford Professor Susan Rodger Duke University July
1 ball, 2 ball, red ball, blue ball By Melissa Dalis Professor Susan Rodger Duke University June 2011.
Can I get your number? By Melissa Dalis Professor Susan Rodger Duke University June 2011.
Balancing the scales: Inequalities By Melissa Dalis Professor Susan Rodger Duke University June 2011.
Simple Collision Detection By David Yan Under the direction of Professor Susan Rodger and Chari Distler Duke University, June 2015.
Ready, SET, go! By Melissa Dalis Professor Susan Rodger Duke University July 2011.
® IBM Software Group © 2006 IBM Corporation JSF Rich Text Area Component This Learning Module describes the use of the JSF Rich Text Area component – for.
Visual Basic.NET BASICS Lesson 9 Nested If Statements and Radio Buttons.
Creating a UFO Rescue Game in Alice
By Melissa Dalis Professor Susan Rodger Duke University June 2011
Class-Level Variables in Alice
Motivating Minds with Windows Movie Maker
Comparing objects and changing color
Chapter 2 – Introduction to the Visual Studio .NET IDE
3.01 Apply Controls Associated With Visual Studio Form
CHAPTER FIVE Decision Structures.
3.01 Apply Controls Associated With Visual Studio Form
Programming the Web using XHTML and JavaScript
Changing Color, Using Text Objects, and Random Selection in Alice
Let's Race! Typing on the Home Row
Introduction to Events
Creating a UFO Rescue Game in Alice
Starter Write a program that asks the user if it is raining today.
Scratch for Interactivity
Vehicles and Conditionals
Learning Java with Alice 3.0 Game Design Kathy Bierscheid
Skater World: Part Three
More Selections BIS1523 – Lecture 9.
Simple Windows Applications
Items, Group Boxes, Check Boxes & Radio Buttons
Programming: Putting Together the Pieces Built-in Functions and Expressions Alice.
CIS 16 Application Development Programming with Visual Basic
Arrays
Princess & Dragon Part 2: Teaching a Dragon to Fly—Methods & Properties By Elizabeth Liang under the direction of Professor Susan Rodger Duke University.
Visual Basic – Decision Statements
Using Functions in Alice
Restricting an Event with a Conditional
Programming: Putting Together the Pieces Built-in Functions and Expressions Alice.
Using Lists and Functions to Create Dialogue
Photostory 3.
Unity Game Development
Unity Game Development
Programming: Putting Together the Pieces Built-in Functions and Expressions Alice.
under the direction of Professor Susan Rodger
Restricting Events Creating Conditional Events in Alice By Henry Qin
Presentation transcript:

LESSON FOURTEEN TOPICS: HOW TO KEEP TRACK OF AMMO, AND HOW TO RESPOND TO RUNNING OUT OF AMMO.

Step 1: How to Set Up a Bullet Counter Create a new number variable for the world object called “bulletCount”. Set the default value for bulletCount to “8”. Create a new method for the world object called “fireshot”. Add an if statement to the “world.fireshot” method. Add a second, nested if statement to the first option of the previous if statement. Set to condition for the first if statement to “world.bulletCount >= 0”

Step 2: How to Decrement the Bullet Counter Add the line right before the second if statement in the “world.fireshot” method. Make sure that the camera’s point of view is the same as PlayerView. Create a new 3D text object called “reloadText”. Set the text property for the reloadText object to “Press Space to Reload”. Set the font property for the reloadText object to “Dialogue.” Set the color property for the reloadText object to “red.”

Step 3: Create the Reload Text Set the reloadText object properties as following: reloadText.opacity = “1.” reloadText.extrusion = “0.25.” reloadText.isShowing = “false.” Set to condition for the second if statement in the world.fireshot method to “world.bulletCount <= 1” Add the line “reloadText.isShowing = true” to the first option of the nested, or second, if statement.

Step 4: How to Use the Bullet Counter Add and “if statement” to the top of the “world.shoot” method. Set the conditional of this new if statement to “world.bulletCount > 0.” Move all of the previous lines of code from the “world.shoot” method into this new if statement. Add a new “do together” clause to the “world.shoot” method right before the line: Move the “revolver.shoot” line into the new “do together” clause.

Step 5: Finishing the Bullet Counter Logic Drag-and-drop the statement from the “world.shoot” method into the “do together” clause from Step4 right before the “revolver.shoot” line. Add the “world.fireshot” method to the new “do together” clause.

Step 6: How to Capture the Reload Event Create a world method called “reload”. Add the following lines to the reload method: “world.bulletCount = 8”. “reloadText.isShowing = false”. Create a new “when a key is typed” event. Set the input for the new event to “any key.” Set the method call for the new event to “world.reload.”

Step 7: Let’s Keep Things Organized! Make sure that the reloadText object is in the Player folder.

Final Scene