My game features a number of PNG images that the user can drag around. Each image has some meta data associated with it. For example, if you place Image A, 10 points are deducted. If you place Image B, 20 points are deducted.
I tried to set up an array, but Corona debug barks at me (something about processing a numeric change to a string).
[lua]local objects = {
“redBall” = {
“filename” => “redball.png”
“points” => 20
}
“greenBall” = {
“filename” => “greenball.png”
“points” => 10
}
}[/lua]
Questions: what’s wrong with my array structure? Is there a simple way to cycle through this type of structure, if I had a screen that showed them all the available objects?
Thank you! [import]uid: 85686 topic_id: 14277 reply_id: 314277[/import]