Answer the question
In order to leave comments, you need to log in
Uncaught TypeError: Cannot read property 'x' of undefined Collision check. How to solve the problem?
Uncaught TypeError: Cannot read property 'x' of undefined Collision check. How to solve the problem ?
here is the game. The Game itself
Check for clash of swords, with doge.
Game.prototype.update = function(){
for(let i = 0; i < this.doges.length; i++){
for(let i = 0; i < this.sword_right.length; i++){
if(Math.abs(this.doges[i].x+50-this.sword_right[i].x)< 50 && Math.abs(this.doges[i].y+-this.sword_right[i].y)<50){
this.doges.splice(i,1);
break;
}
}
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question