├── .gitignore ├── Assets ├── Main.unity ├── Main.unity.meta ├── Scripts.meta └── Scripts │ ├── NumberWizards.cs │ └── NumberWizards.cs.meta ├── LICENSE ├── ProjectSettings ├── AudioManager.asset ├── DynamicsManager.asset ├── EditorBuildSettings.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── NavMeshAreas.asset ├── NavMeshLayers.asset ├── NetworkManager.asset ├── Physics2DSettings.asset ├── ProjectSettings.asset ├── QualitySettings.asset ├── TagManager.asset └── TimeManager.asset └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | *.sln 2 | *.userprefs 3 | *.csproj 4 | *.pidb 5 | *.unityproj 6 | .DS_Store 7 | /Library/ 8 | /obj 9 | /Temp 10 | /Builds 11 | Assembly-Boo.booproj 12 | Assembly-Boo-vs.booproj 13 | -------------------------------------------------------------------------------- /Assets/Main.unity: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CompleteUnityDeveloper/Number-Wizard-Console-Original/5830aeace12e6ff85c3e6d95b9ea5effe90f0bb4/Assets/Main.unity -------------------------------------------------------------------------------- /Assets/Main.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 171edca3415404c3d9d67ed82d9bf6d2 3 | DefaultImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9e27ad9b67c6941239d0678cf0355f7f 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Scripts/NumberWizards.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class NumberWizards : MonoBehaviour { 5 | // Use this for initialization 6 | int max; 7 | int min; 8 | int guess; 9 | 10 | void Start () { 11 | StartGame(); 12 | } 13 | 14 | void StartGame () { 15 | max = 1000; 16 | min = 1; 17 | guess = 500; 18 | 19 | print ("========================"); 20 | print ("Welcome to Number Wizard"); 21 | print ("Pick a number in your head, but don't tell me!"); 22 | 23 | print ("The highest number you can pick is " + max); 24 | print ("The lowest number you can pick is " + min); 25 | 26 | print ("Is the number higher or lower than " + guess + "?"); 27 | print ("Up = higher, down = lower, return = equal"); 28 | 29 | max = max + 1; 30 | } 31 | 32 | // Update is called once per frame 33 | void Update () { 34 | if (Input.GetKeyDown(KeyCode.UpArrow)) { 35 | min = guess; 36 | NextGuess(); 37 | } else if (Input.GetKeyDown(KeyCode.DownArrow)) { 38 | max = guess; 39 | NextGuess(); 40 | } else if (Input.GetKeyDown(KeyCode.Return)) { 41 | print("I won!"); 42 | StartGame(); 43 | } 44 | } 45 | 46 | void NextGuess () { 47 | guess = (max + min) / 2; 48 | print ("Higher or lower than " + guess); 49 | print ("Up = higher, down = lower, return = equal"); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Assets/Scripts/NumberWizards.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7aaf5cca02a5e49db9a7cf08b45b596b 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 EmbraceIT Ltd 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CompleteUnityDeveloper/Number-Wizard-Console-Original/5830aeace12e6ff85c3e6d95b9ea5effe90f0bb4/ProjectSettings/AudioManager.asset -------------------------------------------------------------------------------- /ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CompleteUnityDeveloper/Number-Wizard-Console-Original/5830aeace12e6ff85c3e6d95b9ea5effe90f0bb4/ProjectSettings/DynamicsManager.asset -------------------------------------------------------------------------------- /ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CompleteUnityDeveloper/Number-Wizard-Console-Original/5830aeace12e6ff85c3e6d95b9ea5effe90f0bb4/ProjectSettings/EditorBuildSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CompleteUnityDeveloper/Number-Wizard-Console-Original/5830aeace12e6ff85c3e6d95b9ea5effe90f0bb4/ProjectSettings/EditorSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CompleteUnityDeveloper/Number-Wizard-Console-Original/5830aeace12e6ff85c3e6d95b9ea5effe90f0bb4/ProjectSettings/GraphicsSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/InputManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CompleteUnityDeveloper/Number-Wizard-Console-Original/5830aeace12e6ff85c3e6d95b9ea5effe90f0bb4/ProjectSettings/InputManager.asset -------------------------------------------------------------------------------- /ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CompleteUnityDeveloper/Number-Wizard-Console-Original/5830aeace12e6ff85c3e6d95b9ea5effe90f0bb4/ProjectSettings/NavMeshAreas.asset -------------------------------------------------------------------------------- /ProjectSettings/NavMeshLayers.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CompleteUnityDeveloper/Number-Wizard-Console-Original/5830aeace12e6ff85c3e6d95b9ea5effe90f0bb4/ProjectSettings/NavMeshLayers.asset -------------------------------------------------------------------------------- /ProjectSettings/NetworkManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CompleteUnityDeveloper/Number-Wizard-Console-Original/5830aeace12e6ff85c3e6d95b9ea5effe90f0bb4/ProjectSettings/NetworkManager.asset -------------------------------------------------------------------------------- /ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CompleteUnityDeveloper/Number-Wizard-Console-Original/5830aeace12e6ff85c3e6d95b9ea5effe90f0bb4/ProjectSettings/Physics2DSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/ProjectSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CompleteUnityDeveloper/Number-Wizard-Console-Original/5830aeace12e6ff85c3e6d95b9ea5effe90f0bb4/ProjectSettings/ProjectSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CompleteUnityDeveloper/Number-Wizard-Console-Original/5830aeace12e6ff85c3e6d95b9ea5effe90f0bb4/ProjectSettings/QualitySettings.asset -------------------------------------------------------------------------------- /ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CompleteUnityDeveloper/Number-Wizard-Console-Original/5830aeace12e6ff85c3e6d95b9ea5effe90f0bb4/ProjectSettings/TagManager.asset -------------------------------------------------------------------------------- /ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CompleteUnityDeveloper/Number-Wizard-Console-Original/5830aeace12e6ff85c3e6d95b9ea5effe90f0bb4/ProjectSettings/TimeManager.asset -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Complete Unity Developer - Section 2 - Number Wizard 2 | 3 | This is the [Complete Unity Developer](http://gdev.tv/cudgithub) - one of the most successful e-learning courses on the internet! Completely re-worked from scratch with brand-new projects and our latest teaching techniques. You will benefit from the fact we have already taught over 360,336 students game development, many shipping commercial games as a result. 4 | 5 | You're welcome to download, fork or do whatever else legal with all the files! The real value is in our huge, high-quality online tutorials that accompany this repo. You can check out the course here: [Complete Unity Developer](http://gdev.tv/cudgithub) 6 | 7 | ## In This Section 8 | ### Introduction To Number Wizard ### 9 | 10 | An Introduction to your first Unity Game! Let's get comfortable with coding in 11 | Unity. After this section, you'll be able to create and edit your own scripts 12 | and print out information on the console. 13 | 14 | ### Section 2 Notes ### 15 | 16 | Section notes as a Google Doc, you can download latest version as a PDF from 17 | the link if you wish. 18 | 19 | 20 | ### Printing Text To The Console ### 21 | 22 | After watching this video, you will know: 23 | + How to create a script in Unity 24 | + How to handle text in your script using strings 25 | + How to print out messages to the console 26 | 27 | ### Using Variables ### 28 | 29 | After watching this video you will be able to: 30 | + Create variables in your script 31 | + Perform basic maths in your programs 32 | + Understand what the type of a variable is and why this is important 33 | 34 | ### Responding To Key Presses ### 35 | 36 | After watching this video you will be able to... 37 | + Respond to a player's key presses. 38 | + Explain what the `Start()` and `Update()` methods do. 39 | + Navigate Google and Unity docs with more confidence. 40 | 41 | ### Using IF To Make Choices ### 42 | 43 | After this video you will be able to: 44 | + Make your programs behave differently depending on conditions using `if` 45 | statements 46 | 47 | ### Scope And Context Of Variables ### 48 | 49 | After watching this video you will be able to... 50 | + Give a basic explanation of "scope". 51 | + Use variables in appropriate scope. 52 | + Use "instance" variables for global access. 53 | + Use MonoDevelop's autocompletion to help you code faster. 54 | + **Declare** and **Initialise** variables. 55 | 56 | ### Simplifying By Creating Functions ### 57 | 58 | After watching this video you will be able to: 59 | + **Refactor** your code in order to make it neater. 60 | + Create your own custom function. 61 | 62 | ### Completing Number Wizard ### 63 | 64 | In this video we'll clean up our game a little bit and make sure the game 65 | restarts properly every time. After watching this video, you will have learnt 66 | enough to build your own min console game in code :-) 67 | 68 | ### How To Debug Programs ### 69 | 70 | Brice covers the following in his video... 71 | + The Compiler Is Our Friend. 72 | + The Rubber Duck Sensei. 73 | + Assume Nothing / Mars Climate Orbiter. 74 | + The Minimum Viable Test Case. 75 | + Scientific Debugging. 76 | + How to debug small programs. 77 | 78 | ### Section 2 Wrap Up ### 79 | 80 | In this video we will review the Number Wizard Console Game and what we learnt 81 | while building it. We'll also talk about how we could improve it and a few 82 | possible extensions. We'll then take a peek at what's ahead in the next 83 | section. 84 | --------------------------------------------------------------------------------