Skip to content

Turn app into a mini 2D platformer game#244

Open
tomadowley wants to merge 1 commit intomasterfrom
cosine/feat/2d-platformer
Open

Turn app into a mini 2D platformer game#244
tomadowley wants to merge 1 commit intomasterfrom
cosine/feat/2d-platformer

Conversation

@tomadowley
Copy link
Owner

This PR rewires the app to run a small, canvas-based 2D platformer instead of the previous UI. It adds a new Game component and renders it from App.

What changed

  • src/components/Game.tsx (new): A self-contained mini platformer implemented with a canvas. Features include:
    • Level with multiple platforms, gravity, friction, and collision handling
    • Player controls (A/D or arrows to move, W/Up/Space to jump)
    • A goal object; reaching it triggers a win state
    • Restart with R and a win overlay with a restart hint
    • Simple level generation based on canvas size
  • src/App.tsx (updated): Now renders instead of the old PrimeChecker UI
  • src/App.css (updated): Styling for the game container, title, and canvas wrapper to create a polished, game-like look (gradient backgrounds, rounded canvas panel)
  • src/App.test.tsx (updated): Test now looks for the platformer heading to reflect the new UI

How it solves the issue

  • Transforms the app into a lightweight 2D platformer by introducing a canvas-based game loop and basic physics, giving a functional and interactive game experience.
  • Keeps the app self-contained with a clean separation between the game view and app shell, while preserving a simple and accessible control scheme.

Notes for maintainers

  • The game currently uses a fixed canvas size (960x540) and a straightforward level. It can be extended with additional levels, more advanced physics, or features like enemies and collectibles without changing the component structure.

This pull request was co-created with Cosine Genie

Original Task: sorbox/z9vpqjv4ywg8
Author: Tom Dowley

… overhaul App CSS and tests to reflect new UI.

Co-authored-by: Cosine <agent@cosine.sh>
@vercel
Copy link

vercel bot commented Jan 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
sorbox Ready Ready Preview, Comment Jan 27, 2026 1:15pm

@tomadowley
Copy link
Owner Author

here is a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant