Welcome to Episode 2 of the Tower Blocks series!
In this episode we move beyond a simple 3D scene and bring the core game loop to life. We add animated block movement, stacking logic and real gameplay decisions: when to place the block, how well it lands and what happens if you miss.
🎮 We cover:
Moving blocks that alternate between X and Z axes
Calculating overlaps and snapping on perfect placement
Handling player input to place blocks
Detecting misses to trigger game over
Basic UI overlays for Start and Game Over screens
By the end of this episode we have got a fully playable (but still minimalist) Tower Blocks prototype.
📺 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 Showcasing this series end result
00:57 Episode 1 recap
01:21 Episode 2 goals
01:45 Block Movement property
05:08 Currently moving Block
06:16 DrawCurrentBlock
07:50 Introducing GameState
09:21 CreateMovingBlock
12:11 Placeholder game start/over overlays
16:45 CreateMovingBlock: add movement
18:16 UpdateCurrentBlock
24:09 CreateMovingBlock: randomize axis and direction
26:32 PlaceBlock
36:39 CreateMovingBlock: change spawn location
39:04 CreateMovingBlock: increase movement speed for each new block
42:39 Restarting the game
43:36 Block colors
47:45 Plans for next episodes
49:29 CreateMovingBlock: detect perfect placement
#gamedev #coding #programming #raylib