Page 1 of 2

Collision detection

Posted: Mon May 07, 2012 2:00 pm
by magreidis
How to make collision?

Re: Collision detection

Posted: Mon May 07, 2012 2:08 pm
by Refpeuk
Depends on the kind/complexity you want. Probably best is to use http://vrld.github.com/HardonCollider/

Re: Collision detection

Posted: Mon May 07, 2012 2:18 pm
by magreidis
I want really simple collision that is just a wall

Re: Collision detection

Posted: Mon May 07, 2012 2:34 pm
by mickeyjm
Collision detection can be quite complicated depending on what you are doing, could you either give us a .love or expain the collison detector needed (i.e. is it a gridaligned rectangle colliding with a grid aligned rectangle or a point collideing with a rectangle or non grid aligned rectangles colliding etc)

Re: Collision detection

Posted: Mon May 07, 2012 6:47 pm
by veethree
Best way to do collision is using the handy search function on the forums. There are plenty of topics here on collision detection.

Re: Collision detection

Posted: Mon May 07, 2012 8:54 pm
by Puzzlem00n
I agree with the others. If you want collisions, you need to describe more to us, like what is colliding with the wall in the first place.

Re: Collision detection

Posted: Tue May 08, 2012 4:14 pm
by Kasperelo
What about:

Code: Select all

if player.x >= wall.x - player.sprite:getWidht() then
    player.x = wall.x - player.sprite:getWidht()
end

That does work for me.

Re: Collision detection

Posted: Wed Jul 18, 2012 11:20 pm
by LaserGuns
Kasperelo wrote:What about:

Code: Select all

if player.x >= wall.x - player.sprite:getWidht() then
    player.x = wall.x - player.sprite:getWidht()
end

That does work for me.
Why doesn't your avatar say "obey"? Banned from forums. lol

Re: Collision detection

Posted: Wed Jul 18, 2012 11:28 pm
by Nixola
LaserGuns wrote:Why doesn't your avatar say "obey"? Banned from forums. lol
Why don't you have an avatar that says "obey"? ;)

Re: Collision detection

Posted: Thu Jul 19, 2012 12:21 am
by LaserGuns
Nixola wrote:
LaserGuns wrote:Why doesn't your avatar say "obey"? Banned from forums. lol
Why don't you have an avatar that says "obey"? ;)
Uh... well... SHUT UP lol