divers Posted May 14, 2017 Share Posted May 14, 2017 Hello, as in the topic: for(var i = cubes.length-1; i > ile*ile-1; i--) { cubes[i].temp.kill(); cubes.splice(i,1); } function Cube(i){ this.i = i; this.show = function(x,y,target){ if(target == 1) this.temp = game.add.sprite(x, y, 'rect2'); else this.temp = game.add.sprite(x, y, 'rect'); this.temp.inputEnabled = true; this.temp.events.onInputDown.add(onTap, this, 0, this.i); } } My array is splicing correctly, but the sprites are still displaying. Link to comment Share on other sites More sharing options...
Recommended Posts