Mutant Madness - Firing
Bugs
Since the last blog I have been spending most of my time trying to find and solve bugs. There is a nasty one which causes a memory error. But it is not always present in every single playthrough.
Firing
I started working on the firing mechanism. That didn't go as smooth as I had hoped. Especially my particles looked really boring. After a couple of days, I decided to remove them for now.
Bunkers, canons and Sniper tower can succesfully fire. Rotation and good particles are added later. The main point is that their firing mechanism works.
The sniper tower is the most peculiar of them all. I wanted to make a bullet trail and went for an unusual approach. I created a cylinder, which I align to the enemy that is locked. The cylinder gets stretched as long as the distance between the tower and the enemy. This doesn't work entirely correct but for now I am satisfied.
WaveManager
The most important class is the Wave Manager. It stores all the enemies, time counters, waves and subwaves. Adding waves is fairly simple now:
//Create all the subwaves for wave 1[/left]
[left]//Enemy, Spawn time, amount, time till next subwave, path object
SubWave subWave0_0 = new SubWave("crawler", 1, 4, 5, path);
SubWave subWave0_1 = new SubWave("crawler", 0.5f, 8, 5, path);
SubWave subWave0_2 = new SubWave("crawler", 0.1f, 12, 5, path);
//Create all the subwaves for wave 2
SubWave subWave1_0 = new SubWave("crawler", 1, 10, 5, path);
SubWave subWave1_1 = new SubWave("crawler", 0.2f, 10, 5, path);
SubWave subWave1_2 = new SubWave("crawler", 0.1f, 40, 5, path);
//add the subbwaves to the wave1[/left]
[left]//time till next wave
Wave wave0 = new Wave(1);
wave0.Add(subWave0_0);
wave0.Add(subWave0_1);
wave0.Add(subWave0_2);
wave0.CalculateWaveTotalTime();
//add the subbwaves to the wave1
Wave wave1 = new Wave(1);
wave1.Add(subWave1_0);
wave1.Add(subWave1_1);
wave1.Add(subWave1_2);
wave1.CalculateWaveTotalTime();
//Create a WaveManager[/left]
[left]//Extra time between waves, camera
WaveManager waveManager = new WaveManager(0, camera);
waveManager.Add(wave0);
waveManager.Add(wave1);
waveManager.CalculateTotalGameTime();
Sound
I added severall sound effects, some music and some voice overs. I hope you like them.
Demo
You can donwload a first demo from the asses store:
1 Comment
Recommended Comments