Example: Load data from Json to array and populate game card

  • 28 favourites

Attached Files

The following files have been attached to this tutorial:

.capx

load-data-from-json-into-array.capx

Download now 677 KB
.JPG

randomcard.JPG

Download now 41 KB
.zip

Stats

7,369 visits, 11,795 views

Translations

This tutorial hasn't been translated.

Tools

This was written as an example for a fellow member in the forums to show how to populate a playing card with data.

I have attached an example .Capx.

<== It can found on the left hand side of this tutorial:

What does it use?

project files Array Spritefont System Expressions Instance Variables

Instructions for usage is simple

Click the button on left to randomly draw a card.

Special Cosmetics.

Shows current card and total card

Shows card image using current card instance variable

The first card is a placeholder an is not included in shuffle (random(1,numbercards)

Numbercards is the array.width

Remember array counts 0 as 1 so you will notice for displaying total cards as a number I array.width - 1

Also I am using 2 dimensional array as I wanted to group card data together. Open json to get a better idea.

I also used instance variables, this is not needed, it was more to show a point of view of the data being retrieved.

NOTE:

This is filed under Capx Examples and the attached capx is the tutorial itself. It is merely as an example, and not a finished product. It is merely for demonstration purposes.

.CAPX

load-data-from-json-into-array.capx

Download now 677 KB
.JPG

randomcard.JPG

Download now 41 KB
.ZIP
  • 0 Comments

  • Order by
Want to leave a comment? Login or Register an account!