C2 vs real programming

0 favourites
From the Asset Store
Scrollbars with FULL functionality and versatility, just like the ones you can find in AAA games!
  • Real programming? REAL programming?! <img src="smileys/smiley16.gif" border="0" align="middle">

    Haha - nice!

  • I really enjoy working with Construct now that I have had some time to invest in to it. I will be completely honest, without some essential plugins (rexrainbow's function plugin for example) I would personally have serious problems figuring how to accomplish some of the things I really want to accomplish, especially with a programmer thinking style background.

    In fact I am sure I have overcomplicated some things as I learn how to do them using the event system, but its what I enjoy doing. Do I think construct 2 might need a scripting option? no. Do I hope it keeps evolving and incorporating things like the function plugin (which should be part of the base event system IMO), absolutely! =)

    PS: A huge thank you to the people that work hard on the plugins.

  • The graphic designer with the huge love with game, without knowledge of programming, it's impossible. But with c2, everything now change...

  • accidentallyc As an answer to the 2nd question, you can in theory (although probably not officially supported) write most of the logic of your game using javascript by creating a plugin with the SDK. You can access most of C2's functionality from the javascript SDK so you could do a custom plugin just for your game that implements the part of you game you want to hand-code. So, yes, C2 does let you write code.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • ...you can in theory (although probably not officially supported) write most of the logic of your game using javascript by creating a plugin with the SDK...

    My understanding of this is that for third party plugins you intend to publish, you need to follow the rules set down by Scirra. This helps maintain consistency and prevents errors and bugs in later releases.

    For private plugins, there really aren't any restrictions as far as I can see. If you are not planning on publishing the plugin, you won't break anyone's project but your own.

    Building custom plugins for your private use (but for use in published games, obviously) is a great way to add coding to C2, in my opinion.

    If I am wrong, someone please correct me.

  • Meh, writing a plugin is far more complicated than just looking for a work around. I do agree with Twins that my thinking (being more used to programming) complicates things but hey, i do know that you can work around it xD

  • accidentallyc I guess I did not fully understand your second question. Writing plugins is not that complicated, especially if you were to write a plugin just for your game, for private use.

    Assuming you want some custom javascript code executing every game tick, your plugin could have just one C2 "action" defined in the edittime.js and then have that action be called from C2's every tick event. The runtime.js would be as complicated as you wanted to be. If it you just need a few lines of code then the JS function that gets called when the action is fired would have only a few lines of code. That code can access any C2 object instances and their behaviors and properties.

    If you want some custom code to be called when a certain event is fired, then instead of having your plugin action called on every tick, just call it when the the event is fired.

    Another way of "text editing" the C2 events is to open the event sheet files in a good text editor, but that is definitely not a supported (or good?) way of doing things and you have to be very careful (make backups!).

  • juantar thanks for the tip. I will delve into it when i find the need but so far simple work arounds can solve the problem. The newest update of construct 2 is quite good as well. Is it possible to change the first post tho? People might come and answer an already answered issue xD

    (completely unrelated: what in the world is prompt mode / basic mode at the edit message form? )

  • Meh, writing a plugin is far more complicated than just looking for a work around ...

    accidentallyc ... Writing plugins is not that complicated ...

    accidentallyc

    juantar is quite right. If you can handle the logic of gaming, then you shouldn't find writing plugins all that difficult - particularly if you start with my tutorial <img src="smileys/smiley2.gif" border="0" align="middle">

    And IMO it adds another level to the fun of Construct 2.

    (As for Prompt Mode/Basic Mode, try inserting a URL in your post in each mode and you'll see the difference.)

  • Real programming? REAL programming?! <img src="smileys/smiley16.gif" border="0" align="middle">

    It's funny you say that because I'm testing the waters of the great fearsome assembly ocean at this moment in time.

  • C2 is awesome, but coming from actionscript events based programming with large teams of developers, I find that these are my biggest challenges:

    1) no user defined events.

    E.g. there are about 20 places I want to say end the game for various different reasons and do a load of house keeping and display stuff, i.e.I want to raise an event called "gameEnded" with some parameters, and have one event handler defined. Importing event sheets goes part way to solving this, but is more like a "goto". Also, the concept of change listeners would be nice, so if say the score changed, this could trigger some actions.

    2) no way to re-use code. I re-type a lot of code in a lot of games which are all similar to each other. This is a bit of a maintenance nightmare - when I change the common "library" code, I will have to edit 30+ games, and retest them all in case I made the C2 equivalent of a typo. You dont seem to be able to cut and paste actions between projects, even if you call the objects the same names. I experimented with manually editing the event sheets in notepad++, but kept crashing C2 (not surprisingly).

    There is a function plugin someone wrote, but as a general rule we don't touch plugins if they are not part of the supported C2 product so may end up not being maintained, bug fixed or working with a release.

  • C2 is awesome, but coming from actionscript events based programming with large teams of developers, I find that these are my biggest challenges:

    1) no user defined events.

    E.g. there are about 20 places I want to say end the game for various different reasons and do a load of house keeping and display stuff, i.e.I want to raise an event called "gameEnded" with some parameters, and have one event handler defined. Importing event sheets goes part way to solving this, but is more like a "goto". Also, the concept of change listeners would be nice, so if say the score changed, this could trigger some actions.

    2) no way to re-use code. I re-type a lot of code in a lot of games which are all similar to each other. This is a bit of a maintenance nightmare - when I change the common "library" code, I will have to edit 30+ games, and retest them all in case I made the C2 equivalent of a typo. You dont seem to be able to cut and paste actions between projects, even if you call the objects the same names. I experimented with manually editing the event sheets in notepad++, but kept crashing C2 (not surprisingly).

    There is a function plugin someone wrote, but as a general rule we don't touch plugins if they are not part of the supported C2 product so may end up not being maintained, bug fixed or working with a release.

    The main point here is that construct 2 should be object oriented instead of procedural.

  • To change it to a model like Unity (object compositional) uses would demand pretty much some major code rewrite i think. Each approach has it advantages and downsides.

    Of course Unity model is harder to grasp but much more flexible.

  • I really dislike giving up enormous benefits for tiny advantages... besides, everything coding-wise is OO nowadays, so everyone is going to have to learn it some day.

    As for it being hard, remember that the longer this is postponed, the harder it is to add later.

  • I second the suggestion to introduce some form of event re-usability in C2. IIRC, MMF had something called "behaviors" that were basically event sheets attached to the objects. Inside those events you would reference other "families" (I really don't remember the exact terms) so you could just copy and paste your object into another project and those events would work if the "families" were in the new project. I am sure Scirra has already thought of something similar and maybe they are working on it.

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