Hello _memo
Thanks for that. I was missing return true in some of my event handlers, but adding that in didn’t make a difference. After about the third round the image handler event triggers the sprite event.
I didn’t add any code because there is a lot of it. The entire program is 2059 lines long. Let me try the event handler for one image object and the event handler for the sprite object. Maybe someone will see something I missed:
SPRITE OBJECT EVENT HANDLER:
– When the flame is touched run this code.
play_flame = function(event)
if play_flame_in_status_flag == false then
if event.phase == “began” then
display.getCurrentStage():setFocus( event.target )
event.target.isFocus = true
sfAnimation:play()
markX = sfAnimation.x – store x location of object
markY = sfAnimation.y – store y location of object
if newRound == true then
transition.to( stoneBench, {time=1000, alpha=0})
transition.to( scoreTextLine1, {time=1000, alpha=0})
transition.to( scoreTextLine2, {time=1000, alpha=0})
transition.to( round_ending_score, {time=1000, alpha=0})
transition.to( scoreTextLine3, {time=1000, alpha=0})
transition.to( scoreTextLine4, {time=1000, alpha=0})
transition.to( scoreTextLine5, {time=1000, alpha=0})
transition.to( endStone, {time=1000, alpha=0})
newRound = false
startTimer()
scoreNum = 0
gamescoreText.text = string.format("%-15u", scoreNum)
end
if isphysics_started == false and event.target == sfAnimation then
transition.to( fireText, {time=1000, alpha=0})
physics.start()
isphysics_started = true
end
elseif event.target.isFocus then
if event.phase == “moved” then
local x = (event.x - event.xStart) + markX
local y = (event.y - event.yStart) + markY
sfAnimation.x, sfAnimation.y = x, y – move object based on calculations above
elseif event.phase == “ended” or event.phase == “cancelled” then
display.getCurrentStage():setFocus( nil )
event.target.isFocus = false
sfAnimation.myName = “flame”
sfAnimation.x = firestand.x + 10
sfAnimation.y = flame_origin
end
end
end
return true
end
IMAGE OBJECT EVENT HANDLER
– Execute the code for a flameblast power card selection
flameBlast = function(event)
print(“physics state”)
print(isphysics_started)
if isphysics_started == true then
audio.play(flameBlastExplosion)
blast_stones()
for i = 1, maxSlots do
if slot_table[i].powercard == event.target then
slot_table[i].number_of_cards= slot_table[i].number_of_cards - 1
number_of_cards = slot_table[i].number_of_cards
current_number_of_cards_text = slot_table[i].textadd
current_number_of_cards_text.text = number_of_cards
if slot_table[i].number_of_cards == 0 then
slot_table[i].slotFilled = false
slot_table[i].powercard.alpha = 0
slot_table[i].powercard.x = centerx
slot_table[i].powercard.y = centery
slot_table[i].textadd.alpha = 0
end
break
end
end
end
return true
end
Thanks for looking!