sprites are basically used for 2d animations they are basically a series of pictures when put together form an animation,like take a look at this sprite a series of instance of pictures will create the animation for the object,
if you save this image https://ibb.co/nEosYy as “temp.png” in your project and run the code in simulator you should see the animation.
and I guess the code is quite self explanatory if you play with the code you should get the idea and in case you have a problem or would like me to go through the code feel free to write I would be happy to help.And don’t be stressed out its ok if things don’t work out because those problems are to make you stronger and better.
local widget = require("widget") local sheetOptions = { width = 136, height = 132, numFrames = 8, } local imagesheet = graphics.newImageSheet("temp.png",sheetOptions) local SequenceData = { { name="Right", frames={1,2,3,4}, time=400, loopcount=0, loopDirection="forward" }, { name="Left", frames={8,7,6,5}, time=400, loopcount=0, loopDirection="forward" }, } sprite = display.newSprite(imagesheet,SequenceData) sprite.x,sprite.y=100,100 sprite:play()