Hi, I have a fail in my code, sure is a simple fail, but I cant see the solution.
The code is:
Código:
function player.atk12()
if player.atk1 >= 300 then
player.atk1 = player.atk1 - 300
player.q.text = player.atk1
VidaB = VidaB - 30
boss.vida.text = VidaB
if player.atk1 >= 300 then
player.atk.isVisible = false
player.atk_.isVisible = true
end
if player.atk1 < 300 then
player.atk.isVisible = true
player.atk_.isVisible = false
end
end
end
player.atk_:addEventListener( “tap”, player.atk12 )
The Question is, I have a Points in the var player.atk1, and when this var is 300, I can TAP in image for attack, but the problem is that when I have 600 points in player.atk1, I TAP one time in image and not lose 300 points with one attack, I lose 600 points and attack two times with only one click.
Someone can help me for Attack only one time with one tap in image?
Sorry for my english, im Spanish.
regards.