Need help with arrays, JSON and AJAX

0 favourites
  • 5 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • Hi everyone!

    I've been looking through the forums and tutorials and still can't find an answer to my problem.

    I'm making an ABC matching game- capital to small letters.

    I used the array editor:

    And then used these events + an event to present one of the cells of the array.

    It didn't do anything! Look at the Debug:

    Is there any reason why my array is still empty?

    Thank you very much.

    Tagged:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Oh, almost forgot to post the event sheet:

    [img=

    ]

  • First, you're loading the json wrong:

    It should be

    -> Array: Load from JSON string AJAX.LastData

    Next, you're trying to get 1 dimensional data from a 2 dimensional array.

    Try this:

    -> Text: Set text to Array.At(1,1)

    That should be "B"

    0,1 should be "b"

    Have a question though, why are you using an array when you can uppercase("b") and get "B"

    You could do a choose("a","b","c"... etc.) to get a random letter, stuff that into a variable and then compare user input to uppercase(variable)

  • And a quick thank you for posting all those images. Made figuring out the problem SOOO much easier.

  • Many thanks!

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