myMap.prototype.isCollide=function(shape_data){
for(var i=0;i<4;i ){
var row=shape_data[i].row;
var col= shape_data[i].col;
if(col<0 || col==this.width) return true;
if(row==this.height) return true;
if(row<0 ) continue;
else
if(this.myLines[row][col]!=NoShape)
return true;
}
return false;
}
When running, it always prompts that the red line cannot obtain the value of the attribute "undefined", and the object is NULL or undefined.
Sent to the wrong place
myLines row col
There is a problem with these three variables. Check if they are defined, or Is myLines[row][col] out of bounds?
What is myLines? Post the complete code
Moreover, it is best to go to the js section for this thing. .
myLines row col
There is a problem with these three variables. Check whether they are defined, or whether myLines[row][col] is out of bounds.
It is out of bounds. . . The problem has been solved, haha, thank you very much.