Hi guys, I've blocked on something, very stupid, i think, i got a problem with arrays.
I tried to fill an array like this
[declaring int i = 1 ]
system -> for (i) from 0 to 100 => Array value at (i) to 9999.
i've tried to add action (add 1 to 'i' ) but it goes to -> infinity (it doesn't stopped at 100 )
So, if I would like to fill an array (x-axis) with 9 with an for how should i do it ?
** YES, YES, i've red the 'loop' tutorials, thank you.
*** Can i somehow use the for and fill it with a variable without using another variable to 'scroll' the array ?
Develop games in your browser. Powerful, performant & highly capable.
If the array is 1 dimensional ...
Array > for each element ... element = x
.... Array > set at X .... X = Array.CurX .. value = whatever you like
If the array is 2 dimensional ...
.... Array > set at XY .... X = Array.CurX .. Y = an index you want to store something on ... value = whatever you like
blackhornet Thank you for showing me the 'loopindex', I apreciate that.
99Instances2Go Thank you mate !
To use your own name, set your Name to "i", then use loopindex("i") to address it.
Wel, to be clear, i prefer the 'for' loop.
Although maybe (i dont know, but thinking to understanding Ashley a little) the 'for each element' might be more optimised.
If you want to run trough each element with a 'for', the start is zero, the end is array.width - 1 (for the x-axes)
blackhornet Yep, Thanks
99Instances2Go I understant, again thank you.
Thank you guys !
blackhornet loopindex("i") doesn't work, sorry