how do i detect if the ball hits the square (collison)
r3b0rn

how do i detect if the ball hits the square (collison)

You are viewing a single comment. View All
Answered by Coder100 [earned 5 cycles]
View Answer
r3b0rn

@Coder100
if (ball.x > player.x && ball.y > player.y && ball.x < player.x + player.width && ball.y < player.y + player.height){
document.write("end game")
}
so this basically?