Collision!
Elo! Using Allegro. Need help in collusion. This is what I got so far.
1 2 3 4 5
|
int rad1,rad2;
int dis = sqrt((long double)(px-px)*(px-bx)+(py-by)*(py-by));
dis -= rad1;
dis -= rad2;
|
Now what?
Btw, its for 2 circles. px/py = playerX/playerY
bx/by = botX/botY.
Thanks alot.
Kyle.
Last edited on
collision happens if (dis <= 0). Maybe you should check that out and act such (can't move, bounce back etc.)
Topic archived. No new replies allowed.