Sprite problem

local sheetData1 = { width=300, height=300, numFrames=8, sheetContentWidth= 2400, sheetContentHeight= 300 }--5700 --2900 } local sheet1 = graphics.newImageSheet( "player.png", sheetData1 ) local sequenceData = { { name="seq1", sheet=sheet1, start=1, count=4, time=800, loopCount=0 }, { name="walk", sheet=sheet1, start=5, count=8, time=800, loopCount=0 }, } local myAnimation = display.newSprite( sheet1, sequenceData ) myAnimation.x =display.contentWidth/2 ; myAnimation.y = display.contentHeight/2 myAnimation:play() myAnimation.xScale = 0.75 myAnimation.yScale = 0.75 local function tap(e) if e.phase == "ended" then myAnimation:setSequence( "walk" ) myAnimation:play() end end Runtime:addEventListener("touch",tap)

Why my sprite will stop a while when the sprite run to the last image and go back to the fifth image ? 

Hi @martinlim520,

I will need a more detailed explanation of what is happening, and when. Please list the behavior, as in, what happens when you start the game, what happens when you touch the screen, etc.

Also, please remove the “sheet=sheet1” parameters from each sequence. That is intended only if you are taking frames from different image sheets. Because you are using the same image sheet for the entire character, that is not necessary.

Thanks,

Brent

Hi @martinlim520,

I will need a more detailed explanation of what is happening, and when. Please list the behavior, as in, what happens when you start the game, what happens when you touch the screen, etc.

Also, please remove the “sheet=sheet1” parameters from each sequence. That is intended only if you are taking frames from different image sheets. Because you are using the same image sheet for the entire character, that is not necessary.

Thanks,

Brent