O'Reilly logo

Getting Started with Unity 5.x 2D Game Development by Francesco Sapio

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Panda invasion – spawning Pandas

In this section, we will implement the spawning system of the game. This can be done in many ways. However, since we have only one kind of Panda (at least for the moment), we will implement it in a simple way. In any case, we will use coroutines to implement the system, and we will see a template structure which we might also use in more complex spawning systems (in the next chapter, some ideas of more complex spawning systems will be provided).

What is a coroutine?

It is a structure that Unity provides to allow functions to be interrupted and continued in other frames of the game. In the case of our spawning system, we don't want to spawn all the Pandas at the same time, but a little bit over time. This over time can ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required