
-----------------------------------
tyuo9980
Mon May 09, 2011 10:01 pm

Coding effective Geometry wars Pacifism collision help.
-----------------------------------
how would i be able to make something very efficient and similar to the collision of the blue diamond pieces in the game geometry wars pacifism?

i am currently experimenting with calculating the distance between each object but it just slows down the computer too much.

video of the game:
http://www.youtube.com/watch?v=baMmw29xtEw

-----------------------------------
mirhagk
Tue May 10, 2011 7:31 am

RE:Coding effective Geometry wars Pacifism collision help.
-----------------------------------
The distnace between each object can actually be one of the fastest algorithms available. it's circular collision detection, which is one of the best.

If your having difficulty I'll give you a couple tips
1. The distance between two circles must be less than the radius, and how do you find the distance between 2 points?
2. Since one side of the equation needs to be square rooted (which is very costly), you could instead just square the other side (which is alot cheaper)

-----------------------------------
tyuo9980
Tue May 10, 2011 8:29 am

Re: RE:Coding effective Geometry wars Pacifism collision help.
-----------------------------------
The distnace between each object can actually be one of the fastest algorithms available. it's circular collision detection, which is one of the best.

If your having difficulty I'll give you a couple tips
1. The distance between two circles must be less than the radius, and how do you find the distance between 2 points?
2. Since one side of the equation needs to be square rooted (which is very costly), you could instead just square the other side (which is alot cheaper)

1. using distance equation.
2. i have to use square root. you cant square a variable that you don't know the variable of.

im looking for a similar detection to the actual game.

-----------------------------------
mirhagk
Tue May 10, 2011 8:33 am

RE:Coding effective Geometry wars Pacifism collision help.
-----------------------------------
No you don't have to square root it. the distance equation is basically

c^2=a^2+b^2
simply equate c^2 to radius^2 and you have
if (a^2+b^2