Good practices to write maintainable applications in Godot?

Godot Version

4.2 stable

Question

TLDR: Need help to make a cleaner and more maintainable application in Godot

I’m writing a simple application in Godot, it’s a commission calculator.
image
Am I doing the right thing? Basically, I made these nodes, as you can see below, are called MuralArea, MuralMockup… etc. And whenever I click the next button or back, it makes the previous node invisible and the next node visible. And it works fine, their inputs are being retained through navigation.

My issue is how my script is being polluted in one script file. And I’m almost 100 lines, and I’m 1/8 done!

There must be a better way to do this? What I’m thinking is this:
image

But I’m not sure if this a good way, I’m not familiar enough with Godot. Please help!

Please someone guide me. Is there a better way to do this?


It’s a sore in my eyes. It gives me stroke every time.

Unique names will help, I use them a ton in UI; especially helpful when re-organizing like adding parent containers, with unique names I do not have to update code paths.

You are right about modularizing the children, attach scripts to make them emit signals for actions rather than handling three or four of their children signals.

1 Like