Catalog · How the catalog works
delphi-breakout
My very first "game" written in Delphi
- ★ 1 on GitHub
Anyone may press Interesting, signed in or not. It helps others find this project.
README
Delphi Blocks
A Breakout inspired by the Arkanoid I played on a 386XT, originally written in Delphi around 2009–2010. Today, it also serves as a study project for developers building a 2D game engine and learning what happens between player input, simulation, and drawing a frame.

The current refactoring preserves the game's visual identity while moving its rules into code that can be studied and tested without opening a window. Rendering uses the VCL Canvas and a persistent bitmap for frame composition.
Download the Windows executables and offline documentation from release 1.0.1.0. See the release notes for changes and validation.
Learn how the engine works
Online documentation · Browse the API
Start with the study guide. It connects the mathematics to the units, methods, and tests implementing each technique.
| Topic | Read |
|---|---|
| Responsibilities, states, clocks, and a 120 Hz fixed step | Architecture and loop |
| Trajectory, paddle angle, circles, capsules, and continuous collision | Physics and collisions |
| Canvas, buffering, sprites, layers, scaling, and FPS calculation | Rendering and measurement |
| Animated score, fading, deterministic tests, and experiments | Presentation and validation |
| Finite maps, explicit transitions, and capped difficulty | Levels and progression |
| Classes, functions, parameters, units, and ownership contracts | PasDoc API reference |
The HTML reference is generated from {** ... } comments in the Pascal interfaces. Use GitHub Pages for online browsing, or open docs/api/index.html locally after cloning. The PasDoc instructions explain generation; publishing instructions describe the site. Pages publishes the checked-in files after they are merged into main.
Build and play
The validated environment is Delphi 13 Community Edition, Windows, VCL, targeting Win32 and Win64. There is no external physics or rendering library. PasDoc is an optional documentation tool and does not participate in the game build.
- Open
DelphiBlocks.groupprojin the IDE. - In Projects, activate
Breakout.exe, select the platform/configuration, and choose Build. - Run from the IDE. Game executables go to
build/<Platform>/<Config>/(for examplebuild/Win64/Release/); sprites are embedded in the executable.
The group also contains BaselineRunner.exe for VCL checks and measurements, and Breakout.Tests.exe for tests without a UI. All three executables use build/<Platform>/<Config>/; DCUs are additionally separated by project. See the engine tests, VCL runner, and build consolidation. Builds in this Community Edition installation were performed through the IDE. The repository and executable retain the Breakout names; the application title is Delphi Blocks.
| Input | Action |
|---|---|
| Mouse movement | Move the paddle center, clamped to the field boundaries. |
| Left click or Space | Launch in Ready; after level completion, load the next board in Ready, then launch with another click/Space. |
| F2 | Restart the match, score, and effects. |
| F3 | Pause or resume. |
| F10 | Show or hide diagnostics. |
| F1, with diagnostics open and the game paused | Advance physics, brick fading, and score counting by one 1/120 s step; move the mouse to reposition the paddle between steps. |
The game opens maximized, with a native border and title bar. While playing in the foreground, the cursor is hidden and confined to the displayed field, excluding black margins. Press F3 to pause and release it before using the window borders/buttons or another application. Resuming confines it again. Ready, paused, completed, and inactive windows leave the cursor free and visible. Losing application focus pauses the match; return and press F3 to resume. Fullscreen and borderless fullscreen are planned after the initial menu.
Techniques already implemented
- An engine independent of VCL, with commands, explicit states, snapshots, and seeded generation.
- A fixed-step accumulator with bounded catch-up and discarded-time diagnostics.
- Continuous circle collision against block faces and corners; a capsule-shaped paddle.
- Paddle rebound proportional to the impact location, preserving speed magnitude.
- Canvas composition, cached sprites, transparency, and a HUD drawn above the field.
- A three-part paddle with a stretchable center for a future size powerup.
- Immediate gameplay scoring and a visual counter at 200 points/s; block fading over 250 ms.
- Seeded class balance by formation height: cheaper blocks are more likely below; silver/gold are more likely above and never occupy side-neighboring cells. Diagonals are allowed.
- A finite three-level campaign: the legacy grid, twin gates, and diamond; lives/score carry over, and the HUD identifies the current level.
- Initial speeds of 240 / 252 / 264.6 units/s: 5% compounded per level, capped by configuration at 300 units/s.
- Tests that control elapsed time and measurements that distinguish simulation, callbacks, and painting.
The current implementation includes E6 consolidation of the evolution plan: separate build outputs, consistent project settings, and named HUD layout. See E6 results, progression results, and VCL checks. Marcos accepted E6 after completing the manual route and confirming both diagnostic fixes. E7 adds native resizing/maximize with a centered proportional field and the original size as its minimum; see E7 results and the manual checklist. Marcos accepted E7 and authorized its squash merge on 2026-10-23. Menus, fullscreen, template-based levels, powerups, and an OpenGL comparison are planned. The E4 results retain the rendering measurements and their limits. The published 1.0.1.0 binaries above precede E5; build this branch to try the campaign.
From a USB backup to a study project
This was my first “game” in Delphi. Its original code comes from the beginning of my learning journey and does not represent my current development practices. I published it to move beyond keeping everything on a USB drive. The current refactoring retains that history and documents techniques added later.
The idea of publishing came after showing the project to @eimigueloliveir, who encouraged me to share it. My first contact with Delphi came from a PDF shared by @davidferreirafz in 2008 and from lessons at work.
The goal is to learn, experiment, and exchange knowledge. Improvements and questions are welcome through PRs and Discussions. More about me: Marcos Rocha.
The code is distributed under the MIT license. Arkanoid is acknowledged as the project's inspiration, without affiliation with its creators.

