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 sunnybubblegum

I've noticed since modifying the pong demo that when my Player collides with certain entities, he can't walk away from them. He can only continue walking along the entity until he gets free.

My Player&039;s #collides method is set to ACTIVE, and the entity in question's is set to FIXED (he's an NPC so he isn't moveable). However I've tried changing my Player's to PASSIVE and FIXED and he still gets stuck to the other entity. What's going on?

1 decade ago by Vertig0

Can you post a little code of your player entity and the problem entity?

1 decade ago by Jerczu

Set your player to NEVER and give entities that collide type A or B and resolve their collision with check function.

1 decade ago by sunnybubblegum

Could you show me an example of how to do this? Player is now set to NEVER and both entities are set to type A.

1 decade ago by Jerczu

Ok so in your entity (one of them or both) set property
checkAgainst:ig.Entity.TYPE.A 

Then set check function
check:function(other){
       if(other instanceOf EntityYouCheckCollisionAgainst){
       //do some funky sh* when entities collide.
}
}

1 decade ago by sunnybubblegum

Alright so I&039;ve added the #checkAgainst property and the check function to my player. How would I now stop him from walking through/over the other entity?
Page 1 of 1
« first « previous next › last »