- Unity Certified Programmer:Exam Guide
- Philip Walker
- 317字
- 2021-06-18 18:30:10
Managing Scripts and Taking a Mock Test
In this chapter, we are going to continue structuring our game by applying a Singleton design pattern to our GameManager script. This will allow our game to move on to another scene while keeping the script managers functioning and preventing them from being wiped (thereby preserving our data). We will then make a start with other details of our script and observe how information (such as the player's lives) travels through the game's frameworks. If and when the player dies, a life is deducted. If and when the player loses all of their lives, the game over scene will be triggered.
We will be extending our original code and introducing enemy points so that when we hit our enemies with bullets, the enemy will disappear as usual but will also generate points. This scoring mechanism will be handled by a new score manager that we will be creating.
We'll also be adding sound to the player's bullets, which is a simple, straightforward task. This will introduce us to extending and tweaking our audio sources, which we'll proceed with in a later chapter.
Finally, we will be quizzing ourselves with a couple of questions that suit the theme of this book, preparing you for the exam. The questions will cover what we have already learned, and if you have been following along with this book, you'll have a strong chance of passing.
By the end of this chapter, we will have extended our game's framework, added more features to our game, and tested our knowledge with some Unity exam questions.
In this chapter, we will be covering the following topics:
- Adding a Singleton design pattern
- Setting up our ScenesManager script
- Creating lives for the player
- Scoring enemy hits
- Creating sounds for the player's bullets
- Mock test
The next section will introduce the core exam skills that are covered in this chapter.
- JavaScript前端開發(fā)模塊化教程
- 復(fù)雜軟件設(shè)計之道:領(lǐng)域驅(qū)動設(shè)計全面解析與實戰(zhàn)
- Java范例大全
- Android和PHP開發(fā)最佳實踐(第2版)
- Access 2016數(shù)據(jù)庫管
- 小學(xué)生C++創(chuàng)意編程(視頻教學(xué)版)
- Unity 2D Game Development Cookbook
- 常用工具軟件立體化教程(微課版)
- 區(qū)塊鏈技術(shù)與應(yīng)用
- C++ Fundamentals
- Illustrator CS6設(shè)計與應(yīng)用任務(wù)教程
- 深度實踐KVM:核心技術(shù)、管理運維、性能優(yōu)化與項目實施
- JavaScript編程精解(原書第2版)
- JavaScript Concurrency
- PHP動態(tài)網(wǎng)站開發(fā)實踐教程