Fix for the apple generation method

Fix for the apple to be generated a certain distance from the canvas
border and the snake's head.