1 decade ago by Jerczu
Useful if you have entities shooting at you or you want entity to disappear once it reached the edge of the screen. I am using it for projectiles in entity update function.
update:function(){ this.parent(); var pp = this.pos.x - ig.game.screen.x; if( pp > ig.system.width || pp<0){ this.kill(); //console.log("killed") } }