I am developing a game named
Business Magnate. This post is part 3 of its development blog (other parts:
part 1, part 2).
I programmed a lot of particle systems in my life, but when I started implementing the game engine for Business Magnate I wasn't aware that I would need one for that game, too. It is a tycoon game, after all. But what was I thinking, of course I need one. Besides other types of businesses, you can create space companies in that game, and launch rockets into space. Rocket engines produce fire and smoke, so - yes - of course I need a particle system. So this was what I came up with:
It might need a few adjustments, but it is looking ok so far, I think. It works like this: Each particle is a structure in an array and has an image and a position, movement speed, and lifetime assigned to it. Every frame, each particle is moved and animated (faded out based on its lifetime, in that case):
void animateParticles(timeDelta)
{
for (i=0; i<Particles.length; )
{
var p = Particles[i];
if (p.TimeToDelete < timenow)
Particles.erase(i); // delete particle
else
{
// move particle
p.X += timeDelta * p.SpeedX;
p.Y += timeDelta * p.SpeedY;
++i;
}
}
All particle systems I wrote so far were in 3D, but 2D ones are the same, only the Z component is missing. I probably will have to adjust the position of the fire a bit for the different types of rockets, but I think for a business game, they look ok so far.
Another thing which you might have spotted on the .gif above is this:
There is a car moving in there. I originally wasn't sure if the game would have animated cars, but I decided that it would be much nicer with them. The Minibus you can spot in that gif is the first attempt at making this work, too. I'll likely write more about that next time.
Business wise: The game has a
Steam page for a few days already, and it is possible to wishlist it on Steam. A handful of people aleardy did, which is very nice. But the Steam community forum is quite empty so far. Nobody seemed to have an interesting question about the game so far on steam, not sure why. Hope it is because the trailer answers all questions already. :)
If you like the game, you can
subscribe to the newsletter on the
game's website, or follow me on
twitter.