I have a JSON array which needs to be read in order of time to spawn objects.

0 favourites
  • 5 posts
From the Asset Store
An educational game for Times Table. An easy to use template for developers to build larger games
  • The array reads in the format

    Time (ms), X position, Y position, Instance variable A, Instance variable B

    How do I make it so that when the current time = the time in the first column, an object spawns at X position, Y position with those instance variables?

  • + System: Array.At(0,0) ≥ time

    + System: Trigger once

    -> System: Create object Sprite on layer 0 at (Array.At(1,0), Array.At(2,0)), create hierarchy: False, template: ""

  • + System: Array.At(0,0) ≥ time

    + System: Trigger once

    -> System: Create object Sprite on layer 0 at (Array.At(1,0), Array.At(2,0)), create hierarchy: False, template: ""

    only the first object was created and it was created before the timing point.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • > + System: Array.At(0,0) ≥ time

    > + System: Trigger once

    > -> System: Create object Sprite on layer 0 at (Array.At(1,0), Array.At(2,0)), create hierarchy: False, template: ""

    only the first object was created and it was created before the timing point.

    It needed to be less than or equal to, but still, this is clearly only capable of spawning a singular object.

    there are multiple entries in the json which need to be executed according to time

  • Ah yes the operator got exchanged. Since you didn't specify array value I just make quick sample for one object:

    dropbox.com/s/8dyrnro9fofrsta/summon_by_data.c3p

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