Professor Ira Fay Class 4. Mining Part 3 Programming Concepts Josie Nutter Unity Demo.
-
Upload
agatha-henderson -
Category
Documents
-
view
221 -
download
2
Transcript of Professor Ira Fay Class 4. Mining Part 3 Programming Concepts Josie Nutter Unity Demo.
![Page 1: Professor Ira Fay Class 4. Mining Part 3 Programming Concepts Josie Nutter Unity Demo.](https://reader036.fdocuments.net/reader036/viewer/2022062515/56649f495503460f94c6a82d/html5/thumbnails/1.jpg)
Women inGame Programming
Professor Ira FayClass 4
![Page 2: Professor Ira Fay Class 4. Mining Part 3 Programming Concepts Josie Nutter Unity Demo.](https://reader036.fdocuments.net/reader036/viewer/2022062515/56649f495503460f94c6a82d/html5/thumbnails/2.jpg)
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.](https://reader036.fdocuments.net/reader036/viewer/2022062515/56649f495503460f94c6a82d/html5/thumbnails/3.jpg)
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.](https://reader036.fdocuments.net/reader036/viewer/2022062515/56649f495503460f94c6a82d/html5/thumbnails/4.jpg)
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.](https://reader036.fdocuments.net/reader036/viewer/2022062515/56649f495503460f94c6a82d/html5/thumbnails/5.jpg)
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.](https://reader036.fdocuments.net/reader036/viewer/2022062515/56649f495503460f94c6a82d/html5/thumbnails/6.jpg)
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.](https://reader036.fdocuments.net/reader036/viewer/2022062515/56649f495503460f94c6a82d/html5/thumbnails/7.jpg)
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.](https://reader036.fdocuments.net/reader036/viewer/2022062515/56649f495503460f94c6a82d/html5/thumbnails/8.jpg)
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.](https://reader036.fdocuments.net/reader036/viewer/2022062515/56649f495503460f94c6a82d/html5/thumbnails/9.jpg)
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.](https://reader036.fdocuments.net/reader036/viewer/2022062515/56649f495503460f94c6a82d/html5/thumbnails/10.jpg)
Three Useful commands
+=
//
if ()
![Page 11: Professor Ira Fay Class 4. Mining Part 3 Programming Concepts Josie Nutter Unity Demo.](https://reader036.fdocuments.net/reader036/viewer/2022062515/56649f495503460f94c6a82d/html5/thumbnails/11.jpg)
More Useful commands
++
enum
![Page 12: Professor Ira Fay Class 4. Mining Part 3 Programming Concepts Josie Nutter Unity Demo.](https://reader036.fdocuments.net/reader036/viewer/2022062515/56649f495503460f94c6a82d/html5/thumbnails/12.jpg)
++
// 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.](https://reader036.fdocuments.net/reader036/viewer/2022062515/56649f495503460f94c6a82d/html5/thumbnails/13.jpg)
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.](https://reader036.fdocuments.net/reader036/viewer/2022062515/56649f495503460f94c6a82d/html5/thumbnails/14.jpg)
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.](https://reader036.fdocuments.net/reader036/viewer/2022062515/56649f495503460f94c6a82d/html5/thumbnails/15.jpg)
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.](https://reader036.fdocuments.net/reader036/viewer/2022062515/56649f495503460f94c6a82d/html5/thumbnails/16.jpg)
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.](https://reader036.fdocuments.net/reader036/viewer/2022062515/56649f495503460f94c6a82d/html5/thumbnails/17.jpg)
Josie Nutter
Now!
Come prepared with 1 question
![Page 18: Professor Ira Fay Class 4. Mining Part 3 Programming Concepts Josie Nutter Unity Demo.](https://reader036.fdocuments.net/reader036/viewer/2022062515/56649f495503460f94c6a82d/html5/thumbnails/18.jpg)
Katie Correll
Monday!
Come prepared with 1 question
![Page 19: Professor Ira Fay Class 4. Mining Part 3 Programming Concepts Josie Nutter Unity Demo.](https://reader036.fdocuments.net/reader036/viewer/2022062515/56649f495503460f94c6a82d/html5/thumbnails/19.jpg)
Unity Demo
![Page 20: Professor Ira Fay Class 4. Mining Part 3 Programming Concepts Josie Nutter Unity Demo.](https://reader036.fdocuments.net/reader036/viewer/2022062515/56649f495503460f94c6a82d/html5/thumbnails/20.jpg)
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.](https://reader036.fdocuments.net/reader036/viewer/2022062515/56649f495503460f94c6a82d/html5/thumbnails/21.jpg)
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.](https://reader036.fdocuments.net/reader036/viewer/2022062515/56649f495503460f94c6a82d/html5/thumbnails/22.jpg)
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.](https://reader036.fdocuments.net/reader036/viewer/2022062515/56649f495503460f94c6a82d/html5/thumbnails/23.jpg)
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.](https://reader036.fdocuments.net/reader036/viewer/2022062515/56649f495503460f94c6a82d/html5/thumbnails/24.jpg)
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.](https://reader036.fdocuments.net/reader036/viewer/2022062515/56649f495503460f94c6a82d/html5/thumbnails/25.jpg)
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.](https://reader036.fdocuments.net/reader036/viewer/2022062515/56649f495503460f94c6a82d/html5/thumbnails/26.jpg)
Crafting Life
Isaiah + team made a game over the summer!
http://stout.hampshire.edu/~ibm13/CraftingLife