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 once | Points |
|---|---|
| 1 | 50 × (level + 1) |
| 2 | 150 × (level + 1) |
| 3 | 400 × (level + 1) |
| 4 | 1000 × (level + 1) |
Controls
Keyboard, on computers and in desktop browsers:
| Key | Action |
|---|---|
| Left / Right, A / D | Move |
| Down, S | Soft drop |
| Space, Up, W, X, Z | Rotate |
| Enter | Pause / resume |
| Escape | Back to the menu. The game can be resumed |
| Alt+Enter | Toggle fullscreen |
| Up / Down, Enter / Space | Menu navigation |
Touch, on phones, tablets, and mobile browsers. There are no on-screen buttons:
| Gesture | Action |
|---|---|
| Drag sideways | Move. The piece follows the finger one column per cell |
| Drag down | Soft drop |
| Flick down | Hard drop |
| Tap | Rotate |
| Two-finger tap | Back to the menu. The game can be resumed |
| Swipe up / down, tap | Menu navigation and select |
Where to play
- Browser: play it here. Nothing to install.
- iPhone: on the App Store. iOS 15 or later.
- Android: install the APK from the latest release. It is not on Google Play.
- Windows, macOS, Linux: download the archive for your system from the latest release.
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.