particles?

Creating Games? Developing something for fun?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
davegiblinGA1494
Posts: 1
Joined: Thu Dec 15, 2011 10:43 am

particles?

Post by davegiblinGA1494 » Thu Dec 15, 2011 9:05 pm

How do I so a laser beam and shield effects for a space combat game? Is there a particle engine for this?

Thanks,
Gib

ThatOneGuy
Posts: 77
Joined: Fri Jan 04, 2013 9:57 am

Re: particles?

Post by ThatOneGuy » Fri Jan 04, 2013 9:07 pm

I guess that depends on how you want it to look. I once made a simple space game with lasers, shield (which changed appearance based on how damaged it was), and time freezing effects using images that cycle on the screen when active. It gives the appearance of shield and lasers (and whatever else) using a very simple sort of animation. For the laser, I just changed the angle of the image to match the direction my ship was facing. It was designed to pass through everything and exit the screen, so there was never any hitting effect / point at which the laser hits and stops, though there were explosion effects.

I built that little game years ago and It's long gone now, but I can probably remember some of what it took if I work at it.

Other than that, I am not sure if there is a better solution for you. I don't think that there is a way of doing particles on this engine. Animations might be your only option.

Of course, there is always the choice of simulating particle physics by creating a bunch of different types of objects and duplicating them whenever particles are needed and giving them physics script (i.e. bounce off of other objects in random directions, start with a random velocity and decelerate, etc). This could work for lasers if these are created on the object where an image of the laser -- set to span the distance between the ship and whatever is directly in front of it -- intersects with that object. It would work great for fire and wreckage as well -- even possibly causing damage for hitting them since they work like any other object. You just need to remember to delete the objects as soon as they leave the field of view or just after some specified time in the object's script. Otherwise, you will have some serious memory wasting and your program will eventually crash when too many of these "particles" are floating around.

In all honesty, animations are much easier, less prone to glitches, and take much less resources to run, but they're not nearly as snazzy as simulated particles. Take your pick and roll with it.

Post Reply

Return to “Games”