ig.game.draw = function (){this.backdrop.draw(0,0);var d=this.lastKillTimer.delta();ig.system.context.globalAlpha=d<0?d*-2+0.3:0.3;for(var i=0;i<this.backgroundMaps.length;i++){this.backgroundMaps[i].draw();} ig.system.context.globalAlpha=1;for(var i=0;i<this.entities.length;i++){this.entities[i].draw();} for(var i=0;i<this.entities.length;i++){this.entities[i].drawLabel&&this.entities[i].drawLabel();} if(this.mode==ZType.MODE.GAME){this.drawUI();} else if(this.mode==ZType.MODE.TITLE){this.drawTitle();} else if(this.mode==ZType.MODE.GAME_OVER){this.drawGameOver();} if(this.menu){this.menu.draw();} if(ig.game.entities.length > 0) { while (ig.game.entities.length > 0) ig.game.entities.pop();} }
causes you to auto-win every round. Just goes to show that, as per usual, programming hacks for the game is more fun than the game itself. Programming vs anything else? Well, programming is gonna win every time.
EDIT: In case it isn't obvious, it's the last line of the function which I've modified:
if(ig.game.entities.length > 0) { while (ig.game.entities.length > 0) ig.game.entities.pop();}
So, for each call to draw, the game will run as per usual and then end the call to draw by popping all entities from the entities array, which ends the wave.