How do I Add my game logic in Javascript

0 favourites
  • 7 posts
From the Asset Store
100 items casual and logic games. All icons are of a high quality.
  • Hi,

    I'm in the phase of choosing Client GUI technology for my game, and I would like to check how to do few things in C2, for example:

    1. Is it possible to combine Javascript code in C2? let's say that at the beginning of the game I need C2 to connect to the game server and there is a JS library I need to use with sockets, protocols etc...

    2. Is it possible to call native iOS\Android functions? if YES - What does it take?

    3. How do I write game logic\state\data structures\objects in C2 ?

    Those questions are crucial for me to understand if I can choose C2 for my GUI Client.

    Thank you!

  • 1. Yes. If you add Browser plugin, you can use action Execute Javascript to execute your own javascript.

  • shvalb

    If it is crucial, then relying on others isn't really the best policy.

    I would recommend downloading the free version and just have a play around for a few days, making the odd prototype or two.

  • 1. yes with the sdk:

    https://www.scirra.com/manual/15/sdk

    2. I think so. Depending on the export method there is a plugin for it to access exposed api features of the exporter. Not all but you could perhaps modify the plugin to access more features of the api.

    3. Again with the sdk. You can use the Browser object's execJs action to run snippets of js too, but it's unconnected with the rest of C2 and can break after exporting due to minifying.

  • When working with a plugin, how easy it is to get data\results from javascript into C2 and vice-versa?

    my main needs from JS is for networking with server, i.e: passing\receiving messages and delegate results into C2.

    Will it be easier in C3? When C3 will be available?

  • When working with a plugin, how easy it is to get data\results from javascript into C2 and vice-versa?

    my main needs from JS is for networking with server, i.e: passing\receiving messages and delegate results into C2.

    Will it be easier in C3? When C3 will be available?

    Wouldn't using the Ajax-object work for you?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'm not truly familiar with Ajax-Object, but after brief reading it seems like it's Browser oriented mechanism.

    I need my game to interact with a server which implement a specific protocol. I need the game to manage a state, login to facebook etc...

    Am I missing something with Ajax-Object?

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