Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by salsa

Hi guys,

Anybody knows if is possible detect if my player is collided with another entity or a map collision?

Lets say... I'm moving my player and I touch a specific area in map .. that area is a collision area... and when it happens... show me something

its possible detect this?

thanks

1 decade ago by StuartTresadern

I think you should first take some time to thank fugufish and alexandre for helping with your last problem!

You may find you get a little more help in the future if you first thank the other developers. It does not matter if it’s a complex problem or a dumb mistake it’s the point that someone else took the time to help.

1 decade ago by salsa

its ok... I will keep searching... thanks :)

1 decade ago by quidmonkey

I recommend the Impact documentation.

1 decade ago by alexandre

By all means do follow and read that link fugu just sent; that page contains 80% of the answers to your questions. Also, clearer questions--yours are fraught with ambiguities--will help the most. Don't be afraid to go into details. That's the number one problem for many people: asking for help but not giving enough info.

Meanwhile, this may help get you started:

player.js:
...
collides: ig.Entity.COLLIDES.ACTIVE,
...

// This is what you use to check for collision
// map collisions
handleMovementTrace: function(res)
{
  if (res.collision.y || res.collision.x)
    this.showmesomething();

  this.parent(res);
},

// This is called whenever your entity
// collides with another one that also
// has collision detection enabled
collideWith: function(other, axis)
{
  this.showmesomething();
  this.parent(other, axis);
},

showmesomething: function()
{
  console.log('something');
},

1 decade ago by salsa

Thanks Alexandre

1 decade ago by alexandre

Pleasure. :)
Page 1 of 1
« first « previous next › last »