cklester's Forum Posts

  • Nice! Thanks rex. I'll get right on it. :-)

  • cklester - jwilburn's events are fine, you don't need to make a subevent for the loop to work correctly. In fact sometimes adding redundant subevents can reduce performance.

    OK, so in my example, are you saying having the loop as a sub-event is not necessary? Does the processing stop and wait for the "On 'get level definitions' completed" to complete? I thought it was like a callback, where other events are still getting processed, so if it wasn't a sub-event, it would get called. But you're saying the "json completed" is more like a loop or wait state. It WAITS until it's completed... then moves on. Right?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Here's what I mean, in case you want to try it out:

    <img src="http://cklester.smugmug.com/Other/Miscellaneous-Public-Pictures/i-cs6tMvg/0/M/loopafterread-M.png" border="0" />

    See how the loop is a sub-event to the AJAX completed event?

  • Can you post a capx? It looks like your loop is in the wrong place. Should probably be a sub event/action as a child to the AJAX completed event.

  • rex, the expressions aren't coming up in my C2. Is there something I have to do to "update" C2's awareness of new plugin source?

    I checked out the dates of the files in the archive and none of them are recent. Can you check that?

    Thanks! :-)

    UPDATE: Looks like my Firefox download cache was getting me. I downloaded to another path and it looks like I've got the updated files now. :-)

  • I'm using rexrainbow's hash table plugin. I'll post more details later!

  • Typo spotted: "Load hash table form JSON string" - "form" should be "from"

  • I played on my PC.

    Time: 138

    Hits: 158

    Miss: 20

    Score: 142200

    One suggestion: You should make things get faster sooner. Maybe it's just the modern mentality of "ramp up quickly," but the easy stuff seemed to go on for just a bit long.

    Good job!

  • mmarcati, I never see a leaderboard when the game is over. Or what I should expect?

  • I think I got it!

    Thanks. :-)

  • I've tried using the hash plugin as well, but can't get it to successfully load up a JSON file into an array for me. There might be a better way to approach this, but I'm new to C2 and don't yet know all the intricacies.

    Each key below is the name of a level of my game. Each value represents a grid (or array), from 1x1 for "Simple Tap," to 2x2 for "Four Drum Rounder."

    Ultimately, I'd like to call up a level and plot on the screen the pattern. How do I load this into C2 so I can make use of it in that way?

    Thank you!

    {
         "Simple Tap": [ [ [1] ] ],
         "Double Tap": [ [ [1],[2] ] ],
         "Triple Tap": [ [ [1],[2],[3] ] ],
         "Quad Tap": [ [ [1],[2],[3],[4] ] ],
         "Quad Tap Double Back": [ [ [1],[2],[4],[3] ] ],
         "Single Double": [ [ [1,3],[2] ] ],
         "Triple Back and Forth": [ [ [1],[2,4],[3] ] ],
         "Three Drum Intervals": [ [ [1,3],[2],[4] ] ],
         "Angled Triple": [ [ [1],[2] ], [ [3],[0] ] ],
         "Four Square Reverse": [ [ [1],[2] ], [ [3],[4] ] ],
         "Four Square Rounder": [ [ [2],[1] ], [ [3],[4] ] ]
    }
    
  • Yes, it's one large array. I'm trying to put it all into an array. (Maybe I should use a dictionary, but I didn't know if dictionaries could have arrays as their value content.)

    Maybe that's why I'm getting that message. It's telling me my JSON is not formatted properly! Thanks, ramones. I think I understand now.

    What I should use is

    {
         "c2array":true,
         "size":[11,1,1],
         "data":
              {
                   "Simple Tap": [ [ [1] ] ],
                   "Double Tap": [ [ [1],[2] ] ],
                   "Triple Tap": [ [ [1],[2],[3] ] ],
                   "Quad Tap": [ [ [1],[2],[3],[4] ] ],
                   "Quad Tap Double Back": [ [ [1],[2],[4],[3] ] ],
                   "Single Double": [ [ [1,3],[2] ] ],
                   "Triple Back and Forth": [ [ [1],[2,4],[3] ] ],
                   "Three Drum Intervals": [ [ [1,3],[2],[4] ] ],
                   "Angled Triple": [ [ [1],[2] ], [ [3],[0] ] ],
                   "Four Drum Square Reverse": [ [ [1],[2] ], [ [3],[4] ] ],
                   "Four Drum Square Rounder": [ [ [2],[1] ], [ [3],[4] ] ]
              }
    }
    

    Oddly, neither the "Array" entry nor the "AJAX" entry indicate that the format of the JSON string being loaded need be particular. It would have saved us time if the docs had said something like, "To load a JSON string, it must be in this format: { ... }" Maybe it does and I missed it.

  • I'm trying to load a JSON string (from a project file) that defines the layout of various levels for my game. Here's what the level_definition.json file contains:

    {
         "Simple Tap": [ [ [1] ] ],
         "Double Tap": [ [ [1],[2] ] ],
         "Triple Tap": [ [ [1],[2],[3] ] ],
         "Quad Tap": [ [ [1],[2],[3],[4] ] ],
         "Quad Tap Double Back": [ [ [1],[2],[4],[3] ] ],
         "Single Double": [ [ [1,3],[2] ] ],
         "Triple Back and Forth": [ [ [1],[2,4],[3] ] ],
         "Three Drum Intervals": [ [ [1,3],[2],[4] ] ],
         "Angled Triple": [ [ [1],[2] ], [ [3],[0] ] ],
         "Four Drum Square Reverse": [ [ [1],[2] ], [ [3],[4] ] ],
         "Four Drum Square Rounder": [ [ [2],[1] ], [ [3],[4] ] ]
    }
    

    So, each object has a name and a layout (as an array).

    When I read it in, I get this result (appending array_Levels.AsJSON to the log of a DebugPanel window): {"c2array":true,"size":[1,1,1],"data":[[[0]]]}

    1) Is my format wrong?!

    2) If it's the correct format, can the AJAX object not import it for some reason? My guess is, it chokes on the multi-level array definition. If that's the case, how can I otherwise read this into a C2 array?

    Thank you!