behavoirs to create generic code?

0 favourites
  • 2 posts
From the Asset Store
Template for a generic save / load system, fully documented in comments and video
  • One of the main reasons I stopped using the otherwise excellent C2 because I could not reuse code between lots of similar games.

    Having tried stencyl, they achieve something like this by putting the code (using their drag and drop code editor) into a new behavior, then you can save this behavior (and its code) for use in other projects. I have not looked at how they handle the behavior codes interface, i.e. if you can instantiate he behavior (and its code) with parameters, make calls to sub functions/methods etc.

    Is this possible in C2? I cant see a way of creating a new behavior (or other object) which has code behind it, but can be exported. I had no luck trying to export/import event sheets, even if all the dependent objects were duplicated in the new project.

    Another main reason for not using C2 is that you cant fire your own events. Stencyl has this feature (I am informed by my team).

    The final reason for not using C2 is that creating dialogues, settings editing page etc. is a lot of work (for HTML5 mobile browser target at least) requiring all clickable objects to monitor some very hairy state code which got too complex to maintain. Stencyl allows you to set a layer to be active and layers below inactive, so the sprites in the layers below don't get click events.   I know in C2 you can put events in a group and disable groups, but this doesnt work for our complex games with a lot of sprite buttons on a lot of different layers/event sheets (required for a casino game).

    As an aside, Haxe seems a great language - dont know if its been considered for C2.

    I still prefer C2, if only it could offer "enterprise" features (i.e. code reuse, fire your own events, dialogue handling etc). Adding functions was a big step towards this.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Oddly enough the plugin sdk behaves exactly like this.

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