openblocks is a falling-block puzzle game. Move and rotate falling pieces to fill rows, which then clear.

openblocks is free, open source, and has no tracking.

How to play

Rules

  • Pieces fall one at a time into a playfield ten cells wide. There are seven piece shapes.
  • Move and rotate each piece before it lands. A full row clears.
  • The game ends when a new piece has no room to enter.
  • There is no hold, no ghost piece, and no wall kick. Rotation turns the piece in place through four fixed states.
  • The next piece is drawn at random. If it matches the previous piece, it is redrawn once.
  • The level goes up every ten lines. At level 0 a piece falls one row about every 0.8 seconds. Pieces fall faster at higher levels, and from level 25 on a piece falls one row every 1/60 of a second.
  • The score display stops at 999,999.

Scoring

Lines cleared at oncePoints
150 × (level + 1)
2150 × (level + 1)
3400 × (level + 1)
41000 × (level + 1)

Controls

Keyboard, on computers and in desktop browsers:

KeyAction
Left / Right, A / DMove
Down, SSoft drop
Space, Up, W, X, ZRotate
EnterPause / resume
EscapeBack to the menu. The game can be resumed
Alt+EnterToggle fullscreen
Up / Down, Enter / SpaceMenu navigation

Touch, on phones, tablets, and mobile browsers. There are no on-screen buttons:

GestureAction
Drag sidewaysMove. The piece follows the finger one column per cell
Drag downSoft drop
Flick downHard drop
TapRotate
Two-finger tapBack to the menu. The game can be resumed
Swipe up / down, tapMenu navigation and select

Where to play

Download openblocks on the App Store

Technical details

Source code: github.com/dannyheskett/openblocks, MIT license.

Code

  • Written in C.
  • The game logic is one platform-independent file, src/game.c. Every platform uses it unchanged. Unit tests cover it and need no window.
  • Drawing, input, and audio use raylib 6.0 on Windows, macOS, Linux, Android, and the web. iOS uses its own Metal and UIKit backend with no raylib.
  • Sound effects are synthesized at startup. The Nunito typeface is embedded in the binary. There are no asset files.
  • The browser version is the same C compiled to WebAssembly with Emscripten.

Layouts

There are two renderers. Each build uses one.

  • Landscape, on desktop: a 640×480 layout scaled to fit the window. Piece statistics on the left, the playfield in the middle, and lines, score, level, and next piece on the right.
  • Portrait, on iOS and Android: fitted to the screen. A title bar, then a band with score, lines, level, and next piece, then the playfield at the largest square cell that fits.

The web build includes both. It picks portrait on a touch screen (pointer: coarse) and landscape otherwise.

Recording

Desktop builds record the session to an H.264 MP4 file, one video frame per rendered frame, with no external tools. Turn on Record in the menu, or start with --record or --record <file>.mp4. Mobile and web builds do not include the recorder.

Builds and releases

Every push to main builds and publishes a release: Linux x86-64, macOS universal, Windows x64 and x86, an Android APK and App Bundle, an iOS .ipa, and the WebAssembly bundle. The .ipa is the App Store build and cannot be sideloaded. Build instructions are in the README.