Zombie Massacre

You seem to be very arrogant and cocky. Have fun with your shitty game.

That escalated quickly… :persecutioncomplex:

He was being a total asshole, to me, and those who defended my innocent comment.

It’s a good moment to stop this discussion now.
This should not become a chat about such.

@trollwarrior1, if you’re not going to politely reply to discussion, then I suggest not posting in a discussion forum. Name-calling is unnecessary, either way.

Ow common peeps don’t be so mad. Take a look at the new version! :smiley:

Nice job! The zombies have decent path-finding ;D.
Oh, you might want to add some collision between zombies; they bunch up into one blob if you don’t

There is 0 path finding in here. Absolutely none. I’m too lazy to study A* path finding. This looks like path finding, but it isn’t. About zombies collision yea. It might take a lot of performance though.

Collision doesn’t take much performance really. Not with a simple circle or box. I recommend if you’re using libGdx to use the circle class, and check if the circles overlap each other, and if they do, don’t perform a movement. You can quickly iterate through your entities and check them with each other, it shouldn’t cause many problems. This might not be the best way, but it works. (If anyone has a better way, please do add it here.)

Yeah, I use pythagoras’ great idea:

A^2 + B^2 = C^2

So you can find the distance something is by:

Math.sqrt((dx*dx)+(dy*dy))

where d means delta (not delta time, but the difference between your x and the other x. Same with y.

So if the distance is less than your collision radius, it is a collision!

if(dist < rad) collisionStuffs();

Didn’t think of that :stuck_out_tongue:

I’m going to sleep btw. Good night.

Hi jGamers.

Download the latest version of this game @

https://www.mediafire.com/?37p9pu7fumik7dn

One very, very important thing I’d like to add:

Imagine you’ve got two circles, a and b. If you want the two circles not to collide, you need to check whether the distance between the two circles is greater than the combined radii:

a.radius + b.radius < distance

So thats exactly what you do, let’s fill in the distance formular:

dx = b.x - a.x dy = b.y - a.y a.radius + b.radius < sqrt(dx * dx + dy * dy)

So what’s the problem with this? The problem is that [icode]sqrt()[/icode] is a (relatively) very slow operation. To get rid of it, simply take the square of the terms:

a.radius + b.radius < sqrt(dx * dx + dy * dy) <=> (a.radius + b.radius)² < dx * dx + dy * dy

And in the end that’s much faster. It might be premature optimization, but it takes almost no time to understand and change.

I Hope I’m helpful :slight_smile:

Check out the new version. It is pretty playable :stuck_out_tongue:

The game makes really fun. :slight_smile: Do you want to add some other kinds of zombies?

Not really. This was supposed to be kinda game like this. Just shoot them and that’s it :smiley:

Yes you are helpful. I will use this in my shaders, which use sqrt() quite a lot.