Game Toolkit for Unity
A quick overview over the project and setting up the basics of the space shooter game.
This game tutorial series will teach you how to create a simple top down arcade style shooter. The player will control a space ship, firing bolts to destroy enemies. The enemies are asteroids and enemy ships, also firing bolts. The level will endlessly spawn new waves of enemies randomly.
In this tutorial we’ll set up the Unity project, take a quick look at the project and set up some basics in the Makinom editor.
By now you should’ve downloaded the project resources, a unitypackage file containing the assets we’ll use in this tutorial series.
Use the Unity Hub to create a new Unity project, make sure to use at least Unity 2019.1, best one of the LTS versions (e.g. Unity 2019.4 LTS).
The new project comes with an empty sample scene set up, we don’t really need it, so you can delete it (and the folder Assets/Scenes/) if you want.
We’ll use the Unity UI module, make sure the project contains the TextMesh Pro and Unity UI packages. They should automatically be included in a new Unity project, if not, use the package manager (Window > Package Manager) to import them.
We need to set up a layer in the Unity project we’ll use later. Open Unity’s layer settings using the Unity menu: Edit > Project Settings… > Tags and Layers
Change the following layer:
Next, we’ll import the project resources you’ve downloaded and the latest Makinom 2 version (or any you’ve got lying around).
The order in which you import them doesn’t matter. If you get a warning regarding script updates, confirm it to continue with the import.
The tutorial resources can be found in this folder: Assets/Tutorial Resources/
All our setup will be done in the Level 1 scene (found at Assets/Tutorial Resources/Scenes/), so you can already open it.
We’ll now set up some basics in the Makinom project. Open the Makinom editor (Window > Makinom) – this will create a new Makinom project at Assets/Gaming Is Love/_Data/Project.asset, in case no project has been created or opened yet.
First, we’ll set up the input keys to control the game. Navigate to Base/Control > Input Keys.
Select the Horizontal input key and do the following changes.
The input settings are defined in the already added Input ID Setting 0.
We’re using the Unity Input Manager key instead of a key code to get smoother axis changes – which allows better player controls. Key code is only able to get us an axis of -1, 0 or 1.
Also, since we’re using the input manager, we don’t need to use In Fixed Update, even though we’ll use the key for physics based movement in a fixed update (tick) machine. This might seem a bit counterintuitive, but otherwise Makinom’s own fixed update handling of inputs would conflict with the input manager already doing this, leading to jerky movement.
Select the Vertical input key and do the following changes.
Add a new input key – we’ll use it for firing the player’s weapon. Do the following changes.
That’s it for the input keys.
We’ll use pooling to reduce the amount of game objects created and destroyed during the game – you can learn more about pooling in this documentation.
The prefabs we’ll be using are already set up and are only missing the machines to add the game mechanics, so we can already use them for the game object pools.
Navigate to Base/Control > Game Object Pools and change the following settings.
The first pool is for the player’s weapon firing bolts.
Add a new pool for an asteroid.
Add a new pool for the enemy ship.
Add a new pool for the enemy ship’s weapon firing bolt.
That’s it for the game object pools.
Navigate to Game > Game Settings and change the following settings.
Click on Add Variable to add a new variable. The variable will be initialized to a defined value when the game is started.
This variable will hold the player’s lives – when the player is destroyed, the variable is reduced by 1 and either respawn the player or cause game over. You can learn more in the variables documentation.
That’s it for the game settings.
Navigate to Game > Music and change the following settings of the Default Music.
That’s it for the music.
We’ll use the Unity UI module – it’s best to select the UI system as one of the first things when starting a new project.
Navigate to UI > UI System and change the following setting.
Changing the UI system will show confirmation dialogue, which we’ll accept via the Ok button.
And that’s it – click on Save Settings (and on Confirm in the following screen) to save the changes.
Finally, we’ll add Makinom and the background music to the scene. Open the Level 1 scene (found at Assets/Tutorial Resources/Scenes/).
To add Makinom to the game, we’ll need a game starter. You can learn more in the game starters documentation.
Add the game starter using the scene wizard (Window > Makinom Scene Wizard). Click on Add Game Starter, select the Makinom project if it’s not already selected (found at Assets/Gaming Is Love/_Data/Project.asset) and click on Add Game Starter again. The scene wizard will create a new game object and attach the game starter to it.
Move the new game starter object out of the way, e.g. to X=-10, Y=0, Z=0.
Again, we’ll use the scene wizard to add the background music: Create Object > Music Player
Move the new music player object out of the way (e.g. X=-12, Y=0, Z=0) and change the following settings in the inspector of the Music Player component.
And that’s it for now – save the scene.
Again, we’ll use the scene wizard to add the game object pools we set up: Create Object > Pool
Move the new pool object out of the way (e.g. X=-14, Y=0, Z=0) and change the following settings in the inspector of the Pool component.
Copy the component and Paste Component As New 5 times and select the rest of the pools in the new components: Asteroid 1, Asteroid 2, Asteroid 3, Enemy Ship, Enemy Bolt
The next tutorial will handle the player move controls.