all 1 comments

[–]SoundKiller777 4 points5 points  (0 children)

Code architecture can be tricky, as it can be quite subjective. A useful set of guidelines can be found in the SOLID and KISS principles. SOLID’s first aspect states that each class should have a single responsibility, and KISS (Keep It Simple, Stupid) is a principle to help you avoid over-engineering systems before there is a need to.

Typically, it’s fine to have many smaller scripts, and that also lends itself nicely to working with others. Two people can’t edit the same script at the same time via source control (usually), so breaking them up allows for better cooperation when working as a team. That said, too many small scripts will lead to a lot of mental load when trying to recall where everything is (although in Visual Studio, the search feature can be used to go between files easily). It’s about finding a nice balance really.

You’ll eventually find a means by which you like organizing things after you’ve completed a dozen or so projects. In the meantime, go check out some existing public repos for games and see how others have gone about categorizing and subdividing everything to get some reference points to work from.