Landers | Creating a swarm game object.

We are going to make a game object that will not have a sprite or presence in the game on-screen, but instead will be a master controller for spawning invaders with a factory and controlling the invader objects with a script.

  1. In the assets panel, in the 'main' folder, double click, 'main.collection'.
  2. In the outline panel, right click, 'Collection' and select, 'Add Game Object'.
  3. Change the 'Id' property of the game object to be, 'swarm'.
  4. In the outline panel, right click, 'swarm' and select, 'Add Component', 'Factory'.

Add factory

  1. In the properties panel, set the 'Id' property to be, 'alien_factory'.
  2. In the properties panel, set the 'Prototype' property to be, '/main/invader.go'.

Swarm factory properties

  1. Save the changes by pressing CTRL-S or 'File', 'Save All'.

That's the swarm object set up ready to construct invader objects! Now we need to write a script to get the factory working. Stage 3c >