← Personal Projects
Unity and C#

Asteroids

A small 2D game written quickly on purpose - and the wrap-around screen that turned out to be the interesting part.

PlatformEngineProject
Windows C#, Unity Individual project
The build

About the Asteroids Project

I really wanted to create a small, easy 2D game, so I thought about what could be the easiest game to quickly hack together. So I started with a cute ship sprite and then created the circles in paint.net.

I did basic movement with horizontal and vertical inputs from the player and allowed the ship to shoot when space was pressed. When the obstacle rings are hit with the ship's projectile they collide into two smaller rings and a little particle effect plays.

I would like to point out that this game has a "wrap around" screen. When the ship flies out to the right side, it enters from the left again. It required some help from Google, but after understanding the principle of "ghost objects" and how to swap these objects with the original, I implemented a wrap around script on my own, where 8 ships are instantiated off screen. These ships then move and rotate the same way the original ship does, which means that the ships outside of the rendered window will fly into view once the original ship flies out of view. And that is the exact point where the change between the ghost ship and the player's ship happens, so that the shooting projectiles will shoot from the correct ship again.

Contact

Want to work together?

marc.kletz@kletzgames.com