GamerGon's Forum Posts

  • But I would recommend utilizing spritefonts, you will have a lot more control over the appearance.

    I would not. They are a pain in the ass. Better to use webfonts:

    https://www.scirra.com/tutorials/237/ho ... -web-fonts

  • AJAX + XML:

    https://www.scirra.com/tutorials/807/ho ... -game-talk

    https://www.scirra.com/tutorials/354/xml-parsing

    I've used XML for my last game language localization. I have something like this:

    <?xml version='1.0' encoding='utf-8'?>

    <dictionary version='1.0' selected_language='eng'>

    <word key='hi'>

    <translation language='spa'>Hola</translation>

    <translation language='eng'>Hello</translation>

    </word>

    <word key='bye'>

    <translation language='spa'>Adios</translation>

    <translation language='eng'>Good bye</translation>

    </word>

    </dictionary>

    One XML with hundreds or even thousands lines will size < 1% of your exported project size (images and audio are the other 99%) <img src="{SMILIES_PATH}/icon_e_wink.gif" alt=";)" title="Wink">

  • Cloning still showing first frame from default animation.

    Any screenshot?

  • Major loading time (99%) will be for images and audio, not your config files. Even if you have 10 different files with 100 lines each.

  • >

    > > Yeah, that's what I meant, only one lastdata at a time.

    > >

    >

    > Don't understand your problem.

    > You can have:

    > - 10 different file requests.

    > - 10 different "AJAX on complete" with AJAX.lastdata inside.

    >

    I stated earlier that I want to access all this data from different containers (arrays) instantly, I'd rather not risk it by loading files on runtime, which isn't instant... XML is nice, though, thanks!

    I understand, but web games always have a "load time" with a "loading layout" with loading bar. In its event sheet you can load all your config files to your arrays so "in runtime" you don't have to load external files anymore. Your arrays already have your data.

  • Not trying to compete here! I know any syntax is better than mine, that's why I'm looking for alternatives.

    Don't see the problem in your file or syntax.

    "size": [2,23,1] is nothing. Really. Even ten times that is nothing in terms of filesize (kbs) and parsing time.

  • Yeah, that's what I meant, only one lastdata at a time.

    Don't understand your problem.

    You can have:

    • 10 different file requests.
    • 10 different "AJAX on complete" with AJAX.lastdata inside.
  • In other words, both alternatives (without the "For each" event") are the same.

  • One side tip: you don't need the "for each" in any of the two alternatives. C2 does a hidden "for each" if you just use the condition state.

  • Yup! Just saying that being able to load only one file at a time is quite a bummer

    Mmm... that is not 100% correct.

    You can REQUEST multiple files and inside "On complete" AJAX.LastData refers only to the data loaded in the tag defined at your "On complete" event.

  • The idea is to make editing the data file easier since xml and json are tedious.

    Easier to have your own format/parser?

    XML tedious?

    Disagree.

    One example of a xml dictionary that I'm using right now:

    <?xml version='1.0' encoding='utf-8'?>

    <dictionary version='1.0' selected_language='eng'>

    <word key='hi'>

    <translation language='spa'>Hola</translation>

    <translation language='eng'>Hello</translation>

    </word>

    <word key='bye'>

    <translation language='spa'>Adios</translation>

    <translation language='eng'>Good bye</translation>

    </word>

    </dictionary>

    What kind of file would be clearer than that?

    The XML parser in C2 is about 10 lines.

  • Weird because "First frame of Default Animation" is indeed the icon in the C2 editor.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Three types:

    I need all of this data to be accesible without loading and unloading files with AJAX (not instant, sadly), that's why I copy them into arrays

    It's not a "game" or "Construct" thing, It's web technology. AJAX is the way to access external files.

  • Wouldn't it lag? I've heard that loading big strings using that action causes freezing

    What is "big" for you? because, 100 lines of plain text is nothing.

    Lag comes into play when the file is too heavy (let's say bigger than 1mb. I've just created a file with 10.000 characters and it sized 11 kb) but you can always have a loading bar

    There is no problem doing that, don't worry. Is the way to go. It is common to have one or more json for configuration and one xml for text (for localization purposes).

    In any case, always have a plan b inside C2 "code" for any problem loading your files, using "AJAX - On error". I call that "default values".

    > 2. I don't understand your problem. Better solution for what?

    >

    I have to use AJAX plus external files just to have arrays loaded with parameters, as reading directly from AJAX.lastdata would mean loading a file each time (not instant). A better way of handling this, is what I meant.

    A "better way" is not to load those values from external files, but internal vars/arrays/dictionaries. You can have a configuration event sheet where you'll edit your values directly in C2. This way you will not need json, xml, or any other format but C2 conditions or actions.

    The answer you are looking for is: "it is internal or external", there is no other way.

  • Fill your screen with sprites around your gameplay area (let's call them "limit sprites"), then to your "on touch screen" condition add another condition about not touching those "limit sprites".