1 decade ago by motoko
Hi everybody, this is my first post!!
I have a puck and a paddle and i want to change the way the puck collides based on:
- The exact point (of the paddle surface) where the puck collides with the paddle.
- The velocity (dierction) of the paddle (if moving) while puck collides with it.
I'm trying to get the paddle properties within the puck "collideWith: function( other, axis )" method:
But i get the same values for 'other' than for 'this' for vel and for position...
¿Some clue how should i apporach this?
I have a puck and a paddle and i want to change the way the puck collides based on:
- The exact point (of the paddle surface) where the puck collides with the paddle.
- The velocity (dierction) of the paddle (if moving) while puck collides with it.
I'm trying to get the paddle properties within the puck "collideWith: function( other, axis )" method:
collideWith: function( other, axis ) { ig.game.lastBX = this.vel.x; ig.game.lastBY = this.last.y; ig.game.lastPX = other.vel.x; //<other should be the paddle? ig.game.lastPY = other.last.y; //<other should be the paddle? }
But i get the same values for 'other' than for 'this' for vel and for position...
¿Some clue how should i apporach this?