1 / 26

Programming for Game Designers

This is an overview of the topics covered in Class 11 of the Programming for Game Designers course taught by Professor Ira Fay. The topics include Game Guru, observing rules of the game, scoring, characters, animations, audio, user interface, and more. The class also includes information about the final project and outside activities.

emilyl
Download Presentation

Programming for Game Designers

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Programming forGame Designers Professor Ira Fay Class 11

  2. Overview • Game Guru • Programming for Game Designers

  3. Game Guru • Observe • Rules of the game • Scoring • Characters • Animations • Audio • User interface • Anything at all!

  4. PfGD: Part 2 • Has everyone completed it? • Send me your link • Send me your PHP file • Final due in 1 week. More time?

  5. Growth Mindset Reminder • With a growth mindset, we can improve our skills through practicing. • Learning happens over time, not instantly. • The process of learning is uncomfortable when we’re not competent yet.

  6. Programming • Code is executed in order • Typo-intolerant • += and ++ • // • if () • for () and while() • arrays

  7. Programming • .htaccess • $_GET and $_POST • array_key_exists() • if() ... else

  8. .htaccess • A very useful file for seeing errors!

  9. Tutorials on Forms • HTML Forms http://www.w3schools.com/html/html_forms.asp • PHP Forms http://www.w3schools.com/php/php_forms.asp

  10. HTML Forms <form method=GET> First name: <input type="text" name="firstname"><br> Last name: <input type="text" name="lastname"><br> <input type="submit"> </form>

  11. Arrays $weatherArray // result is 58 echo $weatherArray[0]; 58 60 70 68 62 0 1 2 3 4

  12. Arrays $weatherArray // result is 58 echo $weatherArray[‘day1’]; 58 60 70 68 62 ‘day1’ ‘day2’ ‘day4’ ‘day5’ ‘day3’

  13. Arrays $weatherArray 58 60 70 68 62 ‘day1’ ‘day2’ ‘day4’ ‘day5’ ‘day3’ value key

  14. HTML Forms <form method=GET> First name: <input type="text" name="firstname"><br> Last name: <input type="text" name="lastname"><br> <input type="submit"> </form>

  15. PHP Forms // Special array variable called $_GET $_GET[‘firstname’]; $_GET[‘lastname’];

  16. PHP Forms • http://irafay.com/classes/CS144/PHP/basicform.php • Example!

  17. array_key_exists() // What if the form hasn’t been submitted?

  18. array_key_exists() // This takes a string and an array, and // returns true or false: array_key_exists(‘firstname’, $_GET); // This takes two numbers, and // returns a number: rand(1, 6);

  19. array_key_exists() // Only echo the name if the form has // been submitted if (array_key_exists(‘firstname’, $_GET)) { echo "Your name is "; echo $_GET[‘firstname’]; }

  20. if() ... else // Score starts at 0 $totalScore = 0; // Roll 1d6 $myRoll = rand(1, 6); // Add to the score if roll was >4 if ($myRoll > 4) { $totalScore += $myRoll; }

  21. if() ... else // Add to the score if roll was >4 if ($myRoll > 4) { $totalScore += $myRoll; }

  22. if() ... else // Add to the score if roll was >4 if ($myRoll > 4) { $totalScore += $myRoll; } // Otherwise, subtract from the score else { $totalScore -= $myRoll; }

  23. if() ... else // Only echo the name if the form has // been submitted if (array_key_exists(‘firstname’, $_GET)) { echo "Your name is "; echo $_GET[‘firstname’]; }

  24. if() ... else // Only echo the name if the form has // been submitted if (array_key_exists(‘firstname’, $_GET)) { echo "Your name is "; echo $_GET[‘firstname’]; } // otherwise, give form instructions else { echo "Please complete the form!"; }

  25. Lab Time • For the rest of this unit, we’ll have ample lab time in class. Bring your computer! • Lisette: Kai S, Ben, Truman, Dakari  • Meghan: Kai M, Grace, Zack • Gabriella: Helena, Ethan, Joel • George: Quinn, Bryan, Max

  26. Outside of Class Activities Read the syllabus to know what to do! • Programming for Game Designers Final due Weds • Get to Know Hampshire project ongoing Game Guru: Pick a game to show next class, submit written analysis before class

More Related