diff --git a/src/features/home/HomePage.tsx b/src/features/home/HomePage.tsx index dd9dd42..dd544ba 100644 --- a/src/features/home/HomePage.tsx +++ b/src/features/home/HomePage.tsx @@ -7,8 +7,8 @@ const SnakeGame = lazy(() => export function HomePage() { return (
-
-
+
+

@@ -44,7 +44,7 @@ export function HomePage() {

-
+
}> diff --git a/src/features/snake-game/SnakeGame.tsx b/src/features/snake-game/SnakeGame.tsx index 3e6d657..049c9b5 100644 --- a/src/features/snake-game/SnakeGame.tsx +++ b/src/features/snake-game/SnakeGame.tsx @@ -12,6 +12,7 @@ import { GameTabs } from './components/GameTabs'; import { HighScoreBadge } from './components/HighScoreBadge'; import { Countdown } from './components/Countdown'; import { PauseOverlay } from './components/PauseOverlay'; +import { FoodLegend } from './components/FoodLegend'; import { useSwipe } from './hooks/useSwipe'; interface SnakeGameProps { @@ -53,7 +54,7 @@ export function SnakeGame({ className = '' }: SnakeGameProps) { return (
-
+
-
-
- - -
- +
+ + +
); diff --git a/src/features/snake-game/components/FoodLegend.tsx b/src/features/snake-game/components/FoodLegend.tsx new file mode 100644 index 0000000..71512c7 --- /dev/null +++ b/src/features/snake-game/components/FoodLegend.tsx @@ -0,0 +1,23 @@ +import { memo } from 'react'; +import { FOOD_TYPES } from '../constants'; +import type { FoodType } from '../types'; + +const ORDER: FoodType[] = ['function', 'class', 'async']; + +export const FoodLegend = memo(function FoodLegend() { + return ( +
+

// comidas

+ {ORDER.map((type) => { + const { points, color, label } = FOOD_TYPES[type]; + return ( +
+ + {label} + +{points} +
+ ); + })} +
+ ); +}); diff --git a/src/features/snake-game/components/GameCanvas.tsx b/src/features/snake-game/components/GameCanvas.tsx index 2018120..353a58c 100644 --- a/src/features/snake-game/components/GameCanvas.tsx +++ b/src/features/snake-game/components/GameCanvas.tsx @@ -86,8 +86,8 @@ export const GameCanvas = memo(function GameCanvas({ food, gridSize, particles, }, [gridSize]); return ( -
-
+
+
-

- // use teclado ou swipe +

+

+ // teclado ou swipe

-
+