- Unity Certified Programmer:Exam Guide
- Philip Walker
- 262字
- 2021-06-18 18:30:09
Planning and creating our enemy
We have a player that moves, shoots, and takes damage; we can now start looking into creating an enemy that shares these attributes.
To remind ourselves of the genre we are making, our game carries the same traits as classic arcade shooters such as Konami's Gradius, Capcom's UN Squadron, and Irem's R-Type (https://raw.githubusercontent.com/retrophil/Unity-Certified-Programmer-Exam-Guide/master/Reference/shootEmUps.jpg). Typically, with these types of games, the player is swarmed by enemies coming from the right of the screen and exiting to the left.
In this section, we will be repeating similar aspects of the PlayerSpawner and Player scripts. The EnemySpawner script needs to be tweaked so that it will instantiate a given number of enemy ships at a certain rate.
The Enemy game objects will be moving on their own, so there needs to be some extra code applied to their behavior. Before we go into creating our first enemy script, let's look at a part of our game framework and note the layout is basically the same as the player's side of the game framework:

Before we jump into the EnemySpawner script, let's do the same housekeeping we did for our player game objects, namely creating an empty game object and storing all game objects relating to it in that one game object. The reason we did this is to remove the clutter in the Hierarchy window, so let's do the same for our enemies:
- Right-click in the Hierarchy window's open space.
- A drop-down list will appear, select Create Empty.
- Name the game object _Enemies.
Let's move on to our enemy scripts.
- Developing Mobile Web ArcGIS Applications
- Android Application Development Cookbook(Second Edition)
- The React Workshop
- ADI DSP應(yīng)用技術(shù)集錦
- Scala Reactive Programming
- Lift Application Development Cookbook
- C++從入門到精通(第6版)
- Learning Grunt
- Learning Bootstrap 4(Second Edition)
- 深度實踐KVM:核心技術(shù)、管理運維、性能優(yōu)化與項目實施
- Docker:容器與容器云(第2版)
- 快樂編程:青少年思維訓(xùn)練
- Python物理建模初學(xué)者指南(第2版)
- Android 5從入門到精通
- Practical Responsive Typography