In this chapter, we used everything we learned in the earlier chapters with respect to creating a simple game.
We created an enemy spawning system, which instantiates enemies on the scene. Rigidbodies and colliders have been added to handle collisions between enemies in the barriers at the bottom of the screen.
We also added a health bar widget that is linked to health points; if four enemies touch the end of the screen, the game restarts.
The Update()
method was used to handle player input and compare the typed word with destruct codes in order to destroy enemies if needed.
For now, the game is quite simple. Some ideas to enhance the game are as follows:
If you add some of the previous features, our game will become more interesting.
In order to improve your knowledge of NGUI, you can refer to more tutorials at http://www.tasharen.com/forum/index.php?topic=6754.
The complete NGUI scripting documentation is available at http://www.tasharen.com/ngui/docs/index.html.
That's it! We have now finished working with Unity and NGUI using this book. Thank you for your attention and I wish you all the best for your future projects.
3.143.22.23