Galaga Essentials / Getting Started
Galaga Essentials can be found in the Assets/Playniax/Galaga Essentials
The demo scene can be found there also and can be used as a template or a new scene can be created and the Unity menu can be used to add the necessary GameObjects.
To setup a Galaga game you can do the following:
1. Create a new 2d scene.
2. Add a player sprite to the scene.
3. Add a galaga formation grid to the scene.
4. Add a Galaga sequencer and sequences to the scene (a sequence creates attack waves).
1. Create a new 2d scene
We assume you know how to create a new scene in Unity.
2. Add a player sprite to the scene
To add a player sprite to the scene use the Unity menu and select: GameObject > Playniax > Galaga Essentials > Sprites > Players > Player (Galaga Style)
3. Add a galaga formation grid to the scene
To add a galaga formation grid to the scene use the Unity menu and select: GameObject > Playniax > Galaga Essentials > Misc > Galala Grid
4. Add a Galaga sequencer and sequences to the scene
To add Galaga sequencer and sequences to the scene use the Unity menu and select: GameObject > Playniax > Galaga Essentials > Sequencer > Sequence
This will create a sequence.
Sequences depend on atleast one Sequencer being present in the scene.
A Sequencer will be created automatically the first time a Sequence is created.
Only one Sequencer can be present in the scene but you can create as much Sequences as you need.
A sequence must be a child object of a Sequencer.
The hierarchy should look something like this:
GameObject is created automatically the first time a Galaga GameObject is added to the scene.
The Engine is responsible for the sound effects, collisions, messages on screen and particle effects and more.
The scene should look something like this:
The Galaga Sequencer explained
The Galaga Sequencer executes the sequences in the order they appear.
Select the Wave x child GameObject in the Galaga Sequencer:
The inspector should show the sequence settings:
We will discuss a few settings from the inspector (previous image).
setting is the actual sprite to be spawned.
Galaga comes with 3 enemy prefabs that can be found at Assets/Playniax/Galaga Essentials/Prefabs/Enemies
settings determine where the sprites enter and leave the screen.
The Spawning Mode
setting determines if a single wave or double wave.
setting determines number of sprites are in a wave.
setting determines how much distance there is between each sprite in a wave.
The cargo settings can be used to leave for example a pickup after the sprite of an attack wave is destroyed:
The available pickups can be found at Assets/Playniax/Galaga Essentials/Prefabs/Players (Pickups)
The Bullets Settings determine if the sprite fire bullets or not:
Available bullet prefabs can be found at Assets/Playniax/Framework/Prototyping/Prefabs/Enemies (Bullets)
Have a look at GalagaSequence
for a more in depth explanation.
To add a wave simply duplicate one and change the settings at will or insert one using the Unity menu: GameObject > Playniax > Galaga Essentials > Sequencer > Sequence
By default the waves follow eachother without a break in the order they appear and they must be a child object of the Sequencer GameObject.
It's possible to add messages before or after each wave.
To add a message to the sequencer simple use the Unity menu and select: GameObject > Playniax > Galaga Essentials > Sequencer > Message
A message must also be a child object of a Sequencer.
By default a message will display the text 'Get Ready For Wave' where %WAVE% fetches the correct wave number.
You can determine how long the text is displayed by setting the sustain and fade time.
After the text was displayed the Galaga Sequencer moves on to the next sequence or other type of sequencer object.
Wave 1 uses a script called GalagaSequence.cs and this script is an object spawner.
Adding a break
It's not a game with one sequence or wave.
We can add as much waves as needed.
Once a wave is spawned the Sequencer continues with the next Sequence.
It's also possible to have it wait until the previous Sequence is destroyed.
But first we will rename 'Wave x' to 'Wave 1' for easy reference.
To have it wait between each wave you can add the 'Wait For Sequence To Be Finished' GameObject by using the Unity Menu and select: GameObject > Playniax > Galaga Essentials > Sequencer > Wait For Sequence To Be Finished
The 'Wait For Sequence To Be Finished' GameObject must also be a child object of a Sequencer.
By adding this the Galaga Sequencer waits until the current wave is completly destroyed.
This will first show a message, then Wave 1 will start but the sequence will wait for Wave 1 to be destroyed.
After Wave 1 is destroyed a new message will be shown followed by Wave 2
You can repeat this as manny times as needed and make a cool game.
Just make sure all these GameObjects are a child object of the Sequencer.
Keeping the sequencer organized
Here is a another example on creating a string of sequences but more organized by using multiple parent/children objects:
Have a look at Assets/Playniax/Galaga/Demo 2
Galaga Essentials is using the Playniax frameworks Ignition
and the Pyro