I have used lastX=W and lastY=H.
As W and H are the ending coordinates, why is the snake still going out of H and W without stopping the game?
Snake is going out of H and W
@Atif-Sufyaan-1976506059127874
Your W and H are 1000
But snakeHead X and Y have not been multiplied by 66 before checking
Why should the snake head be multiplied by cell size (66) before?
@Atif-Sufyaan-1976506059127874
The actual size of the board and the number of cells of the board are not the same
You need to perform scaling to bring them to the same size before comparison
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.