Sorry in advance, this must be a really dumb thing i’m missing…
When the user clicks on the screen, a sprite should appear.
Tonight i added an animation that makes the sprite (a little sphere) “popup” … basically:
create the game object
set scale to 0.01
animate scale to 1
and i noticed that at the first click, and only the first, the animation is not played, the sprite just appears at scale 1.
Subsequent clicks are ok.
M.createOrb = function(tile, orbType, time, easing)
local orbPos = M.getTileCenterPosition(tile)
local orb = factory.create("#orb_factory", orbPos, nil, nil)
-- this is a single frame animation (i use several single frame animations of different colors and i switch color this way)
sprite.play_flipbook(orb, C.ORBS[orbType])
if(time ~= nil) then
if(easing == nil) then
easing = go.EASING_OUTELASTIC
end
print(time .. " " .. easing)
go.set_scale(0.01)
go.animate(orb, "scale", go.PLAYBACK_ONCE_FORWARD, 1, easing, time, 0)
end
return orb
end
time and easing are always the same for all clicks.
Ideas?
Issue can be seen here: