test: increase initial snake size to 6 for easier testing

- Change initial snake length from 3 to 6 segments
- Makes it easier to test turning mechanics and buffering
- Better visibility of snake movement patterns
- Can be reverted once testing is complete
This commit is contained in:
2025-10-30 22:48:42 +00:00
parent a3c9f201be
commit c5bd51d96b
2 changed files with 23 additions and 17 deletions
+12 -9
View File
@@ -15,15 +15,18 @@ export function useCursor(
const lastMovedDirectionRef = useRef<Direction>("up");
const nextDirectionRef = useRef<Direction | null>(null);
const initSnake = () => {
const centerR = Math.floor(rows / 2);
const centerC = Math.floor(cols / 2);
const initialBody: SnakeBody = [
{ r: centerR, c: centerC },
{ r: centerR + 1, c: centerC },
{ r: centerR + 2, c: centerC },
];
const initSnake = () => {
const centerR = Math.floor(rows / 2);
const centerC = Math.floor(cols / 2);
const initialBody: SnakeBody = [
{ r: centerR, c: centerC },
{ r: centerR + 1, c: centerC },
{ r: centerR + 2, c: centerC },
{ r: centerR + 3, c: centerC },
{ r: centerR + 4, c: centerC },
{ r: centerR + 5, c: centerC },
];
setSnakeBody(initialBody);
snakeBodyRef.current = initialBody;
+11 -8
View File
@@ -15,14 +15,17 @@ export function useSnake(
const lastMovedDirectionRef = useRef<Direction>("up");
const initSnake = () => {
const centerR = Math.floor(rows / 2);
const centerC = Math.floor(cols / 2);
const initialBody: SnakeBody = [
{ r: centerR, c: centerC },
{ r: centerR + 1, c: centerC },
{ r: centerR + 2, c: centerC },
];
const centerR = Math.floor(rows / 2);
const centerC = Math.floor(cols / 2);
const initialBody: SnakeBody = [
{ r: centerR, c: centerC },
{ r: centerR + 1, c: centerC },
{ r: centerR + 2, c: centerC },
{ r: centerR + 3, c: centerC },
{ r: centerR + 4, c: centerC },
{ r: centerR + 5, c: centerC },
];
setSnakeBody(initialBody);
snakeBodyRef.current = initialBody;