1 decade ago by yikidu
So I am using this script to keep the level centered on the player entity,
#
if (player.pos.y > ig.system.height / 2) {
this.screen.y = player.pos.y - ig.system.height / 2;
}
but I want the script to stop functioning when the player hits a trigger, basically allowing the player to fall off the screen when he collides with the trigger. I am using box2djs as well if that makes a difference. Any help would be appreciated.
#
if (player.pos.y > ig.system.height / 2) {
this.screen.y = player.pos.y - ig.system.height / 2;
}
but I want the script to stop functioning when the player hits a trigger, basically allowing the player to fall off the screen when he collides with the trigger. I am using box2djs as well if that makes a difference. Any help would be appreciated.