Instruction file imported from jacoblontoc/solar-six-shooter (
.github/instructions/Space Cowboy.instructions.md). Copyright stays with the author.
Project Instructions: Solar Six-Shooter
Overview
A 2D Space Cowboy shooting gallery. This is a dual-device experience where a PC acts as the game screen and a smartphone acts as a motion-controlled controller.
Tech Stack (Strict)
- Frontend (PC): React with HTML5 Canvas (2D) or PixiJS.
- Frontend (Mobile): Vanilla JavaScript/Vite (Mobile Web).
- Backend: Node.js with Socket.io (for real-time communication).
- Communication: WebSockets only. No AI integrations in the game logic.
Core Mechanics
- Device Handshake: PC displays a Room ID; Mobile enters Room ID to pair via Socket.io.
- Motion Tracking: Mobile uses deviceorientation API (Alpha, Beta, Gamma) to track tilt.
- Aiming: Mobile streams tilt data to the Server -> Server relays to PC -> PC moves the crosshair.
- Firing: Mobile touchstart triggers a 'fire' event on the PC.
- 2D Gameplay: Enemies move across the 2D canvas. The PC handles collision detection between the crosshair and enemy hitboxes.
Constraints and Requirements
- Low Latency: Code must be optimized for sub-50ms response times.
- No AI: Do not suggest LLM, generative AI, or agentic features for the game itself.
- Mobile Web: Do not use Expo or Native code; stay within the mobile browser environment.
- Responsive: The 2D canvas should scale to the PC's window size.