Monthly Archives: March 2014

Particle Effects

Since there is only about a week left on this project and we have a working game that is almost finished, we are just adding things for fun (and sometimes because they are useful). This week I have been writing the code for adding particle effects in the game. We will use these effects when our charging enemies are loading their charge, right before our whack-a-mole boss comes out of the ground, when Barney (the avatar) dies and more things like that.

I started by writing the code for the particles in the class Particle. They consist of a sprite (a picture), a lifetime timer, a speed and a star position. When it is created it gets a random direction in which it will travel the whole time it exists. You can add some code making it move in another way, perhaps like an arc, but I think it looks quite well when it moves in just one direction, since its lifetime is pretty short. After the lifetime timer is up the particles sprite starts to fade until it is totally transparent.


To manage these particles I created a ParticleManager class which consists of a vector containing Particle pointers and three functions that adds, update and draw the particles. When adding particles you decide which kind of particle you want to create, this decides which sprite to use for the specific particle. Then you also decide how many of that kind you want to add and where you want it to spawn. Then the manager adds the particles to the vector and loops through the vector in every update to update the positions and timers for all of them, and draw them to the screen.

When creating lots of these at once it could look like a dust cloud coming from the ground, but in my example pictures I have used a placeholder-sprite of a muffin. For example we will add these when our kiting-boss dies and his ball of manure and grass will sort of explode into pieces.

The rest of the week I will be adding these particles where they are supposed to be, which means I have to add the manager to all the enemies, bosses and the avatar. I have to adjust the amount of particles that are created each time so it won’t take over the screen and steal the attention from the other things going on and so they won’t be unnoticed.

too_much    too_few



This Monday we had a play testing where we got very much and good feedback. But one thing we have been discussing in the group is the downtime in our game – the time where there isn’t much to do in the game. For example when you have killed a boss and have to run all the way back to the beginning and you probably have killed all the enemies on your way to the boss already. Or if you die and have to run back to where you died, and the same thing there, you have probably already killed all the enemies. This downtime is something we want to get rid of. We have discussed doing this in three ways.

1. Teleportation. When you have defeated a boss we have discussed to put some sort of portal back to the beginning. This might be needed since the level  is built like it is, there are one boss at each end of the map so you have to go back all the way from one boss to get to the next and then back to the beginning again to get to the last and final boss. The plus is that the downtime will be drastically reduced, the negative is that if you haven’t found all the hidden rooms or all the textiles, you have a second chance if you run all the way back. This of course is something the players will have to decide themselves if they want to teleport or run, if we implement it.


2. Destructibles. One thing that might make it more fun to run all the way back is if there are stuff you can shoot and destroy. To fit our theme in the game we have discussed having some eggs along the path that the player can destroy just for fun. And if we add achievements to the game (if we feel like it and have the time, it’s not something we have planned to implement) that could be a fun one, to find and destroy them all.


3. Checkpoints. As it is now, when you die you start from the beginning again forcing you to run all the way back to where you died, with nothing to do (if you had killed all the enemies the first time). So our solution to this is adding checkpoints in the hidden rooms, so if you die you start from the last checkpoint you passed.


The only one of these that we have decided so far to implement in the game are the destructibles, the eggs. We’ll see if the rest is going to be implemented as well if we have time.

Bosses implemented

This week I have finally implemented the AI for all our three bosses, and tried to balance them somewhat. I will explain some of the balancing in this post, for the bosses’ different AI take a look at my previous post from last week.

I started with our boss Grubby McGrub (the whack-a-mole boss). When he shoots up from the ground he will shoot some slime at you. I started with one, aimed at the player, and then added four more shooting out from him in the directions of a + and an x:


After some testing from Ludde in my group he complained about how easy it was to avoid the slime, so I added 24 more!


Now it’s very much harder to avoid the slime, especially since he shoots up from the ground almost right beneath you. You only have a very short time to move from where he comes up from the ground, the only thing alarming you is the cracks in the ground. This I also had to balance some since first I set it too low, you didn’t have a chance to get out of the way. Now you can barely make it. I still have to balance his life and damage but that will happen sometime next week. Then I have to try all the set bonuses and without any textiles at all to find out how much is the right amount.

Then I started with the boss Ben Bugger (the kiting boss). The things I have balanced with his fight is how often he shoots his slime, how slow/fast the player and the boss will run while in the goo and while not in it.


At first I managed to forget to reset the timer that decided when to increase the boss’ movement speed so he got a really high speed almost directly as the fight began so the player was unable to run away from him. This I discovered pretty fast and also changed the timer to a shorter time since we want him to be really fast and annoying. He won’t be super-fast though since when he is in the goo or he hits the player his speed reset. I believe he is still a bit too fast, since the player has 500 in speed and the boss starts with 400.

As with Grubby I still have to balance the health and damage for Ben, but it’s the same problem – I have to test all the possible combinations of textile.

The last and final boss I haven’t balanced that much yet, it’s not that much to balance since he won’t do any damage himself, and all his minions are already quite balanced. The timer for when he spawns his minions is quite long, but the thought is that he spawns them when he reaches 75%, 50% and 25% of his life as well. It’s his health I have to balance later.