Skip to content

pieces: add basketball, a spinning and bouncing ball - #83

Merged
bas3line merged 3 commits into
bas3line:mainfrom
lizijing98:codex/basketball-piece
Nov 15, 2026
Merged

bas3line merged 3 commits into
bas3line:mainfrom
lizijing98:codex/basketball-piece

Conversation

@lizijing98

@lizijing98 lizijing98 commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Add basketball, a 64×32 monochrome piece in the objects category. It shows a close-up basketball with rotating seams, progressively lower bounces, and a brief pause before the next loop.

The basketball animation can be seen on the What is NCAA homepage.

Closes #82.

What changed

  • Added a self-contained basketball piece that draws the rotating seams and landing deformation directly into the character frames.
  • Exposed options for radius, gravity, launch speed, restitution, rest time, horizontal spread, vertical squash, and the shading ramp.
  • Added createBasketball(options) so SVG exports use the loop duration calculated for the configured piece.
  • Apply later option overrides over the defaults set by createBasketball().
  • Reject bounce and rest schedules longer than 30 seconds before SVG sampling.
  • Regenerated the piece indexes and catalog, and added basketball to the README.

How this was tested

  • Ran npm run check -- basketball and npm run check. All 242 pieces passed.
  • Ran npm run typecheck and npm run build.
  • Compared a full loop of default frames against the original implementation in both light and dark modes.
  • Checked that each option affects rendering, frames stay 64×32, and a configured SVG uses the matching loop duration.
  • Verified that mount-time overrides take effect and that an overlong schedule fails before SVG sampling.

A spinning and bouncing ASCII basketball

Risk and rollback

The change adds one piece and its catalog entries. It can be rolled back by removing src/pieces/basketball.ts, rerunning npm run gen, and removing the README entry.

@vercel

vercel Bot commented Nov 13, 2026

Copy link
Copy Markdown

@lizijing98 is attempting to deploy a commit to the Shubham Team on Vercel.

A member of the Team first needs to authorize it.

@greptile-apps

greptile-apps Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Make sure you do the changes Sensei

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge, with the previous SVG timing issue fixed.

Summary

Adds a configurable, 64×32 basketball animation and registers it in the library and catalog.

  • A new basketball piece spins, bounces lower, and pauses between loops.
  • Basketball SVGs follow the bounce schedule set by their options.

Reviews (4) · Last reviewed commit: "pieces: honor basketball SVG loop overri..." · Reviewed by Greptile

Comment thread src/pieces/basketball.ts Resolved
Comment thread src/pieces/basketball.ts Resolved
@lizijing98
lizijing98 force-pushed the codex/basketball-piece branch from 5a3e716 to 25a4fe1 Compare November 13, 2026 08:55
@lizijing98 lizijing98 changed the title Add a spinning, bouncing basketball piece pieces: add basketball, a spinning and bouncing ball Nov 13, 2026
The seams turn as the ball spins. It squashes on impact, bounces lower
each time, and rests briefly before the loop starts again. The radius,
bounce, squash, and shading ramp can be configured.
@lizijing98
lizijing98 force-pushed the codex/basketball-piece branch from 25a4fe1 to 279864d Compare November 13, 2026 08:57
Apply later option overrides on top of the configured defaults. Reject
bounce and rest schedules longer than 30 seconds before SVG sampling.
Comment thread src/pieces/basketball.ts Resolved
Compute the export duration from the same options used to render
frames. Preserve explicit SVG durations and test loop timing.
@vercel

vercel Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
ascii-rest Ready Ready Preview Nov 15, 2026 1:55am UTC

Request Review

@bas3line
bas3line merged commit 9ba5ab1 into bas3line:main Nov 15, 2026
2 of 3 checks passed
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.

Add a spinning, bouncing basketball piece

2 participants