Hi,
Im building a card game where there is a deck of cards spread out in one row on the table with the cards partly overlapping.
I want to be able to move one card out of the deck by placing my finger on it and pushing it up.
When I put my finger (or mouse) on the card and push up, the wrong card ( the one below the card I have my finger on) moves.
Any ideas?
[code]
for i = 1, #cards do
local c = cards[i]
c:addEventListener(“touch”, selectCard)
end
function selectCard(e)
c = e.target
if e.phase == “began” then
display.getCurrentStage():setFocus( c )
c.y0 = e.y - c.y
elseif e.phase == “moved” then
c.y = e.y - c.y0
elseif e.phase == “ended” then
display.getCurrentStage():setFocus( nil )
end
end
[/code] [import]uid: 10100 topic_id: 15703 reply_id: 315703[/import]