1 decade ago by eLouai
Hi
Just wondered how to go about detecting when the player hits the collisionmap to either damage health or change animation or even just to kill outright.
handleMovementTrace()
Also I only get a boolean on whether he hit the x or y planes as opposed to a value of how strongly he hit the sides. Was this changed?
My hacked workaround (since it was a 48 game jam) was to change the plugins.joncom.box2d.entity to add the following code
in the update function.
Here is the link to the game:
http://jam.orcajam.com/submissions/25-able-bodied-pig-copter-copter-pig
Even then the collision detection is sporadic, box2d handles the collisions fine.
Any thoughts?
Just wondered how to go about detecting when the player hits the collisionmap to either damage health or change animation or even just to kill outright.
handleMovementTrace()
Also I only get a boolean on whether he hit the x or y planes as opposed to a value of how strongly he hit the sides. Was this changed?
My hacked workaround (since it was a 48 game jam) was to change the plugins.joncom.box2d.entity to add the following code
var mx = this.vel.x * ig.system.tick; var my = this.vel.y * ig.system.tick; var res = ig.game.collisionMap.trace( this.pos.x, this.pos.y, mx, my, this.size.x, this.size.y); this.handleMovementTrace( res );
in the update function.
Here is the link to the game:
http://jam.orcajam.com/submissions/25-able-bodied-pig-copter-copter-pig
Even then the collision detection is sporadic, box2d handles the collisions fine.
Any thoughts?