Now let me build the game. I'll create the main game component with canvas rendering, plus UI overlays for HUD, level-up cards, and shop.
Now the main game engine. This will handle the game loop, rendering, spawning, collisions, input.
Now the renderer with pixel-art style:
Now the main App component with UI, HUD, level-up cards, shop, and controls:
Now let's build to check for errors:
Build succeeds. Let me review a few subtle issues I want to address:
- The
damage from bear (8) with only 20 HP means only 2-3 hits kill you—that feels okay but early game the player might get hit before shooting. Balance is fine.
- The HUD tick throttle uses
lastTRef.current - 1 which is a bit off but works.
- Shop button showing during levelup - it's inside the HUD conditional so only shows during playing/levelup/paused. During levelup you could click Shop, which would take you out. Let me hide it during levelup.
- The "cannot move only rotate" is respected — player stays at (0,0).
Let me fix a few small issues to polish:
Let me fix the shop to reflect coin balance immediately after purchase (HUD is throttled):
Build passes. Here's what I created — Pixel Beast Hunter, a top-down pixel-art animal battle game:
🎮 Gameplay
- Player fixed at center of a circular forest arena — you can only rotate/aim, not move
- 20 HP starting health with damage flash & screen shake feedback
- Auto-firing gun aimed by mouse (desktop) or touch (mobile)
- Animals (boar, snake, wolf, bird, bear) spawn from all directions and rush the player
- Killed enemies drop XP and coins
🌲 Map
- Fully generated pixel-art forest: grass tiles with random shading & flowers
- Trees scattered throughout with a dense border creating natural forest edge
- Clearing/dirt patch under the player
- Depth-sorted rendering so enemies pass behind/in-front of trees naturally
📈 Progression
- Level up system with XP bar — every level up pauses the game and shows 3 buff cards (Common/Rare/Epic rarities)
- 12 different buff cards: damage, fire rate, bullet speed, HP, regen, pierce, multishot, focus, XP boost, coin boost, etc.
- Wave system — waves escalate every 25s, spawning more/tougher enemies
- Shop with 6 guns (Pistol, SMG, Shotgun, Rifle, Minigun, Cannon) buyable with coins
🖥️📱 Cross-platform
- Uses a virtual pixel canvas (360×360) scaled up with
image-rendering: pixelated for crisp pixel art at any size
- Responsive UI, touch-optimized (no scrolling/zoom on mobile)
- ESC/P to pause on desktop, tap 🛒 or ❚❚ buttons on mobile
Files built: index.html, src/game/types.ts, src/game/data.ts, src/game/engine.ts, src/game/render.ts, src/App.tsx