Chapter 9 Using Decisions to

Slides:



Advertisements
Similar presentations
SCRATCH Lesson Two – Interactive Concepts Using Sensing, Operators, and Variables.
Advertisements

1. Tuesday: Halloween Shoot due TOMORROW. You must make a contact sheet of your photos and print it from my computer tomorrow. -5 pts for every day I don’t.
Lesson One: The Beginning Chapter 2: Processing Learning Processing Daniel Shiffman Presentation by Donald W. Smith Graphics from built-in help reference.
Click your mouse for next slide Dreamweaver – Merging, Coloring, Fonts Now it’s time to fill your page with some more interesting stuff The first thing.
Python Magic Select a Lesson: Why Learn to Code? Basic Python Syntax
HTML Lesson 1 TBE 540 Farah Fisher. Prerequisites Before beginning this lesson, the student must be able to… Access web pages and navigate the web Access.
Fundamentals of Programming in Visual Basic 3.1 Visual basic Objects Visual Basic programs display a Windows style screen (called a form) with boxes into.
With Alex Conger – President of Webmajik.com FrontPage 2002 Level I (Intro & Training) FrontPage 2002 Level I (Intro & Training)
Chapter 9 Introduction to ActionScript 3.0. Chapter 9 Lessons 1.Understand ActionScript Work with instances of movie clip symbols 3.Use code snippets.
Making a Book Report in Alice by Jenna Hayes Under the direction of Professor Susan Rodger Duke University, June 2010.
Copyright 2007, Information Builders. Slide 1 Maintain & JavaScript: Two Great Tools that Work Great Together Mark Derwin and Mark Rawls Information Builders.
Working with Numbers in Alice - Converting to integers and to strings - Rounding numbers. - Truncating Numbers Samantha Huerta under the direction of Professor.
Noadswood Science,  To know the basics of Python coding and decoding Monday, September 07, 2015.
An Introduction to Textual Programming
JQuery Page Slider. Our goal is to get to the functionality of the Panic Coda web site.Panic Coda web site.
by Chris Brown under Prof. Susan Rodger Duke University June 2012
XP New Perspectives on Microsoft Access 2002 Tutorial 51 Microsoft Access 2002 Tutorial 5 – Enhancing a Table’s Design, and Creating Advanced Queries and.
Intro to C++. Getting Started with Microsoft Visual Studios Open Microsoft Visual Studios 2010 Click on file Click on New Project Choose Visual C++ on.
Visual BasicC++ Diane Zak. Microsoft © Small (But Powerful) Basic Presented by Diane Zak.
Chapter 3 Making Decisions
Addison Wesley is an imprint of © 2010 Pearson Addison-Wesley. All rights reserved. Chapter 5 Working with Images Starting Out with Games & Graphics in.
> 1 Diagrams in Word Faculty of Health Alan Grace.
Addison Wesley is an imprint of © 2010 Pearson Addison-Wesley. All rights reserved. Chapter 7 The Game Loop and Animation Starting Out with Games & Graphics.
Flow of Control Part 1: Selection
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”
Making Python Pretty!. How to Use This Presentation… Download a copy of this presentation to your ‘Computing’ folder. Follow the code examples, and put.
1 ball, 2 ball, red ball, blue ball By Melissa Dalis Professor Susan Rodger Duke University June 2011.
Lesson Two: Everything You Need to Know
Graphics Concepts CS 2302, Fall /17/20142 Drawing in Android.
PROGRAMMING IN PYTHON LETS LEARN SOME CODE TOGETHER!
Open a new Flash File Action Script 2.0. Create a button like you did last lesson and name it Click to Play.
1 Project 2: Using Variables and Expressions. 222 Project 2 Overview For this project you will work with three programs Circle Paint Ideal_Weight What.
Positioning Objects with CSS and Tables
Template Provided By Genigraphics –
 What can I change? What can I change?  How do I change slides? How do I change slides?  How do I link an event to a slide? How do I link an event.
Desktop Publishing Lesson 1 — Working with Documents.
Project 3 File, Document, and Folder Management and Windows XP Explorer.
GCSE COMPUTER SCIENCE Practical Programming using Python Lesson 4 - Selection.
MIS 3200 – C# (C Sharp)
FOP: Multi-Screen Apps
GCSE COMPUTER SCIENCE Practical Programming using Python
Create a Halloween Computer Game in Scratch
MOM! Phineas and Ferb are … Aims:
Scratch for Interactivity
With Microsoft FrontPage 2000
3.01 Apply Controls Associated With Visual Studio Form
IF statements.
Welcome To PowerPoint.
3.01 Apply Controls Associated With Visual Studio Form
BYU China Teacher Training 2015
Chapter 5 Working with Images
Learning Java with Alice 3.0 Game Design Kathy Bierscheid
File Management File Explorer © EIT, Author Gay Robertson, 2017.
Items, Group Boxes, Check Boxes & Radio Buttons
Go to =>
Inserting Pictures and Symbols in Word documents
Introduction to TouchDevelop
A look at Python Programming Language 2018.
HOW TO MAKE PAGES FOR A WEB SITE
Instructions for Using This Template:
Using screens and adding two numbers - addda.cbl
Directions are in slide notes. You can view them in two ways
Selection Statements Chapter 3.
Running a Java Program using Blue Jay.
Chapter 1 Introducing Small Basic
Chapter 7 Empowering Programs with Math
Agenda for Unit 5: Control Structures
Add some WordArt to your cover slide
TERMS AND CONDITIONS   These PowerPoint slides are a tool for lecturers, and as such: YOU MAY add content to the slides, delete content from the slides,
Presentation transcript:

Chapter 9 Using Decisions to Make Games

LESSON: Prepare a new Chapter 9 folder on your flash drive to store the programs for this chapter. We are going to start preparing to create our very own game. Think about some themes that you would like, but do not worry about how to do it, yet, as we will go through a great deal of instructions, techniques, and ideas before you actually have to create it.

The If/ElseIf Ladder: Very useful The If/ElseIf Ladder: Very useful! Especially when you have a “cascading effect.” That is, if it does not fall within the first comparison, it tests the second, then the third, etc., though! Type this in EXACTLY as you see it and press RUN {Be careful that > and < cascades in the correct direction!} {Last comparison is just “Else.”} {Last line is “EndIf.”} (Price, 2015)

Let’s look at a program, line by line: Type this in EXACTLY as you see it and press RUN. (Price, 2015)

Remember our Truth Tables: AND & OR Operators Remember our Truth Tables: (Price, 2015) (Price, 2015)

Here’s another example from page 116: AND Operators We use AND when we want to compare items that have to BOTH be true at the same time. For example: “I have to have all A’s AND do my chores in order to go to Dallas this weekend.” Here’s another example from page 116: (Price, 2015) Why use AND here? Because our poor little kitty has to go through Door 1, AND Door 2, AND Door 3 to get his treat!

“I can hang with my friends tonight OR I can go to the movies with my OR Operators We use OR when we want to compare items where only at least is true. For example: “I can hang with my friends tonight OR I can go to the movies with my sister.” From page 116: Why use OR here? Because as long as our little kitty goes through Door 1, OR Door 2, OR Door 3, he will get his treat! (Price, 2015)

How would we express this situation? (Price, 2015) Little kitty can go through Door 1 AND Door 2, OR he can go through Door 3 to get his treat.

Sometimes, the AND statement is more efficient. The last three lines replaced: (Price, 2015)

Also, the OR statement is more efficient. The last three lines replaced: (Price, 2015)

Now, for fun stuff! Let’s practice getting shapes and images into our program (because we want our game to look great!) To start, we will go to GOOGLE IMAGES and get a cute picture of a pet: puppy, kitten, bunny, fish, bird, etc. Make note of the size. Try to get images that are not too small (blowing it up makes it fuzzy.) However, if you get a really large image, we will be going into PAINT and we can resize it, there. Click on the image and then on “View image”

Right click to copy image to get it and paste it into PAINT. IF it is too large, we will have to re-size it: -Select image, if not already selected, and choose to Re-size it. -Change the “Resize by” to Pixels. -Type “600” or smaller into the Horizontal box—the Vertical box will magically conform, as long as the “Maintain aspect ratio” is checked. -Press “OK”

Once we have saved to our flash drive, we can use it. In either case (re-sized or not), we want to save it to our flash drive. SAVE under a simple name. Remember how you spelled it, capital letters, etc.! I am using Kitten. Once we have saved to our flash drive, we can use it. Double check as to which port your flash drive is in—it is usually either E:\ or F:\. Let’s see if we can get our image onto the output. {Creates variable to trace the picture’s path.} {Assigns the Shapes OBJECT.} {Moves the Shape.} (Price, 2015)

We can also use the Shapes OBJECT get a rectangle. {Width and height.} {Gives you a chance to see it move.} (Price, 2015) {Moved to these coordinates.} Type this in EXACTLY as you see it and press RUN. The rectangle’s width is 100 pixels and the height is 50 pixels. If we wanted to move it so that the CENTER is at 200,200, We would use: Can you figure out why? Try it!

The default Graphics Window is ~620 x 440. 100 200 300 400 500 600 200 300 400

This is similar to what your program will look like when you finish.

This next program is called Guess my Coordinates This next program is called Guess my Coordinates. We will type it in three segments, as we go over what the commands are doing. The program is on pages 123- 124. You may type it in from the book. But, only type up to line 9. SAVE: GUESS MY COORDINATES. (Prce, 2015)

I will/have already put the STAR and GRID on the CEB Student Data (Q) Drive. Access it and SAVE it to your flash drive. Type this in EXACTLY as you see it and press RUN. (Price, 2015)

Add inside the While loop. REM the While/EndWhile commands Add inside the While loop. REM the While/EndWhile commands. This is Listing 9-7.

This is Listing 9-8. Add inside the While loop, right after Listing 9-7. Don’t forget your indentations!

Chapter 9 Programming Assignment Use your SHELL and SAVE AS 5 LEVEL GAME Using the coding from the previous slides, put in both a GraphicsWindow and a TextWindow Have the first user input his/her name. Use the Cursor METHODS to give instructions and readability. Use the Random METHODS pick a number from 1 (worse) to 5 (best) For five events, as each number is chosen, a message and a picture (commensurate with the message) will appear and keep a running sum. Request that the user press any key to make each one appear. Allow the second user to replay the game. Keep his/her total Compare the two totals and declare a winner. I will check via Vision. Due __________