What I learnt from this game were:
- How to change the layout of Unity's panels.
- Unity's folder structure.
- Unity's scene and objects.
- How to print logs into Unity's console using print() method.
- Unity's game application flow.
- We can attach a script to an object.
- That script inherited MonoBehaviour
- It has Start() method that will be called once in the beginning
- There is Update() method that will be called once per frame.
- How to get input from keyboard.
While all those points are very obvious and basic, I think it is a good start to get to know them all in the beginning of this journey. So it will be a good foundation for me to go faster later.
About Number Wizard
Number Wizard is a game to guess player's number in mind.Here is the game play of the game:
- Player just need to think about one number between 1-10000.
- The game will guess with a number.
- The player need to answer whether that guess higher, lower, or equal.
- If it is still not equal, the game will guess again until find the number of the player have in mind.
The Game implementation
The player can interact with the game using up arrow (tell the guess is higher), down arrow (tell the guess is lower), or space (tell the guess is equal). The game will end if the player press space key. The complete implementation of player's interaction can be seen in line 29-44.
To find the number, we need to implement binary search by calculating the middle value of min and max bound as you can see in FindMid() method in line 64.
You can see the complete project in this repository of mine:
https://github.com/ibanezang/NumberWizardGames
Please leave comment and suggestion if you find this post interesting. Thank you :)
You can see the complete project in this repository of mine:
https://github.com/ibanezang/NumberWizardGames
Please leave comment and suggestion if you find this post interesting. Thank you :)
No comments:
Post a Comment