Skip to content

[twotris] Complete rewrite: proper board, piece, scoring, effects, and UI modules - #393

Merged
gazure merged 1 commit into
mainfrom
ga/twotris-enhancements
Aug 1, 2026
Merged

[twotris] Complete rewrite: proper board, piece, scoring, effects, and UI modules#393
gazure merged 1 commit into
mainfrom
ga/twotris-enhancements

Conversation

@gazure

@gazure gazure commented Aug 1, 2026

Copy link
Copy Markdown
Owner

Twotris has been rewritten from a minimal proof-of-concept into a complete, playable game.

The old single-file components.rs / plugin.rs structure has been replaced with a proper module layout: piece.rs for shapes and the 7-bag randomiser, board.rs for the locked-cell playfield, game.rs for input/gravity/locking/scoring, render.rs for arena construction and per-frame drawing, ui.rs for the score bug, side panels, and full-screen overlays, effects.rs for confetti, lock flashes, score popups, and screen shake, and theme.rs for the palette and sizing constants.

Gameplay is now fully featured: DAS/ARR horizontal movement, soft and hard drop, hold, ghost piece, wall and floor kicks, a 0.5 s lock delay with up to 15 resets, guideline scoring (100/300/500/800 × level, combo bonuses, back-to-back tetris at 1.5×), and gravity that accelerates every 10 lines up to level 20. The unfocused board falls at half speed so neglecting it is punishing but not immediately fatal. Score, level, and lines are shared across both boards.

The renderer switches from event-driven redraw messages to a flat per-frame repaint, which eliminates the ghost-piece desync that plagued the old approach. The falling piece is never written into the board; it lives as an Active component and is composited at draw time so collision queries never have to reason about a piece hitting itself.

The window is given a fixed 1180 × 820 resolution, nearest-neighbour filtering for crisp block edges, an HDR render target, and a bloom pass. Piece colours are authored above 1.0 in linear space so they bloom into the surrounding darkness. The focused board's halo breathes; both boards tint toward red as they fill.

A title screen with drifting background tetrominoes, a pause overlay, and a game-over screen with best-score tracking round out the feature set. The README has been expanded with controls, rules, and a module map.

gazure commented Aug 1, 2026

Copy link
Copy Markdown
Owner Author

@gazure gazure mentioned this pull request Aug 1, 2026
@gazure
gazure merged commit 55b5d0a into main Aug 1, 2026
2 checks passed

gazure commented Aug 1, 2026

Copy link
Copy Markdown
Owner Author

Merge activity

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