SlideBlock

A Color-Block Sliding Puzzle — Unity Template

Version 1.0 | Unity 6+ | URP

🌟 This asset was made with the HyperCasual Game Engine!   Check it out — mobile puzzle templates & more. Click here to learn more ➔

Important: Template / Starting Point

SlideBlock is designed as a template and starting point for your own game. It ships with the core systems, architecture, and tools needed to build a color-block sliding puzzle — gameplay, a visual level editor, an automatic level generator, a 500-level starter pack, mystery blocks, and three boosters. You are expected to customize, extend, and re-skin it to create your unique game. This is a foundation for developers to build on, not a finished, ready-to-publish product.

Overview

SlideBlock is a one-tap color-matching puzzle. Colored blocks queue up on a row of posts at the bottom of the screen (the “shooters”). The player taps a shooter to slide it up into its column; when a block lands against blocks of the same color, the connected group clears. Clear the board before the columns jam to win. The game ships with a difficulty curve that grows the board from 3 to 5 columns and the palette from 3 to 5 colors, gravity-settled level layouts, hidden “mystery” shooters and obstacles, a disco wildcard, three boosters, a visual level editor, an automatic level generator, and 500 ready-made JSON levels.

One-Tap Color Matching

Tap a shooter on a post and it slides up its column. When it meets a same-colored block, the whole connected group flood-fill clears with a particle burst. Simple to learn, satisfying to chain.

Growing Board (3–5 Columns)

Early levels use 3 columns; the board widens to 4 and then 5 as the player progresses. The grid, tray walls, and posts all re-center automatically to the active column count.

Five Colors + Disco Wildcard

Pink, Yellow, Blue, Green and Purple, plus a disco wildcard that can be cleared by any color and detonates a big chain. The active palette grows from 3 to 5 colors with difficulty.

Mystery Shooters & Obstacles

Mystery shooters spawn with their color hidden under a “?” and only become draggable once the rest of the batch is fired. Mystery obstacles stay hidden and indestructible until gravity drops them to the bottom row — then they reveal with a pop and color transition.

Gravity-Settled Levels

Pre-placed obstacles are generated as if gravity already ran: every column is a contiguous bottom-up stack with no floating gaps. The board reads as a complete, settled tray from the very first frame.

Three Boosters

Shuffle Obstacles (the board visibly reshuffles), Disco (explode obstacles and pop disco wildcards in their place), and Rainbow Shooter (turn a shooter into a color-cycling cube that clears any color).

Visual Level Editor

A Unity Editor window for hand-authoring levels: paint colored obstacles (and mystery obstacles) onto the grid, set per-column shooter queues, and tick individual queue blocks as mystery shooters.

Auto Level Generator

Batch-generate levels with a built-in difficulty curve: column count, palette size, queue length, stack height, wildcard density and mystery frequency all scale with the level number. Append-only and one-click clearable.

JSON Levels + Starter Pack

500 levels ship as plain JSON under Resources/Levels/. Regenerate or extend any time with the Auto Level Generator.

Getting Started

Requirements

Installation

  1. Import the SlideBlock package into your Unity project.
  2. Ensure the project uses the Universal Render Pipeline (Edit > Project Settings > Graphics).
  3. Open the game scene at Assets/SlideBlock/Scenes/GameNew.unity.
  4. Press Play to test the first level. To author or batch-create levels, use Tools > SlideBlock > Level Editor or Tools > SlideBlock > Auto Level Generator.

Quick Test

In Play mode, tap the front block on any post. It slides up its column and snaps to the landing row. If it touches a connected group of its own color, that group clears and the blocks above settle down under gravity. Clear the board to advance; the next level loads automatically. If a column fills with no possible match, the lose panel appears.

Folder Structure

Everything ships under a single root folder, Assets/SlideBlock/, for clean import and removal.

SlideBlock/ │ ├── Audio/ — Sound effects (tap, place, match, blocked, pops, win, fail) │ ├── Datas/ — ColorData (TypeColor → material) + sample LevelData asset │ ├── Documentation/ — This documentation file │ ├── Editor/ │ ├── LevelEditorWindow.cs — Visual level designer (paint obstacles, queues, mystery) │ ├── LevelGeneratorWindow.cs — Automatic batch level generator + difficulty curve │ ├── SlideBlockWelcomePopup.cs — Welcome popup │ └── InputSystemCheck.cs — Warns if Active Input Handling is not Both │ ├── Materials/ — Block colors (pink/yellow/blue/green/purple), tile, wall, arrow, FX │ ├── Models/ — Source 3D meshes (Cubes.fbx, ground.fbx, rounded-corner.fbx) │ ├── PostProcessing/ — HC post-processing volume profile │ ├── Prefabs/ — Block, Pedestal, Arrow, Trail, Particle_Boom, LoseWinPanel + UI panels (GameHUD_Panel, GameOverPanel, LevelClearedPanel, BoosterManager, Popup_Powerup_Picker) │ ├── Resources/ │ └── Levels/ — 500 JSON levels (Level_1.json, Level_2.json, …) │ ├── Scenes/ │ └── GameNew.unity — Main game scene (single playable scene) │ ├── Scripts/ — All runtime scripts (namespace: SlideBlock / SlideBlock.Scripts) │ ├── GameLevel.cs — Board, shooters, matching, gravity, boosters, mystery │ ├── Block.cs — Block entity (color, renderers, CanTap, mystery, rainbow) │ ├── LevelData.cs — Level model + TypeColor enum │ ├── ColorData.cs — TypeColor → Material lookup │ ├── InputManager.cs — Touch / mouse drag handling │ ├── LevelManager.cs — JSON loader + level progression │ ├── SlideBlockGameManager.cs — Scene orchestrator, win/lose, boosters │ ├── SoundManager.cs — SFX one-shots + variant pools │ ├── CameraSwitcher.cs — Camera helper │ ├── BoosterManager.cs — HUD booster row (shuffle / disco / rainbow) │ └── LoseWinPanelManager.cs — Win / lose panels (+ DeveloperSettings, …) │ └── Textures/ — Booster icons, HUD art, disco-ball & triangle sprites

Gameplay

Core Loop

The board has a row of posts (3–5, depending on the level). Each post holds a queue of colored blocks; the front one is the active shooter. Tapping a shooter slides it up into its column toward the landing row. When the shooter meets a connected group of its own color, a flood-fill clear removes the whole group with a particle burst, and the blocks above settle down under gravity to fill the gaps. Posts keep refilling with fresh shooters, so you never run out of ammo — the level is a race to clear N cubes before a column jams.

Block Colors

Five real colors plus the disco wildcard, defined in TypeColor (LevelData.cs) and mapped to materials in ColorData.asset. The active palette grows from 3 to 5 colors with difficulty (the wildcard is in addition).

TypeColorColorApprox. RGB
Pink Pink(1.00, 0.33, 0.81)
Yellow Yellow(1.00, 0.88, 0.30)
Blue Blue(0.20, 0.47, 0.95)
Green Green(0.30, 0.79, 0.35)
Purple Purple(0.61, 0.35, 0.89)
Color Disco wildcardsprite-rendered (no fixed color)

Note: Color is the wildcard and must always remain the last entry of the enum — code uses (int)TypeColor.Color as the count of real colors. Every real color a level uses needs a material entry in ColorData.

The Disco Wildcard

A disco block (TypeColor.Color, rendered via its sprite) sits in the grid like any obstacle but can be cleared by a shooter of any color. When a shooter lands against a disco at the foot of its column, ClearAllBlockMappingTypeColor shakes and detonates every block of the shooter's color plus every disco on the board — one move can clear a large part of the grid. The cascade plays a layered burst of pop SFX so the size of the clear is audible.

Mystery Blocks

Mystery blocks hide their color behind a grey tint and a floating “?” label, and reveal with a pop + grey→color transition. They come in two flavours, both authorable in the editor and generated on a difficulty curve (rare on early levels).

Mystery Shooter

Mystery Obstacle

Both use a reveal animation driven by a MaterialPropertyBlock color lerp and an ease-out-back scale pop. An optional mysteryMaterial on GameLevel overrides the default grey look.

Scripts Reference

Runtime scripts use the SlideBlock / SlideBlock.Scripts namespaces. Editor tools use SlideBlock.EditorTools. Shared engine helpers (SoundManager, LevelManager, BoosterManager, LoseWinPanelManager) live under HypercasualGameEngine.

Core Scripts

ScriptDescription
GameLevel.csThe heart of the game: builds the board from LevelData, spawns shooters and obstacles, handles tap-to-fire, flood-fill matching, gravity refill, the disco cascade, mystery reveal, the adaptive tray walls, and the booster effects.
Block.csA single block: typeColor, mesh/sprite renderers, CanTap, isMystery, isRainbow, and a hide-above-Z visibility mask for blocks spawned above the tray.
LevelData.csThe level model (grid size, colorCount, per-column queues with mystery flags, pre-placed grid obstacles with mystery flags, booster counts) and the TypeColor enum.
ColorData.csScriptableObject mapping each TypeColor to a material.
InputManager.csTouch / mouse drag handling; routes taps on locked mystery shooters to the wiggle feedback.
LevelManager.csStatic JSON level loader and progression (current index, advance, reload). Loads from Resources/Levels/.
SlideBlockGameManager.csScene orchestrator: win/lose routing and the three booster entry points.
SoundManager.csSFX one-shots plus random variant pools (pops, success, fail, switch).

Editor Scripts

ScriptDescription
LevelEditorWindow.csTools > SlideBlock > Level Editor — paint colored / mystery obstacles, edit per-column queues, tick mystery shooters.
LevelGeneratorWindow.csTools > SlideBlock > Auto Level Generator — batch generation with the full difficulty curve.
SlideBlockWelcomePopup.csTools > SlideBlock > Welcome — welcome / review popup.

Visual Level Editor

Open with Tools > SlideBlock > Level Editor. The editor lists every Level_*.json and lets you author them visually:

Changes are written straight back to the JSON. Keep the column count within the number of posts in the scene (see Customization).

Auto Level Generator

Open with Tools > SlideBlock > Auto Level Generator. It batch-creates levels with a built-in difficulty curve keyed off the absolute level number, so progression stays consistent in append mode. Everything below scales with the level:

Generation is append-only by default (never overwrites earlier levels); a danger-zone button deletes every Level_*.json in one click. The 500 starter levels were produced with this generator.

Boosters

Three boosters are wired to the HUD booster row (NewestDevUIBoosterManagerSlideBlockGameManager). Each carries a per-level charge count and unlocks at a configurable level.

BoosterEffect
Shuffle ObstaclesPhysically rearranges the visible obstacles — blocks keep their color and animate (with a hop) to a shuffled set of the same cells, so the board stays gravity-settled.
DiscoExplodes a fraction of the visible obstacles with colored particles, then pops a disco wildcard into each spot — primed for a big any-color chain.
Rainbow ShooterTurns one active shooter into a color-cycling rainbow cube. It is draggable immediately and, when fired, adopts the color of whatever it lands against — so it clears any color.

Booster counts and unlock levels are read from each level's data. In a development build you can refill / unlock everything for testing via the developer settings panel.

Customization

Colors

To add or recolor blocks, edit the materials under Materials/Color/ and the ColorData.asset mapping (one entry per TypeColor). If you add a new color to the TypeColor enum, keep Color (the wildcard) as the last entry, and bump the generator's color ramp.

Difficulty Curve

The ramps live as small, readable helpers at the top of LevelGeneratorWindow.cs (ColumnsForLevel, ColorsForLevel, the mystery-chance helpers) and as the per-level cases in MakeLevel. Adjust them and re-generate. The mystery chances and ramp length are also exposed as fields in the generator window.

Columns & the Scene

The number of playable columns is capped by the number of posts wired into GameLevel.columnParents in GameNew.unity. To support 5-column levels the scene must carry 5 posts; GameLevel re-centers and hides the active posts per level. The tray walls (w-left / w-right / w-up) auto-fit to the active column count.

Boosters & Audio

Booster effects live on SlideBlockGameManager / GameLevel; rewire the three buttons in BoosterManager to taste. Assign SFX clips on the SoundManager component — in particular populate popClips so the disco cascade is audible.

Support

SlideBlock is a developer template. Before reaching out, please review this documentation and the inline comments in the scripts — the gameplay, generator, and booster systems are all commented.

Support & contact: ragendom@gmail.com
Questions, bug reports and feature requests are welcome — please include your Unity version and the steps to reproduce.

This asset was built with the HyperCasual Game Engine — check it out for more mobile puzzle templates and shared systems.