How do I store a list of objects for "Connect the Dots" ?

Get help using Construct 2

Post » Sat Mar 15, 2014 11:16 pm

I am working at a "Connect the Dots" game. This is how the gameplay works. After the user completes a drawing, an object (sprite) appears, fades away and after that a new set of dots is loaded.

What is the best/recommended method to store a list for the dots of more objects ?

I will store the following information for each object:
- object's name
- number of dots
- dot's coordinates (X,Y for each dot)
- sprite/animation's name
- sprite's size (width and height)
- continuation ("no" if the drawing has only one layer /// "object_name" if the object has more layers (example: 1st layer to draw is the Sun and the 2nd layer is Sun's glasses))
B
49
S
15
G
6
Posts: 534
Reputation: 7,195

Post » Sun Mar 16, 2014 12:04 am

B
10
S
2
Posts: 135
Reputation: 1,090

Post » Mon Mar 17, 2014 7:37 pm

@Alyra Games

Thanks, I've thought of Arrays, but will result in some big Arrays. Also I would like to be able to modify the file easily (like an Excel document) :)

Any ideas ?
B
49
S
15
G
6
Posts: 534
Reputation: 7,195

Post » Mon Mar 17, 2014 10:37 pm

An 2D array is like an excel document. It is like a rectangle of information. They can be modified easily with the "for each element" condition, for example. You can write a function and let this function store all the information you mentioned in the array.
B
10
S
2
Posts: 135
Reputation: 1,090

Post » Tue Mar 18, 2014 12:25 am

Alyra Games wrote:An 2D array is like an excel document. It is like a rectangle of information. They can be modified easily with the "for each element" condition, for example. You can write a function and let this function store all the information you mentioned in the array.

Thanks, but I know how Arrays work in C2, and it doesn't really help me ... I need a way to edit/store Arrays like an Excel document ... or load the data from an Excel document (or something similar) into an Array.

I am talking about preset values for objects. Let's say that an object has max 10 points/dots, then I will have:

object's name - 1 cell
number of dots - 1 cell
dot's coordinates - 20 cells
sprite/animation's name - 1 cell
sprite's size - 2 cells
continuation - 1 cell

I will need 26 cells only for an object. My game will have at least 30 different objects. That means the Array will be 2D and at least 26x30 (or 30x26), results 780 cells. I need a good way to organize my preset values.

Yes, I will use Arrays in my game, but only to load 1 object at time.

So the question remains: How can I store and load data into Arrays in most efficient way for my "Connect the Dots" game ?
B
49
S
15
G
6
Posts: 534
Reputation: 7,195


Return to How do I....?

Who is online

Users browsing this forum: David181, jorgmaquoi, unicornspitfire and 30 guests