A lightweight JavaScript game engine git clone git://soophie.de/game-engine
103 this.items.push(item); 104 } 105 remove(item) { 106 const i = this.items.findIndex(n => n === target); 106 const i = this.items.findIndex(n => n === item); 107 if(i !== -1) { 108 this.items.splice(i, 1); 109 }
103 this.items.push(item);
this.items.push(item);
104 }
}
105 remove(item) {
remove(item) {
106 const i = this.items.findIndex(n => n === target);
const i = this.items.findIndex(n => n === target);
106 const i = this.items.findIndex(n => n === item);
const i = this.items.findIndex(n => n === item);
107 if(i !== -1) {
if(i !== -1) {
108 this.items.splice(i, 1);
this.items.splice(i, 1);
109 }