Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "Professor Ira Fay Class 4. Mining Part 3 Programming Concepts Josie Nutter Unity Demo."— Presentation transcript:

1 Professor Ira Fay Class 4

2 Mining Part 3 Programming Concepts Josie Nutter Unity Demo

3  Stand up  Learn the name of someone you don’t know  Sit down

4  How is it going?  Are you using the walkthroughs?  GitHub?

5  Creating a GameObject and attaching a script  Time.time  Update() loop

6  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.

7  Lines of code are executed in order  = is an assignment operator  Programming is typo-intolerant  You have to say the magic words exactly right for the spell to work!

8  Variables hold information  Variables can change value while the program is executing  Example  int myRoll;

9  Methods are like a factory:  They take input, and spit out results  Example  Random.Range(1,7);

10  +=  //  if ()

11  ++  enum

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

13 How do we track where we are in the game? // 0 is Bronze // 1 is Silver // 2 is Done int gameState = 0;

14 How do we track where we are in the game? // 0 is Bronze // 1 is Silver // 2 is Done int gameState = 0; if (gameState == 0) { SpawnBronze(); }

15 How do we track where we are in the game? public enum GameState { Bronze, Silver, Done }

16 How do we track where we are in the game? GameState myState = GameState.Bronze; if (myState == GameState.Bronze) { SpawnBronze(); }

17  Now!  Come prepared with 1 question

18  Monday!  Come prepared with 1 question

19

20 How could I display the numbers 1 to 9?

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

22 How could I display the numbers 1 to 99? 1 to 999?

23 // Count from 1 to 9 for (int i = 1; i < 10; i += 1) { print (i); } // We could also use a while() loop int i = 1; while (i < 10) { print (i); i += 1; }

24 // Count from 1 to 99 for (int i = 1; i < 100; i += 1) { print (i); } // We could also use a while() loop int i = 1; while (i < 100) { print (i); i += 1; }

25 // Count from 1 to 999 for (int i = 1; i < 1000; i += 1) { print (i); } // We could also use a while() loop int i = 1; while (i < 1000) { print (i); i += 1; }

26  Isaiah + team made a game over the summer! http://stout.hampshire.edu/~ibm13/CraftingLife


Download ppt "Professor Ira Fay Class 4. Mining Part 3 Programming Concepts Josie Nutter Unity Demo."

Similar presentations


Ads by Google