please anyone help, I am very short on timehave tried to add the function checkIfPlayerMovingIntoWall() to the player and the wall objects, see bellow, but again nothing happened.
function Wall (row,col) { this.row = row; this.col = col; this.color = "#000"; this.width= 25 this.height= 25 this.leftX = this.row; this.rightX = this.row + this.width; this.topY = this.col; this.bottomY = this.col + this.height; } function Player(row, col) { this.isUpKey = false; this.isRightKey = false; this.isDownKey = false; this.isLeftKey = false; this.row = row; this.col = col; this.color = "#f00"; this.width= 25 this.height= 25 this.leftX = this.row; this.rightX = this.row + this.width; this.topY = this.col; this.bottomY = this.col + this.height; } function checkIfPlayerMovingIntoWall() { if (currentPlayer.topY < wall.bottomY && currentPlayer.bottomY > wall.topY && currentPlayer.leftX < wall.rightX && currentPlayer.rightX > wall.leftX) { alert("collision detected"); } }