Hello Corona Community!
I have a problem using the newSpriteSet. I combined a 22 sprites: 1-14 of jumping and 15-22 of running. The problem with this is when I use the “run” sprite set, the sprite disappears and then restarts. I’ve attached a link to a YouTube video showing what’s happening. Is there a work-around or is there something wrong with my code?
local sheetData = require ('santa')
local data = sheetData.getSpriteSheetData()
local spriteSheet = sprite.newSpriteSheetFromData( "images/santa.png", data )
local santaRunSet = sprite.newSpriteSet(spriteSheet, 1, 22)
sprite.add( santaRunSet, "jump", 1, 14, 500, -2)
sprite.add( santaRunSet, "run", 15, 22, 400, -2)
local santa = sprite.newSprite( santaRunSet )
santa.x = 280
santa.y = 100
physics.addBody( santa, "dynamic", { friction=0.5, bounce=0.3 } )
santa:prepare("run")
santa:play()
[import]uid: 14218 topic_id: 18013 reply_id: 318013[/import]
[import]uid: 52491 topic_id: 18013 reply_id: 68877[/import]