Creating a Tycoon Game Part 3 - Rockets and Particle Systems

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.

three comments, already:

Is this a game which is being written from scratch, or is it based on CopperCube?
j9907 - 30 11 18 - 20:49

It is a 2D game, which uses an own engine I have used for other games as well before. I planned to have that framework be integrated into CopperCube at some time, but it has some still open technical challenges to do that.
niko - 01 12 18 - 08:22

Ah… Nice. I was going through the early blog posts you made and I saw you made a different game back in 1999 or so… You mentioned it worked on ReactOS :) Glad to see you know of that project… I’ve been following them closely for a long time now and it’s made a phenomenal amount of progress as of late!
j9907 - 01 12 18 - 10:09


Displayed name:  
Remember personal info?
yes
no
Website (optional):
Enter "layered" (antispam):
Comment:Emoticons / Textile

 


Small print: All html tags except <b> and <i> will be removed from your comment. You can make links by just typing the url or mail-address.
Note: If you type in your email adress above, it will be visible to other visitors, although it will be hidden for bots using javaScript.