How to properly order my files

I have been using defold for a few weeks now, for a school project. I have a few weeks left to complete my project, and I am making good progress.

However, the layout of my game feels a bit rushed, there’s no real order to the game.

For example. look at this mess:

image

I’ve literally placed game objects inside a game object. What.

Or even this:

image

It’s wacky and chaotic. Any tips?

What strikes me here is that the enemy game object has a gui. What kind of gui is this? A hud with score and health bars etc?

Also, what is collectionfactory? I prefer to name my factories based on what they spawn, ie bulletfactory, enemyfactory or powerupfactory.

It’s not too bad is it? One thing which I try to be strict with is naming of files. You use both CamelCase and lowercase. Why not use one or the other?

Why is the pizzacollisions.script in the main folder when it seems to be used by enemies? Why not put that file in an enemies folder?

1 Like

To be honest I have no clue either. I think it was because ‘countdown.script’ needs to be able to change the a text node in gui, and if i put countdown in any other game object, the game wouldn’t work.

It’s tacky, but it gets the job done.

It’s too late to turn back, I must continue down this road of madness.

I don’t know, I just made a script and attached it to the game object and boom, i forgor about it.

Not really. You can right click the folder in Defold and change name and all references will be updated.

For me I do what makes sense to me and based on how complex the project is.

The nice thing about defold is for the most part you can just drag and drop stuff around and it still works.

I like to group like things together. Like I have a collections, scripts, GUI, proxies, factories,…folders for each type. Because when I think of editing something I say…it’s a script. So I go to script folder. Or I need to open the other collection…I go to collections folder.

Not really a tip on organizing files, but if your folder structure is already a mess and you have to finish the project as is, try using Ctrl+Shift+R :slight_smile:
But that requires that you know names of your files well, so naming consistency is a must. As was suggested, if you rename files inside Defold editor, the references will update.