function to check if food is at bottom or right edge of screen now checks grid position instead of total screen width and height