omp packages

pi-mario-companion1.0.0

A pixel-art Mario who strolls across the Pi prompt box every so often, bumps a few blocks for coins, and walks off again

kylelavorato Published 6 days ago MIT ~0 downloads/mo

Untested on omp

This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.

Did it work for you?

Result

One report per person. A new report replaces your old one.

Reports 0

No reports yet.

Readme

Pi Mario Companion

A pixel-art Mario who strolls across the Pi prompt box every so often, bumps a few blocks for coins, jumps on the flagpole, walks off again, and sometimes gets fireworks.

Mario running across the prompt box, jumping at question blocks for coins

Install

pi install npm:pi-mario-companion

Every 5 to 30 minutes Mario drops three question blocks along the top edge of your prompt box, walks across, jumps at each one for a coin, and finishes by riding a flagpole down to the ground.

/mario-run          # play it now
/mario-run off      # stop the random trigger for this session
/mario-run on       # turn the random trigger back on

Testing

For testing, the command takes debug flags. You can pass any number of them, in any order:

Flag What it does
fast N Run the whole animation N times quicker. /mario-run fast 10 gets you to the ending in a few seconds.
fireworks N Force N fireworks at the end instead of leaving it to chance. N has to be 1, 3 or 6.

Non-Interrupting Companion

The Mario Companion is designed so it will never interrupt your Pi session. Everything draws over the live session and all normal Pi controls are available while it is running, including entering new prompts.

Sprites

The four walk poses, the jump, the slide pose, the flag and a firework

Everything is hand drawn as pixel grids in extensions/mario-companion/sprites.ts and rendered with half blocks, two pixels per terminal cell, in exact RGB that falls back to the nearest 256 colour index. Mario is 10 by 14 pixels, the blocks are 8 by 8, the coin is a 4 by 6 oval, the pole is a single green column with a ball on top, and the flag is a white pennant with the emblem in the pole's green, about two thirds of his height the way the original is.

Development

npm install
npm test
npm run typecheck

npm test runs four checks:

Check What it covers
check-sprites.ts The pixel grids and the rules above, plus the pole, the flag and the slide pose
check-render.ts Frames at eight terminal widths, text surviving under the band, and no style leaking into the padding the compositor adds
check-timing.ts 2000 random block layouts, the drop-in schedule, the pace of the walk cycle, the finish at the pole, and the firework counts and placement
check-extension.ts The command and session wiring, the random timer, and that a run never holds the prompt path open

Limitations

  • Needs the fullscreen TUI, which is Pi's default. In regular mode /mario-run says so and does nothing.
  • The animation needs about 40 columns: three blocks, the gaps between them, and the lane Mario runs and jumps in. Narrower than that and it does not run at all.

Publishing

npm login
npm whoami
npm run typecheck
npm test
npm pack --dry-run
npm publish