Space Cake 

Language: C#

Engine: Unity

Time: 8 Weeks

Work: Wave Spawner &               Enemy Spawner


Project Info

Space Cake an Endless 2D Space Shooter, it has inspirations from the game Space Invaders. The game is made in one level each 5 seconds a wave of enemies' spawn. and the goal is to get as much points as you can get in one life you have. It was our first game we made.

The goal of this project was to understand what is to be like to develop a game. So, we had to make a game that had inspirations of older games like Space Invaders, Metal Slug, Pac Man etc... 

It was challenging this project, but we have learned a lot from it. besides all that it was our real first project made in our first year and that is what i find really impressive


Gameplay Video, Wave & Enemy Spawner

Feature: Wave Spawner

This if statement looks if the enemy is still alive is that true then it will return the spawnstate waiting. if the enemy is defeated then it will go to wavecompleted() and then it will continue to spawnstate.Spawning.

 

if the wave is completed it will go through here where it looks all right wave is completed and it will start the start coroutine with spawning the next wave  

Here it looks for a gameobject with the tag "enemy" so if it does find it, it will let is spawn and a countdown will happen and if it does the countdown will go from 5 seconds to 0. it will do this every time after a wave is completed.

Here i show you the time between waves and the state where it is in.

This is when the Wave is completed it will look, for the next Wave and this works together with Spawnstate counting and waiting. but this Function will only be working after the first steps you've seen from above here.

These are the waves as you can see there are 6 waves and each wave as an enemy count how many enemies in that wave will spawn. From wave 6 it will continuously spawn 25 enemies in.


Spawn Wave & Spawn Enemy

This is the enemy; you see that it has different positions that they have spawn in. but they also look to the same direction. beneath here i will tell you how that works.

In this loop it will do everything for the waves to spawn but not only spawning the waves but also the enemies this loop works together with the if statements when those steps are done it will come to here to activate the waves and spawns the enemy and that is how this waves spawner works.

Here it spawns the enemy i use a Random Range so that they will spawn randomly in the given positions and between those positions it will spawn the enemy. As you can see i use Quaternion the reason for this is that the enemy rotates to the right rotation grade. because if i didn't use it, it was going all over the place and because of Quaternion it is in the right rotation.