Tower Blocks in C and Raylib: Tower Collapse [Episode 6]

Опубликовано: 31 Август 2026
на канале: Let's Reinvent the Wheel
315
7

Welcome to Episode 6 of the Tower Blocks series!

In the last episode we introduced custom lighting shaders that gave our cubes real depth. This time we are focusing on what happens after you lose and making it look good.

In this episode, we:
🧱 Add a new `RESETTING_STATE` to the game loop
💥 Animate each block in the tower to shrink and rotate
⏱ Apply staggered delays to create a cascading collapse
🧹 Clean up the tower piece-by-piece before restarting

This means: no more instant restart. The game now reacts to game over with a smooth and satisfying tower collapse. It gives players a moment to breathe and adds visual polish that ties the whole loop together.

📺 Full Tower Blocks series playlist:    • Tower Blocks in C and Raylib  
📖 Companion Blog Post: https://letsreinventthewheel.github.i...
🧠 Source code: https://github.com/letsreinventthewhe...

💬 Got questions? Drop a comment.
👍 Like what you see? Hit the like button.
📌 Want more projects like this? Subscribe and stay tuned...

00:00 Episode's goals
00:44 Introducing new game state
03:48 ResetGame
08:02 StartTowerCollapse
10:12 Block's new Removal property
12:42 Finishing StartTowerCollapse
14:30 UpdatePlacedBlocks
20:55 Update DrawBlock to animate block removal

#gamedev #coding #programming #raylib #cprogramming