Falling Sand Game in TGA2D Engine
I attempted to create a falling sand game using the TGA2D engine. While it didn't go exactly as planned, I worked around challenges to deliver a functional result. I hope to improve on this project in my free time using a better-suited engine.
My Falling Sand Game
Reference: Falling sand game footage from YouTube
I created a falling sand game utilizing the TGA2D game engine. The architecture included a sand world to govern all aspects, a sand manager to oversee particle behavior, and IMGUI for the user interface. For rendering, I employed a sprite batch technique.
To optimize performance, I implemented a Grid system and threaded the sand manager. The UI at the bottom displays: current sand count, selected sand type, mouse position, sand type buttons with colors, a brush size slider, and a wall collider toggle to contain particles on screen.
I created a brush system supporting various sizes for efficient sand spawning. Additionally, I developed an image-to-sand converter that allows importing images via code or drag-and-drop, converting each pixel to the nearest sand type.
A key lesson: after encountering batch rendering difficulties in week two, I should have reassessed my approach. Instead, I persisted and lost valuable time. In hindsight, building a basic engine myself or choosing a better-documented engine would have been wiser.
Each Thursday was for debugging, and Friday I stepped back to adjust the plan — this didn't always hold.