A Block Blast clone built on Godot 4.7+, designed for PC desktop in landscape (1280×720). 8×8 grid + 37 block shapes + combo system + clear animations — intuitive drag-and-drop gameplay, strategic depth, easy to pick up but hard to master.
The entire project is built purely in code: main.tscn only holds the root node + script reference. The board, slots, score, buttons, and dialogs are all constructed in code by main.gd; block groups (cells + drag Button) are code-generated and triggered by the slot_filled signal. Read the .gd files and you understand everything.
.tscn / .tres resource dependenciesload() / preload() via res:// paths, no export variable injectionview_config.gd, ready to converge into constant tablesFollowing the same Logic-View separation as Block Fall and Godot 2048 — replacing the common MVC pattern:
| Layer | Responsibility | Key Files |
|---|---|---|
| logic/ | Pure game logic. Game extends RefCounted, no scene-tree dependency, unit-testable. Grid / Piece / Shapes are pure data classes. SaveData handles leaderboard persistence. |
game.gd grid.gd piece.gd shapes.gd save_data.gd |
| view/ | Pure rendering + drag interaction. Read-only access to Logic state; intents call Game methods one-way, never write logic state directly. |
board_view.gd block_group.gd scores_view.gd clear_animation.gd retry_confirm_view.gd |
| main.gd | Thin coordinator. Builds UI → creates Game → injects into Views → wires Logic ↔ View signals → plays sound effects. | — |
Key insight: Game extends RefCounted instead of Node, so the logic layer can be unit-tested without a scene tree — Game.new() is all you need, no Godot runtime required.
The project ships with a lightweight test framework (no plugin dependencies), two tiers:
tests/test_*.gd) — covers piece placement, line clearing, scoring, combos, Game Over, and all other core rulestests/smoke_test.gd) — instantiates the real main scene and verifies the full flow (init, replenish, clear, combo, preview highlight, Retry, Scores, Game Over)Run them with:
godot --headless --path . --script res://tests/test_runner.gd # Unit tests
godot --headless --path . --script res://tests/smoke_test.gd # Smoke test
Tests automatically isolate the leaderboard save to user://test_scores.json, so they never pollute the player’s real save data.
retry_confirm_view.gd)tools/generate_block_blast_assets.py — one-click logo + splash screen generator| Action | Points |
|---|---|
| Place a block | +10 |
| Clear a line/column | +100 × Combo |
| Combo multiplier | Increases with consecutive clears |
Combo sound tiers: Good → Nice → Great → Amazing → Excellent → Incredible
block-blast-pc/
├── audio/ # Sound effects (.ogg)
│ ├── good.ogg # Combo sounds (6 tiers: Good → Incredible)
│ ├── nice.ogg / great.ogg / amazing.ogg
│ ├── excellent.ogg / incredible.ogg
│ ├── snap.ogg # Piece placement sound
│ └── fail.ogg # Game Over sound
├── logic/ # Game logic layer (Logic)
│ ├── game.gd # Game: per-run state + all rules (RefCounted pure logic)
│ ├── grid.gd # 8×8 board data + line clear detection
│ ├── piece.gd # Block shape data + placement validation
│ ├── shapes.gd # 37 block shape constants
│ └── save_data.gd # Leaderboard persistence (injectable path, test isolation)
├── view/ # Rendering layer (View)
│ ├── board_view.gd # Board rendering + drag state machine + clear animations
│ ├── block_group.gd # Input proxy for draggable block groups
│ ├── scores_view.gd # High score leaderboard UI
│ ├── clear_animation.gd # Line clear animation (8 colors × 15 frames)
│ ├── retry_confirm_view.gd # Restart confirmation dialog (PC-exclusive)
│ └── view_config.gd # Shared view config (cell size, color/texture mapping)
├── textures/ # Sprites and visual assets
│ ├── blocks1.png ~ blocks7.png # 7 colored block textures
│ ├── board.png # Board background
│ ├── sound_on.png / sound_off.png # Mute button icons
│ ├── clear_anim/ # Line clear animation frames (8 colors × 15 frames)
│ └── logo/ # Game logo assets
├── tools/ # Asset generation tools
│ └── generate_block_blast_assets.py # Logo + splash screen generator
├── tests/ # Tests (no plugin dependencies)
│ ├── test_runner.gd # Unit test runner
│ ├── smoke_test.gd # Smoke test
│ ├── test_base.gd # Test base class
│ └── test_game.gd # Game unit tests
├── docs/ # Project documentation
│ ├── intro.md # This document (Chinese)
│ └── intro_en.md # English introduction
├── main.gd # Main coordinator (LV thin layer: UI build + wiring + audio routing)
├── main.tscn # Main scene (root node + script reference only)
├── project.godot # Engine configuration
└── export_presets.cfg # Export preset configuration
godot --path .)export_presets.cfgpython3 tools/generate_block_blast_assets.py
This project uses a paid custom license. After purchase you may modify the code and ship derivative games, but you may not redistribute the source code or sell it commercially. See LICENSE_en.md (or LICENSE.md for Chinese) for the full terms.