I have done the best I could with searching this site, forum and the general internet.
I hope this is easier then I think.
I want to build a card matching game that works like so:
(totally predictable, I know)
- X amount of cards are spread out on screen in random order
- user taps a card, value is revealed
- user clicks another card, value is revealed
- if the two match, the cards are destroyed
- if they cards don’t match, they flip back to their original image.
I have tried this using Sprites, Animations, replacing the image.
There has to be a smarter way to accomplish this.
[code]
tiles = {“cardFront.png”, “cardBack.png”}
local t1 = movieclip.newAnim( tiles )
local t2 = movieclip.newAnim( tiles )
a1 = false
a2 = false
totalFlipped = 0
matches = 0
local function flip_a1()
t1:nextFrame()
a1 = true
totalFlipped = totalFlipped + 1
–print(totalFlipped)
end
t1:addEventListener( “tap”, flip_a1 )[/code]
Thanks to whomever can lead me in the right direction. [import]uid: 7850 topic_id: 7181 reply_id: 307181[/import]