In Java programming a game like with maze like structure. How do we check collision with wall? Anyone who knows how the wall object work? Many thanks--Petranilla

suppose '#' denote the walls in a maze and 'P' is a player and ' ' are free ways to move..if charAt(x-coord,y-coord)=='#'..it's a collision, you cannot move..if charAt(x-coord,y-coord)==' ', it's a free space where you can move

try putting the co-ordinates of the walls in a vector like this

Vector<Point> wallCoords=new Vector<Point>();
//fill the vector with the top-left coordinates of your wall;
int iconWidth=width_of_your_icon;
int iconHeight=height_of_your_icon;
int playerXPos=your player's X-pos;
int playerYPos=your player's Y-pos;

now to check if your player collides with the wall

Iterator it=wallCoords.iterator();
while(it.hasNext()) {
Point coord=(Point)it.next();
if((playerXPos>=coord.getX() && playerXPos<=(coord.getX()+iconWidth))
//collision with wall on x-axis occurred
//do same checking for y-axis collision
}

I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...

Write a C program that should create a 10 element array of random integers (0 to 9). The program should total all of the numbers in the odd positions of the array and compare them with the total of the numbers in the even positions of the array and indicate ...

Hi. so this is actually a continuation from another question of mineHere but i was advised to start a new thread as the original question was already answered.

This is the result of previous question answered :