0 Favourites

How do I preset data to a file?

  • I have a pattern that is made up of objects.

    The game will have different preset patterns and the player will be able to change between pattern1, pattern2, etc.. with a push of a button.

    Each object in the pattern has an X and Y value.

    Each pattern will have between 9-27 objects stored in it.

    So far I only have 1 pattern planned. I will be adding patterns as the game is more developed.

    I don't think I can preset data into an array.

    Should I store all the patterns in one file or would it be better if every pattern had it's own file to save memory usage?

    I know vaguely of JSON and AJAX.

    I just need to be pointed in a direction.

    How am I able to preset the patterns?

    Should I just create a Function for each pattern?

    It seems like it may be similar. It isn't read unless called upon.

    It would seemingly only increase the amount of events per tick a small bit and the download size.

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • I didn't understand what you actually mean with the pattern, but maybe you can just make a pattern editor which saves your pattern in the array.

    Then you can export the array as a JSON string and put that in a project file. You can load the project file later with the AJAX Plugin.

    I hope I could help!

  • I meant I have a pattern of organized objects and each objects has two values to store.

    There will be more than one pattern...

    Pattern 1

    x1,y1

    x2,y2

    x3,y3

    x4,y4

    x5,y5

    Pattern 2

    x1,y1

    x2,y2

    x3,y3

    x4,y4

    x5,y5

    Each x and y would have it's own value.

    Thanks I will look into that.

  • How do I export array to Json?

    It seems like I can open a Json file using a browser, but I'm not sure how to export an Array.

    Do I need another software?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
99 10,158
karshinkoff's avatar
karshinkoff
Unread hot topic
78 10,779
Josek5494's avatar
Josek5494
Unread hot topic
0 Favourites
C2 Data Editor (Tools)
75 11,162
AnD4D's avatar
AnD4D