Create objects on the fly via plugin?

0 favourites
  • 6 posts
From the Asset Store
Forget about default textbox restrictions, you can create sprites atop of the textbox
  • Hey everyone,

    We have about 5-6 games with the same HUD logic, same tooltip mechanism.. etc.

    Every time we do a change on one mechanism, it's mightmarish to update the rest of the games.

    I've been using Global layers for a while but it's not the ultimate solution since we have a lot of eventsheet activities.

    Is there a way to copy the same game logic (touch events, objects etc.) to a plugins? Kind of like an external module that

    you can include in every project. Then you'll only have to update the plugin and not every project, every time.

    Thanks

  • I would also love to do that. Ashley said that Construct 3 will have editor plugins. But for now, I guess we'll have to deal with some duplicate code in every project.

    To achieve the modularity that you described, we need the addon sdk to be able to create sprites and objects that have no definition in the project. Say for example that I need a tooltip, I will certainly need to create a sprite for the background or frame and a text object in my Construct 2 project, then I would need my addon to create these objects and display them correctly. But the need to create the objects in the Construct 2 editor completely defeats the purpose. So we need a more powerful and mature sdk.

    As someone who has developed games using pure javascript, C, C++ and C#, I completely understand that code repetition is a bad thing in many ways. However, I try to look at it from a positive perspective: it is an incentive to always improve your code with every new game that you make, and not be limited by an old game-specific plugin that you made ages ago.

  • It is better separating logic from whole gui module (like MVC model) to increase the reusing ability, so it needs lots of programming experience.

    Copy-paste objects to new project is more easier, imo.

  • Thanks for the answers guys. I really hope that In construct 3 they would implement a solution for this because in my opinion the copy-pasting goes against the DRY principle of programming.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • rexrainbow personally I think MVC is good enough for web/desktop applications that have a front end and a back end linked to a database but not for games, in games this separation is still there but in a more organic and complex way. Aside from that, we could have plugins dedicated to GUI and others dedicated to logic. This is where I agree with you: mixing both GUI and logic in the same plugin is a bad idea.

    Furthermore, some people, including OP and me, don't require a high level of reusability all the time. Sure we need plugins that are highly reusable but we also need others that contain some game-specific logic and GUI that we use often in our projects.

    In traditional programming, you have libraries and sdks that are highly reusable and independent from third party code, but you can still make your own libraries that rely on other code or on each other to make your development easier. I guess we want Construct to achieve a level of maturity similar to traditional programming languages to be a better development tool, I think Construct 3 will bring us closer to that goal.

  • Zed2100

    Agree, hope C3 will have "import capx" feature, to treat a capx file as a reuse-able module.

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