Example #1
0
 void Entity::moveDown() {
     y = min(LCDHEIGHT - h, y + vy );
      if (maze.checkWallCollision(x, y)) {
       y = min(LCDHEIGHT - h, y - vy );
     }
}  
Example #2
0
void Entity::moveRight() {
      x = min(LCDWIDTH - w, x + vx );
      if (maze.checkWallCollision(x, y)) {
        x = min(LCDWIDTH - w, x - vx );
     }
}
Example #3
0
void Entity::moveUp() {
     y = max(0, y - vy );
     if (maze.checkWallCollision(x, y)) {
        y = max(0, y + vy );
     }
}
Example #4
0
void Entity::moveLeft() {
  x = max(0, x - vx );
   if (maze.checkWallCollision(x, y)) {
      x = max(0, x + vx );
   }
}