Code Organization

0 favourites
  • 10 posts
From the Asset Store
Two levels with two sistem Wave. with Source-code (.c3p) + HTML5 Exported.
  • Hey Construct Community,

    Do you have any tips or methods to organizing your code?

    I use comments to separate each section, but my event sheet is getting quite large.

    Do the developers of Construct plan on adding a folder option to store multiple events and minimize for efficiency? I know MMF2 uses "Groups" to condense the code.


  • I usually have a "main" event sheet with no events. Then for each category of events (player controls, enemy AI, coins, etc.) I have a seperate event sheet which I include in the main one.

    Inside each event sheet I then have groups for each part of that category. So if I'm making a platform game, I'd have my main event sheet which includes the Controls event sheet. Then inside the Controls one, I have a group called general for simulating movement. I also have another group called Wall Jump for that.

    I find this to be the best way for me to organize my event sheets, and keeping it easy to find stuff.

  • umm... Construct 2 has groups! right-click the event sheet, and click 'add group'.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • EncryptedCow A lot of work, but I'm sure it's worth the effort to be very organized!

    sqiddster You are awesome, you just saved me many headaches. Didn't even see the groups option!

  • It might be a hassle to do that with already unorganized events. But starting something new, it's not much more effort to do it.

  • I like to use comments in other ways too. I use them to add notes and reminders, to mark temporary experiments that I might want to delete later, to remind me what variables are such as 1=yes or whatever. I might use them as a partial "to do" list so if I stop a project at night, I can come back to it and see what I was doing. I basically use them to help me keep a mental note of what each piece of code does so I can quickly scan things.

    The main goal with any project with lots of events is to make it as easy as possible to fix bugs or find what I need. It's hard enough fixing a bug in the first place. If it's buried somewhere, it can be even harder to fix.

  • Very valuable insight.

    I often write down my to-do lists, but writing them in comments will save me a lot of paper.

  • I just put everything in groups, which certainly helps organise my mind when I'm working on a specific aspect of a project. I rarely use comments but I probably should :P

  • The other benefit of using groups is that you can deactivate them in your logic which helps add more modular functionality. When I have behaviors or events that should not be able to run at the same time I disable the group they are in until they should be used again.

  • Didn't know you could disable whole groups. Construct 2 is most powerful indeed.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)