From Prototype to Work of Art

Niraj Karki
2 min readMay 7, 2021

--

Day 15- Making 2D Space Shooter Game

This is the prototype that I created by scripting and designing the core concept of my game.

To use my sprites to the existing gameobjects, I have to delete all of their mesh renderer and colliders and if there is rigidbody as well then that as well.

After that I add sprite renderer and a box collider inside my player. I make sure to check my collider Is Trigger to true. After that I can add the player sprite to my player inside sprite renderer in sprite variable.

You can do the same with enemy and laser as well. Do note that there is a rigidbody in enemy so you need to remove it and replace it with rigidbody2D

After that I drag mybackground directly into the hierarchy and set the sorting layer to background or I can simply let the layer be Default and just change the order in layer to match my need.

Inside of my enemy script, I add 2D behind OnTriggerEnter and Collider to signify that the trigger will activate when colliding with 2D object. If I don’t change this to 2D then my game runs but I won’t be able to interact with enemy since 2D can interact with 2D only and 3D with 3D only.

After all the changes are made,This is how my game looks after adding sprites to my player, enemy and laser along with a background that fits the theme.

--

--

No responses yet