Date post: | 31-Dec-2015 |
Category: |
Documents |
Upload: | zelda-rutledge |
View: | 21 times |
Download: | 0 times |
Videogame Design
Washington Irving Middle School
Citizen Schools Fall ‘06
Circle of Evaluation Cedrick and Yar
Values and TypesYar and Evan
• Numbers
• Strings
• Booleans
• Images
The Design Recipe Kassandra and Artehanna
1. State the Problem
2. Define the Data
3. Make the Contract
4. Give Examples
5. Take Inventory
6. Code
7. 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
Gun
Missile