Horacebury,
I believe I am wanting to"control their location in a ‘stack’."
As you have mentioned above.
Initially, my logic was having a LUA table, called, cardsPlayedTable{ },
and have a CORONA display-group, called, cardsPlayedGroup( )
I would manipulate elements in cardsPlayedTable{ }, and have the cardsPlayedGroup( ) mirror that table.
THIS SEEMED REDUNDANT OF COURSE!
Avoiding ‘toFront’, I was going to remove a card from the cardsPlayedGroup( )
temporarily store it, then reinsert each card back into that very same cardsPlayedGroup, however,
in the order they are to be stacked.
This would work (in my mind) for shuffling the cards.
Putting them back into thedeckGroup( )
So, what little I do see,
You say:
myGroup[1] = object – works, because you are putting the object at a particular “numerical index” in the group
myGroup:insert( img ) --works too
So, if I use the above, how do I know (after shuffling), what specific card is at myGroup[1] or myGroup[15].
I may not be able to see (at the moment) how I can simply be blind to the order of myGroup, and still have the control I need over
each card object.
My cards include more than typical properties:
suit
rank
color
Certain cards are “SPECIAL”, and I need to know when a special card has been sent to the hand, the played area, or even the discard area.
These cards have been coded with all personal properties in aCard.lua file which has Class.lua as a parent.
In my mind, that is the main reason I am trying to OOP my game, even if my game CAN be programmed, NON-OOP.
I hope I have given you enough to foresee any obstacles I have waiting for me.
And you have made clear certain crucial points.
In the mean time, it seems I can do what I initially set out to do.
deck[1] = card1 – works, because I am putting card1 at a particular numerical index in the group
deck:insert( card2 ) – works, because I am putting card2 at a particular numerical index in the group
shuffleDeck( )
deck.card2 could now be at location deck[1]
Is this correct?
And how could I know if it was the KING card, or the Queen card?
Am I close? I feel like it!
Chris:)