
Switching the camera mode on the fly
Something bugged me for days without me being able to name it. The game worked, the world looked nice, walking felt fine. But watching my character stroll through the map felt stiff, like the whole scene was welded to him.
The culprit was the camera. Up to that point it did exactly one thing: sit dead center on the player, always. Every step moved the entire world by the same amount. Technically correct, visually lifeless.
So the real task was never “find the one perfect camera”. It was building a proper camera mode switch, so I could run the exact same world through two different behaviors and compare them honestly.
Mode one: following
The classic approach. The camera locks onto the character and follows him everywhere, pixel by pixel. Jumping? The world jumps with you. Walking left? The world slides right.
This is the mode every tutorial implements first, and for good reason. It is simple, it is predictable, and it guarantees the player is always visible. For tight platforming sections it is honestly great.
But in a building game like Buildom it has a downside I did not expect: the constant motion. Every step shakes the whole terrain, and when you place blocks at the edge of the screen, the view keeps drifting away from under your cursor. Placing a row of dirt blocks felt like writing on a moving conveyor belt.
Mode two: fixed, with room to breathe
So I flipped the idea. The camera stays put, and the player gets to walk around inside the screen. Only when he gets close to the left or right edge, about 20% away from it, does the camera start following and push the world along.
The difference is hard to overstate. Small movements no longer shake the whole world. Building at the screen edge finally feels stable, because the view only moves when it really has to. It is the same trick games like Terraria use, and now I understand why.
One button, both modes
Here is where it got fun. Instead of hiding one mode in a settings menu, both live right next to the zoom controls in the corner of the screen. The small view button between plus and minus switches between them while you play, no pause, no menu.
The button itself tells you what it will do. When the view drifted away, say after zooming or panning, it shows a reset icon: one click snaps the camera back to the character and zoom to 100%. Once you are centered, it turns into a lock. One more click hard-locks the camera centered on the player, which is the old following mode for anyone who misses the constant motion. Another click releases the lock again and the camera gets its freedom back.
Under the hood this is just one flag the HUD flips and the camera loop reads, with all the thresholds sitting in one small config object. But being able to switch mid-game changed how I judge both modes. Precision platforming? Lock it. Building session? Release it. The mode is a tool now, not a setting I commit to.
Small detail, big feel
This was one of those changes where the code took twenty minutes and the decision took two days of staring at both versions side by side. Following mode wins for precision, fixed mode wins for calm. Being able to flip between them in one click is what finally made me stop arguing with myself. The free-roaming one ships as the default.
Next up: making the water in the caves actually look like water instead of blue jelly. Follow along if you want to see where this goes.