nanopython  /  games

Games

Six classics, each written three ways against a small shared library (nanopy.py for Python, nanopy.js for JavaScript). Same game, same library shape, different writing style. See the comparison report for code-line counts and a verdict.

Pick a variant to play it. Each row is one game with three flavors:

Kid — Python, module-level functions, no classes or decorators Pro — Python, classes + @on_key decorators + Ticker JS — JavaScript, same library API, same writing style as the kid version

Snake

The classic. Eat the apple, grow longer, don't hit the walls or yourself.

Catch

Move the paddle to catch falling fruit. Three misses and you're out.

Breakout

Paddle, ball, brick wall. Break every brick to clear the level.

2048

Slide the tiles to merge equal pairs. Reach 2048 to win.

Tetris

Falling tetrominoes. Rotate, drop, clear lines, level up as you go.

Space Invaders

Marching aliens, dropping bombs, escalating waves.

Memory match

4×4 grid of color-pair cards. Click to flip, find all eight pairs. The first demo to use the new mouse + sound + collision-helper APIs in nanopy.py.

The un-refactored snake/ is also still here as the comparison reference — same game without the library. See the report for what changed.