From Prototype to Final

Turning the dial up from cubes to freakin’ spaceships

From bleak black void, to a starry galaxy, after testing and confirming that the prototype is exactly how you want it to be, its time to change clothing from casual to suits and tie.

One of the easiest way to spice up your game is to add an background. Simply import an jpeg file, and drag and drop the object into the hierarchy.

Adding a background to the game

As you might have known while adding the background, the images that we are importing are categorized as “Sprite Renderer” and not “Mesh Renderer”. What we need to do now is to convert the Mesh renderer 3D object into a 2D sprite renderer.

For the player, it is actually easier to rebuilt the player game object because the most important component within the object is the “player” script. We can delete the cube player, then drag into the hierarchy the image you want the player to be, followed by re-adding the player script.

For the enemies, we have to enter the prefab view. In here we can delete every component except the transform and enemy script. Then re-add the same components but the 2D variants. (ie. Box collider 2D, Rigidbody 2D, sprite renderer)

To finalized everything and get everything back and running, we need fix a few glitches within the code. In the enemy script, we are using “On trigger enter” this is for a 3D attribute, and since we are using 2D, all we have to do is add “2D” at the end. (ie. OnTriggerEnter2D) After that, everything is back to where it should be.