After reading a lot of arrays posts and tutorials then i tried to make myself an example of what i understand.
What i want?? well i have 4 figures ( triangle, circle, square, rectangle ) , every 5 seconds i spawn new figures, i want to pickup the figures and save the number of pickups for each figure ( example i picked up a triangle 2 times, array must save number 2, if i pickup again another triangle array must add +1 ( total saved: 3 ) ).
I used families because i want to use a lot of different sprite objects, This is my logic:
Yes, i was bad in mathematics at the school, i tried to use my noob logic here.
1. on start of layout-> ok i used the ArrayCreator tool, i understand that i need this event each time that i want to use an array.
3. - For each player ( i think this is bad because i have only 1 player object on screen, maybe must be replaced for each figure object.)
- Player is overlapping figures -> Add 1 to collected (yes i know this is wrong because when figures are destroyed then the variable collected will be destroyed too) , why i don't used a global variable? because i want to save the number of collected figures for each figure (triangle, circle, square, rectangle), i don't understand what to do here.
4. For each XY element, contains value figures.whatIam ( i saved the name of each figure in WhatIam variable in each figure object so the array will know which figure you are picking ) --> set value at (Array.Curvalue, 1) to figures.collected ( here i tried to add the value of number of pickups to the array ) but the problem its that the variable collected its destroyed with the figures.
I used Y1 row: because in Y0 row i have the name of the figures, using the array creator tool i can see that under Y0 Row i have the Y1 row, my question is, the array read the data under Y0 Automatic? example like an excel spreadsheet, because i was thinking in 2D arrays like an excel spreedsheet, example i put in X0, Y1 the number 5 then the array will know that number 5 its the number of triangles because triangle word its in X0,Y0 position, then too the array will know that all values under X0 in all Y positions are secondary values of the Y0 cell?.
I want to understand and learn, please help me.
my .capx:
http://www.filedropper.com/arraypickupfigures