140 likes | 226 Views
Videogame Design. Washington Irving Middle School Citizen Schools Fall ‘06. Circle of Evaluation Cedrick and Yar. Values and Types Yar and Evan. Numbers Strings Booleans Images. The Design Recipe Kassandra and Artehanna. State the Problem Define the Data Make the Contract
E N D
Videogame Design Washington Irving Middle School Citizen Schools Fall ‘06
Values and TypesYar and Evan • Numbers • Strings • Booleans • Images
The Design Recipe Kassandra and Artehanna • State the Problem • Define the Data • Make the Contract • Give Examples • Take Inventory • Code • Test
State the Problem A rocket takes off at a speed of 7 meters per second. Write a function rocket-height that takes the time as input and calculates the height.
Data Definition Time is a Number
Contract ; rocket-height : Number -> Number
Examples (rocket-height 13) should be 91
Take Inventory ; rocket-height : Number -> Number (define (rocket-height time) …)
Code ; rocket-height : Number -> Number (define (rocket-height time) (* 7 time)
Test the Examples If it worked you did it right! If not….salted!
ConditionalsCelin (define (move x) (cond [(= x 1) “scissors”] [(= x 2) “rock”] [(= x 3) “paper”]))
The GameMarduche • Three “characters” in the game • The Target (flies around) • The Missile (hits the target) • The Gun (moves and fires the missile) • Each character has a function that draws it, and one that updates it • The distance formula tells if the missile has hit the target
The Game target Missile Gun