Im using an array to track level completions with simple 1s and 0s. Im wondering if there is an easy way to get the sum of a row in this array to quickly be able to display how many levels have been completed. If I could get the sum of the row they are stored on in this array that would give me my number- but if there is not a way to do this I can try something else-
Thanks in advance.
Develop games in your browser. Powerful, performant & highly capable.
Yes you can do this, for example if 0 and 1 are stored at X only i.e. 1,0 2,0 3,0 4,0 then the logic is :
for from 0 to array.width, add array.at(loopindex,0) to variable
At the end of the loop the variable is the total of all values at X.