Professor Ira Fay Class 10. Game Guru Programming for Game Designers.

26
Programming for Game Designers Professor Ira Fay Class 10

Transcript of Professor Ira Fay Class 10. Game Guru Programming for Game Designers.

Page 1: Professor Ira Fay Class 10. Game Guru Programming for Game Designers.

Programming forGame Designers

Professor Ira FayClass 10

Page 2: Professor Ira Fay Class 10. Game Guru Programming for Game Designers.

Overview

• Game Guru• Programming for Game Designers

Page 3: Professor Ira Fay Class 10. Game Guru Programming for Game Designers.

Game Guru

Observe Rules of the game Scoring Characters Animations Audio User interface Anything at all!

Page 4: Professor Ira Fay Class 10. Game Guru Programming for Game Designers.

Updates

Get to Know Hampshire revised

Useful links section updated

Page 5: Professor Ira Fay Class 10. Game Guru Programming for Game Designers.

Get to Know Hampshire

Install Dropbox (or something similar)

Find an interesting professor Check out a boardgame from the

library Find a CEL-1 activity

Page 6: Professor Ira Fay Class 10. Game Guru Programming for Game Designers.

PfGD: Part 1

Has everyone completed it? Website Roll 1d6 Pick one of the game options

Page 7: Professor Ira Fay Class 10. Game Guru Programming for Game Designers.

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.

Page 8: Professor Ira Fay Class 10. Game Guru Programming for Game Designers.

Programming

Lines of code are executed in order

= is an assignment operator

Programming is typo-intolerant You have to say the magic words exactly

rightfor the spell to work!

Page 9: Professor Ira Fay Class 10. Game Guru Programming for Game Designers.

Variables

Variables hold information

Variables can change value while the program is executing

Example $myRoll

Page 10: Professor Ira Fay Class 10. Game Guru Programming for Game Designers.

Methods

Methods are like a factory: They take input, and spit out results

Example rand(1, 6);

Page 11: Professor Ira Fay Class 10. Game Guru Programming for Game Designers.

Four Useful PHP commands

+=

//

if ()

for () or while()

Page 12: Professor Ira Fay Class 10. Game Guru Programming for Game Designers.

More PHP

++

arrays

Page 13: Professor Ira Fay Class 10. Game Guru Programming for Game Designers.

++

// add 1 to i$i = $i + 1;

// add 1 to i$i += 1;

// add 1 to i$i++;

Page 14: Professor Ira Fay Class 10. Game Guru Programming for Game Designers.

Arrays

// Roll 1d6$myRoll = rand(1, 6);

Page 15: Professor Ira Fay Class 10. Game Guru Programming for Game Designers.

Arrays

// What if I want to roll 1d6 100 times?

Page 16: Professor Ira Fay Class 10. Game Guru Programming for Game Designers.

Arrays

// Roll 1d6 100 times$i = 0;while ($i < 100) { $myRoll = rand(1, 6); $i++;}

Page 17: Professor Ira Fay Class 10. Game Guru Programming for Game Designers.

Arrays

// What if I want to roll 1d6 100 times// and remember each roll?

Page 18: Professor Ira Fay Class 10. Game Guru Programming for Game Designers.

Arrays

// An array$weatherArray = array();

Page 19: Professor Ira Fay Class 10. Game Guru Programming for Game Designers.

Arrays

// An array$weatherArray = array();

// The weather for 5 days$sampleArray[0] = 70;$sampleArray[1] = 62;$sampleArray[2] = 50;$sampleArray[3] = 50;$sampleArray[4] = 68;

Page 20: Professor Ira Fay Class 10. Game Guru Programming for Game Designers.

Arrays

// The weather for 5 days$weatherArray = array(70, 62, 50, 50, 68);

Page 21: Professor Ira Fay Class 10. Game Guru Programming for Game Designers.

Arrays

// The weather for 5 days$weatherArray = array(70, 62, 50, 50, 68);

// Weather on the first dayecho $weatherArray[0];

// Weather on the second dayecho $weatherArray[1];

Page 22: Professor Ira Fay Class 10. Game Guru Programming for Game Designers.

Arrays

// Roll 1d6$myRoll = rand(1, 6);

// What if I want to roll 100 times// and remember each roll?

Page 23: Professor Ira Fay Class 10. Game Guru Programming for Game Designers.

Arrays

// Roll 1d6$myRoll = rand(1, 6);

// What if I want to roll 100 times// and remember each roll?$i = 0;$allRolls = array();while ($i < 100) { $allRolls[$i] = rand(1, 6);}

Page 24: Professor Ira Fay Class 10. Game Guru Programming for Game Designers.

Arrays

Learn more about arrays in the PHP tutorial

Page 25: Professor Ira Fay Class 10. Game Guru Programming for Game Designers.

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

Page 26: Professor Ira Fay Class 10. Game Guru Programming for Game Designers.

Outside of Class Activities

Read the syllabus to know what to do! Programming for Game Designers Part 2

due Weds Get to Know Hampshire project ongoing

Game Guru: Pick a game to show next class, submit written analysis before class