110 likes | 182 Vues
Media Software Design. DIG 3134 Fall 2012 Lecture 15a: Cowpies (Project 4 Version 2) J. Michael Moshell University of Central Florida. clker.com. Project 4: Cowpies. Examine the cowpie1 prototype. Behavior Code Examine the Requirements for Project 4. markbeam.com.
E N D
Media Software Design DIG 3134 Fall 2012 Lecture 15a: Cowpies (Project 4 Version 2) J. Michael Moshell University of Central Florida clker.com
Project 4: Cowpies Examine the cowpie1 prototype. Behavior Code Examine the Requirements for Project 4 markbeam.com
Project 4: Cowpies Requirements BEGIN with a database task: ** remember previous moves and replay them. We already provided you with a tutorial database example called "address book" to build up your database skills, and also give you some code to steal / merge with cowpie1.php.
Project 4: Cowpies This code shares the frame-drawing and coordinate-screen-drawing code with the grapher. Here we focus on the physics. How do you make cows*** fly on a parabolic path? First, we need a "physics" coordinate system instead of a chart-drawing system.
PHP Graphics The Coordinate System (for our example) x 0 800 y 0 600 600 0 yup = 600-y (so y=600 – yup) Excerpt from DA Text
Cowpie1.php - Items to discuss * Look over the Project Requirements * Horizontal, vertical and tangential velocity * Putting text into the image; the Font file * The X option and the Numbers Option * Why I printed the numbers twice, at $x and $x+2. Experiment with this. * Demonstrate cowpie4.php, with database storage. * "Sneak peek" at JMM's cowpie4.php, lines 243-253
Cowpie1.php - Items to discuss * Horizontal, vertical and tangential velocity Q: What's a cosine? what's a sine? Must I know this stuff? A: a cosine is a number between 0 and 1 that tells you how to split up a diagonal movement into two components. V x = V * cos(ø) ø x
Cowpie1.php - Items to discuss * Horizontal, vertical and tangential velocity Q: What's a cosine? what's a sine? Must I know this stuff? A: a cosine is a number between 0 and 1 that tells you how to split up a diagonal movement into two components. x = V * cos(ø) But ø must be in RADIANS If Ø is in degrees, ø = Ø * pi()/180 V ø x
Cowpie1.php - Items to discuss * Horizontal, vertical and tangential velocity Q: What's a cosine? what's a sine? Must I know this stuff? A: a sine is another number between 0 and 1 that tells you how to split up a diagonal movement into two components. y = V * sin(ø) But ø must be in RADIANS If Ø is in degrees, ø = Ø * pi()/180 V y ø x
Cowpie1.php - Items to discuss * Horizontal, vertical and tangential velocity Q: What's a cosine? what's a sine? Must I know this stuff? A: (Only if you want an A in this course ... ) y = V * sin(ø) But ø must be in RADIANS If Ø is in degrees, ø = Ø * pi()/180 V y ø x
A leftover from a previous Battleship project: Examine islands.txt