Using latest pull of 3.7 and default gunman asset pack.
Modify main.lua corona example line 84 and init with Idle
table.insert(skeletons, loadSkeleton("Gunman.atlas", "Gunman.json", 240, 300, 0.4, "Idle"))
Then at line 138 replace the key event listener code withRuntime:addEventListener("key", function(event)
if activeSkeleton == 1 and event.phase == "down" then
state = skeletons[activeSkeleton].state
state:setAnimationByName(1, "Aim_Shotgun", false)
timer.performWithDelay( 500, function() state:setAnimationByName(1, "Fire_Shotgun", false) end )
end
return false
end)
When you trigger this you will see only two eventsif activeSkeleton == 1 and event.phase == "down" then
state = skeletons[activeSkeleton].state
state:setAnimationByName(1, "Aim_Shotgun", false)
timer.performWithDelay( 500, function() state:setAnimationByName(1, "Fire_Shotgun", false) end )
end
return false
end)
event: Fire_Shotgun, Sound, 0, 0, 'Pump/Random'
1 event: Fire_Shotgun, EjectCasing, 0, 0, ''
In experimenting I put the the Fire_Shotgun on a different track than Aim and I get all 4 events.
BUT, trigger it again, and only get 2.