Author Topic: Collide Question...  (Read 900 times)

hamedn

  • Member
  • **
  • Posts: 45
  • Karma: +0/-0
    • View Profile
Collide Question...
« on: Sun, Apr 4, 2010 »
Hey,

Whenever I use collide, the two objects cannot overlap. I would like my player to be able to walk through an object yet I want to be able to test to see if the 2 are colliding.

The below code does not work, instead it gives me a black screen after the preloader....

if (_player.overlaps(myObject) == true) {
//etc
}


         

Liaf

  • Member
  • **
  • Posts: 19
  • Karma: +0/-0
  • yay!
    • View Profile
Re: Collide Question...
« Reply #1 on: Mon, Apr 5, 2010 »
Well, an object that is solid and able to collide with another, of course can't overlap that one. So if you want to move through it you have to set stuff.solid = false;
Then you can test with _player.overlaps(stuff).

I hope this helped you.