Game Development Reference
In-Depth Information
//Calls layerList's getTotalNotInMatrix() method to retrieve
//the impassable path matrix for all layers.
............
currNotIn = layerList.getTotalNotInMatrix();
............
public boolean checkCollision( int row, int col) {
int [][] notIn = currNotIn;
if (row<0||row>MAP_ROWS-1||col<0||
col>MAP_COLS-1||notIn[row][col]==1) {
return true ;
}
return false ;
}
In most video games, the collision detection is the process of determining when two bound-
ing boxes (spheres) of the objects are about to overlap or have already overlapped.
Search WWH ::




Custom Search