Varcade Dev Blog

Smoke on the ground

by on Mar.04, 2010, under Games

I was able to expand the pathing a bit, now enemies can have a path offset when they are deployed, this lets multiple enemies travel in a sort of formation. It is still primitive but works. In the screenshot below, the white dots are the defined path, the colored ones are the ones the enemies are using.

It took a while to figure how to create an offset path, having done something similar in 3D in the past, I was pretty sure I would need the cross-product or some fancy math to find my new point,  the solution turned out to be incredibly simple:

public static Vector2 Perpendicular(Vector2 a)
return new Vector2(a.Y * -1, a.X);

Ya, I  havn’t really tried to understand how it works, it just does.

I also created a smokeObject class, to make dust clouds as gameObjects move across the ground.  This turned out pretty nice, after a good bit of trail-and-error, I got the smoke to get pushed along with the object like a wake on a boat, then fall off, and get pulled away with the wind.

Leave a Reply

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!


A few highly recommended websites...