Files
vim-snake/src/useGameStatus
pastilhas 01526b8cd8 fix(phase1.4): check level-up threshold BEFORE incrementing food counter
- Calculate willLevelUp BEFORE foodsEatenRef.current += 1
- This way the 2nd food that triggers level up is still worth 1 point
- Only AFTER eating it do we level up to 2
- Correct: eat food1(+1)=1pt, eat food2(+1, then lvlup)=2pts, eat food3(+2)=4pts
- Issue was checking >= threshold AFTER incrementing, causing wrong level calculation
2025-10-30 23:02:26 +00:00
..