Inconsistent Array behaviour?

0 favourites
  • 6 posts
From the Asset Store
Supports 1D, 2D, 3D arrays. Import and export arrays in JSON format
  • Click image to test :

    EDIT - [Oops Linked the game not the editor!]

    For some reason , even though an identical loop is used to create the main layout ( Press space to fill with red blocks, backspace to clear) , when it does the same for the thumbnail image, if fails to draw the last line.

    I'm doing nothing different in the smaller loop, other than changing the positional offset/scale on the output, the reading via two loops is still the same.

    You can see in the example image I've drawn a green border on the perimeter which is written to the array, however it fails when output again to the thumbnail size ( as you can see the bottom green line is misisng)

    Download the CAPX

    The capx uses Mipey's Sprite Font plugin - which I'd recommend everyone has. :)

  • Set the Array size to (Cols+1, Rows+1, 1)

    Otherwise the biggest column and row will be Cols-1 and Rows-1.

    The array's bottom row was lost since Array.At(x,Rows) was outside the array and wasn't saved.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks so much! Simple things eh!?

    I got a fully functioning save/load function. :)

    <img src="http://www.johnnysix.net/games/Bang/Preview10.png" border="0" />

  • So I've got a problem loading the array from the json string - for one you can't paste the json string into an instance variable slow as it contains double quotes.

    If anyone's interested in taking a look, I can PM the code.

    Copying the JSON from a text box works in the editor, but for some reason, with identical code, will not load within the game. :P

  • To store a JSON string as a variable just replace the " with "".

  • Music = What. The. Heck.

    heh heh :D

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