Java-Snake-Game icon indicating copy to clipboard operation
Java-Snake-Game copied to clipboard

Apple may spawn on top of snake body segments

Open leosenpaihh opened this issue 1 month ago • 0 comments

The apple placement logic does not validate the generated apple coordinates against the snake’s body positions. As a result, the apple can appear directly on top of the snake. The apple should be placed only on empty cells, not overlapping with the snake. This error causes unexpected instant apple consumption, breaks gameflow consistency and may lead to unpredictable behavior in some spawn conditions

leosenpaihh avatar Dec 08 '25 11:12 leosenpaihh