Level 5: SCRIPTING CONTROL FLOW
11/14/19 - Conditionals (IF THEN Statements)
- Reopen L6 Practice scene; then create a new C# script (called Conditionals) in your Scripts folder
- Watch "Conditional IF and ELSE IF" (video shown below)
- Now create a new C# script (called Conditionals2) in your Scripts folder
- Watch "Conditionals" from the beginning until the 10:50 mark in the video (click here)
Assignment:
- After you finish watching the above tutorial, resave your L6Practice scene.
- Reopen your L6Assignment scene
- Create a new C# script (called playerStatus) in your Scripts folder.
- On Start, three public variables will ask for the player's name, the name of the game they are playing, and their high score for the game that day (see Illustration 1 for how it would look in your Inspector Window). Then a conditional statement will be created based on the following:
- High Score is greater than 50000 (print "In the game ____________, ________________ has reached Superior Status for their score of __________.
- High Score is between 20000 and 49999 (print "In the game ____________, ________________ has reached Gold Status for their score of __________.
- High Score is between 10000 and 19999 (print "_____________, you may want to practice the game ________ a little bit more with that score of ________________.
- High Score is less than 9999 (print _______________: You may want to give up on the game _________________ with that score of ________________.
- An example of how one of these scenarios might run is shown in Illustration 2
- Regardless of what statement prints above, there will be a second statement that prints afterwards as follows: "Press the start button ________________ to continue". Make sure all possible scenarios work before calling me over to check it off.