professor ira fay class 4. mining part 3 programming concepts josie nutter unity demo
Post on 13-Dec-2015
221 Views
Preview:
TRANSCRIPT
Women inGame Programming
Professor Ira FayClass 4
Overview
• 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
Mining – Part 3
How is it going?
Are you using the walkthroughs?
GitHub?
Mining – Part 2
Creating a GameObject and attaching a script
Time.time
Update() loop
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.
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!
Variables
Variables hold information
Variables can change value while the program is executing
Example int myRoll;
Methods
Methods are like a factory: They take input, and spit out results
Example Random.Range(1,7);
Three Useful commands
+=
//
if ()
More Useful commands
++
enum
++
// add 1 to ii = i + 1;
// add 1 to ii += 1;
// add 1 to ii++;
enum
How do we track where we are in the game?
// 0 is Bronze// 1 is Silver// 2 is Doneint gameState = 0;
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();}
enum
How do we track where we are in the game?
public enum GameState { Bronze, Silver, Done}
enum
How do we track where we are in the game?
GameState myState = GameState.Bronze;
if (myState == GameState.Bronze) { SpawnBronze();}
Josie Nutter
Now!
Come prepared with 1 question
Katie Correll
Monday!
Come prepared with 1 question
Unity Demo
Useful commands: for()
How could I display the numbers 1 to 9?
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”);
Useful commands: for()
How could I display the numbers 1 to 99?
1 to 999?
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;}
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;}
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;}
Crafting Life
Isaiah + team made a game over the summer!
http://stout.hampshire.edu/~ibm13/CraftingLife
top related