professor ira fay class 4. mining part 3 programming concepts josie nutter unity demo

26
Women in Game Programming Professor Ira Fay Class 4

Upload: agatha-henderson

Post on 13-Dec-2015

221 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Professor Ira Fay Class 4. Mining Part 3 Programming Concepts Josie Nutter Unity Demo

Women inGame Programming

Professor Ira FayClass 4

Page 2: Professor Ira Fay Class 4. Mining Part 3 Programming Concepts Josie Nutter Unity Demo

Overview

• Mining Part 3• Programming Concepts• Josie Nutter• Unity Demo

Page 3: Professor Ira Fay Class 4. Mining Part 3 Programming Concepts Josie Nutter Unity Demo

Learn a Name

Stand up Learn the name of someone you

don’t know Sit down

Page 4: Professor Ira Fay Class 4. Mining Part 3 Programming Concepts Josie Nutter Unity Demo

Mining – Part 3

How is it going?

Are you using the walkthroughs?

GitHub?

Page 5: Professor Ira Fay Class 4. Mining Part 3 Programming Concepts Josie Nutter Unity Demo

Mining – Part 2

Creating a GameObject and attaching a script

Time.time

Update() loop

Page 6: Professor Ira Fay Class 4. Mining Part 3 Programming Concepts Josie Nutter Unity Demo

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 7: Professor Ira Fay Class 4. Mining Part 3 Programming Concepts Josie Nutter Unity Demo

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 8: Professor Ira Fay Class 4. Mining Part 3 Programming Concepts Josie Nutter Unity Demo

Variables

Variables hold information

Variables can change value while the program is executing

Example int myRoll;

Page 9: Professor Ira Fay Class 4. Mining Part 3 Programming Concepts Josie Nutter Unity Demo

Methods

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

Example Random.Range(1,7);

Page 10: Professor Ira Fay Class 4. Mining Part 3 Programming Concepts Josie Nutter Unity Demo

Three Useful commands

+=

//

if ()

Page 11: Professor Ira Fay Class 4. Mining Part 3 Programming Concepts Josie Nutter Unity Demo

More Useful commands

++

enum

Page 12: Professor Ira Fay Class 4. Mining Part 3 Programming Concepts Josie Nutter Unity Demo

++

// add 1 to ii = i + 1;

// add 1 to ii += 1;

// add 1 to ii++;

Page 13: Professor Ira Fay Class 4. Mining Part 3 Programming Concepts Josie Nutter Unity Demo

enum

How do we track where we are in the game?

// 0 is Bronze// 1 is Silver// 2 is Doneint gameState = 0;

Page 14: Professor Ira Fay Class 4. Mining Part 3 Programming Concepts Josie Nutter Unity Demo

enum

How do we track where we are in the game?

// 0 is Bronze// 1 is Silver// 2 is Doneint gameState = 0;

if (gameState == 0) { SpawnBronze();}

Page 15: Professor Ira Fay Class 4. Mining Part 3 Programming Concepts Josie Nutter Unity Demo

enum

How do we track where we are in the game?

public enum GameState { Bronze, Silver, Done}

Page 16: Professor Ira Fay Class 4. Mining Part 3 Programming Concepts Josie Nutter Unity Demo

enum

How do we track where we are in the game?

GameState myState = GameState.Bronze;

if (myState == GameState.Bronze) { SpawnBronze();}

Page 17: Professor Ira Fay Class 4. Mining Part 3 Programming Concepts Josie Nutter Unity Demo

Josie Nutter

Now!

Come prepared with 1 question

Page 18: Professor Ira Fay Class 4. Mining Part 3 Programming Concepts Josie Nutter Unity Demo

Katie Correll

Monday!

Come prepared with 1 question

Page 19: Professor Ira Fay Class 4. Mining Part 3 Programming Concepts Josie Nutter Unity Demo

Unity Demo

Page 20: Professor Ira Fay Class 4. Mining Part 3 Programming Concepts Josie Nutter Unity Demo

Useful commands: for()

How could I display the numbers 1 to 9?

Page 21: Professor Ira Fay Class 4. Mining Part 3 Programming Concepts Josie Nutter Unity Demo

Useful commands: for()

How could I display the numbers 1 to 9?

print (“1”);print (“2”);print (“3”);print (“4”);print (“5”);print (“6”);print (“7”);print (“8”);print (“9”);

Page 22: Professor Ira Fay Class 4. Mining Part 3 Programming Concepts Josie Nutter Unity Demo

Useful commands: for()

How could I display the numbers 1 to 99?

1 to 999?

Page 23: Professor Ira Fay Class 4. Mining Part 3 Programming Concepts Josie Nutter Unity Demo

Useful commands: for()

// Count from 1 to 9for (int i = 1; i < 10; i += 1) { print (i);}

// We could also use a while() loopint i = 1;while (i < 10) { print (i); i += 1;}

Page 24: Professor Ira Fay Class 4. Mining Part 3 Programming Concepts Josie Nutter Unity Demo

Useful commands: for()

// Count from 1 to 99for (int i = 1; i < 100; i += 1) { print (i);}

// We could also use a while() loopint i = 1;while (i < 100) { print (i); i += 1;}

Page 25: Professor Ira Fay Class 4. Mining Part 3 Programming Concepts Josie Nutter Unity Demo

Useful commands: for()

// Count from 1 to 999for (int i = 1; i < 1000; i += 1) { print (i);}

// We could also use a while() loopint i = 1;while (i < 1000) { print (i); i += 1;}

Page 26: Professor Ira Fay Class 4. Mining Part 3 Programming Concepts Josie Nutter Unity Demo

Crafting Life

Isaiah + team made a game over the summer!

http://stout.hampshire.edu/~ibm13/CraftingLife