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 playerXPos=your player's X-pos;
int playerYPos=your player's Y-pos;
now to check if your player collides with the wall
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 ...