Ok let me start by saying that I am a Lua noob, and in the past have self taught myself obj c, so I am not a pro by any straetch of the imagination.
I have been trying to learn Lua by online docs and tutorials but also messing about with the sample projects, here on corona.
Recently i have been playing with the SimplePool demo because it seems to get quite complicated for a noob like me, but I now have one question, and I am puzzled.
to create the triangle of balls you use
local n = 0
and then you inplement
n = n + 1
I understand how this makes a triangle, by adding one ball to each row
But, what I have been trying to figure out is how would you make a shape like a diamond for example, I started with this
n = n + 1 elseif n = 4 then n = n - 1
but of course this did not work, so then I tried to set up an array
local n = {1, 2, 3, 4, 3, 2, 1}
And as you may have guessed that did not work, but then that got me thinking, what would i do if i wanted the balls set up like this 1,2,1,4,5,2,1…
And now my head hurts after a few solid hours of reading online docs and messing about with code.
Many thanks and if you can help a noob it would be much appreciated
Chris [import]uid: 10697 topic_id: 3730 reply_id: 303730[/import]