In Episode 3 we brought the UI to life with animated overlays and a popping score. It was our first step into polish and player feedback. In this episode we carry that momentum forward by giving physicality to failure: when a block is placed imperfectly, the overhanging part now falls, spins and disappears from view. We also improve the feel of the game by replacing the rigid camera jump with a smooth lerped transition that follows the growing tower naturally. The game now reacts and that makes all the difference.
What We Covered
- Introduced the
FallingBlockstruct - Spawned falling blocks when placement isn’t perfect
- Added spin and velocity to falling blocks
- Replaced camera snapping with smooth lerp-based motion
Design Insights
Giving Weight to Imperfection
Previously, when you missed part of a block, it just disappeared. Now that it falls and spins, the player gets a satisfying visual response and the tower feels more alive.
This small touch reinforces:
- The consequence of imperfect timing
- A sense of physics in an otherwise clean-cut game
Smooth Camera = Instant Polish
Hard-snapping the camera to new heights looked jumpy. With this change:
camera->position.y = ;
…it feels like the camera follows the stack gently. It is a one line change with a massive payoff in presentation.
Implementation Highlights
FallingBlock Struct
We added a dedicated struct to handle active falling pieces:
typedef struct FallingBlock;
On Block Placement
If the block isn’t perfectly aligned, we calculate the chopped portion, spawn a FallingBlock and push it to a dynamic array.
Physics Simulation
Each frame:
- The falling block rotates using
rotationSpeed - Moves down with
velocity - Gets culled when it drops too far
block->rotation.y += block->rotationSpeed.y * dt;
block->position.y += block->velocity.y * dt;
Smooth Camera Movement
Instead of this:
camera->position.y = 50 + 2 * blockCount;
We now use:
camera->position.y = ;
This gives the camera a smooth natural feel as the stack grows.
What’s Next?
In Episode 5 we’ll keep building on the polish:
- Introduce shaders to stylize the world
- Add realtime lighting and shadows
We’re now well past the prototype phase. The game is becoming fun to watch and play.
Project Code
You will find the complete source code here: tower-blocks