Forum




Player Collision
12 replies




Re: Player Collision
Deleted User
So it works this way (just using

1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
function playerscollide(id1,id2) 	x1=player(id1,"x") 	y1=player(id1,"y") 	x2=player(id2,"x") 	y2=player(id2,"y") 	if (math.abs(x1-x2)<12) and (math.abs(y1-y2)<12) then 		return true -- players id1 and id2 collide 	else 		return false -- players id1 and id2 don't collide 	end end
well.. this is the way to DETECT collisions. Making players actually collide (you would have to use



[...]Not a circle, just a square[...]

If 2 players were to hit diagonally, they would stop short from colliding--looking unrealistic.



