2 Sprite in 1

I have created a cycle race:

sheetData = {    width=69,height=99,750,count=8,numFrames=8,}

    spriteSheet = graphics.newImageSheet(“media/frame-10.png” , sheetData)

    sequenceData = {

        {name=“charData”, frames={1,2,3,4,5,6,7,8}, count=8, time=600, loopCount=10000}

    }

    char=display.newSprite (spriteSheet,sequenceData)

    char:setSequence(“charData”)

    physics.addBody( char, { density=0, bounce=0, friction=1,} )

    char.isFixedRotation = true

    char.myName=“char”

    --char:play()

    char.y=280

    char.x=50

A vertical image.

I also need to do an animation or slides, you can make the animation run from 1 to 8 and 9 to 12 slides? how can I set this in a single animation?

Per sprite you can have multiple sequences with separate image sheet for each sequence, but one sequence can only be based on one imageSheet (cannot be mixed)

One notice: in sequenceData you define ‘start’/‘count’ pair or ‘frames’ table- not both.
For ‘loopCount’ parameter - if you want to have endless animation then you do not have to set this parameter - looping animation is default behavior for sequence

So what do you advise me to do this step, I have to set the character animation that slides. What can I do? I can not make an image with 15 sprites and I do that when I press a button goes from 8-15 and runs from 1-7.not when I can not it?

As I said you can have different sheets per sequence. So you can have running animation in one image and sliding animation in other one. See documentation for details.

PS.
It’s a bit hard to understand your questions because of sentence construction :slight_smile:

I’m sorry but I use the translator

   sheetData = {    width=69,height=99,750,count=8,numFrames=8,}

    spriteSheet = graphics.newImageSheet(“media/frame-10.png” , sheetData)

    sequenceData = {

        {name=“charData”, frames={1,2,3,4,5,6,7,8}, count=8, time=600, loopCount=10000}

    }

    char=display.newSprite (spriteSheet,sequenceData)

    char:setSequence(“charData”)

    physics.addBody( char, { density=0, bounce=0, friction=1,} )

    char.isFixedRotation = true

    char.myName=“char”

    --char:play()

    char.y=280

    char.x=50

I want to do that when I press a button, the animation “char” changes the sequence from number to number.

Per sprite you can have multiple sequences with separate image sheet for each sequence, but one sequence can only be based on one imageSheet (cannot be mixed)

One notice: in sequenceData you define ‘start’/‘count’ pair or ‘frames’ table- not both.
For ‘loopCount’ parameter - if you want to have endless animation then you do not have to set this parameter - looping animation is default behavior for sequence

So what do you advise me to do this step, I have to set the character animation that slides. What can I do? I can not make an image with 15 sprites and I do that when I press a button goes from 8-15 and runs from 1-7.not when I can not it?

As I said you can have different sheets per sequence. So you can have running animation in one image and sliding animation in other one. See documentation for details.

PS.
It’s a bit hard to understand your questions because of sentence construction :slight_smile:

I’m sorry but I use the translator

   sheetData = {    width=69,height=99,750,count=8,numFrames=8,}

    spriteSheet = graphics.newImageSheet(“media/frame-10.png” , sheetData)

    sequenceData = {

        {name=“charData”, frames={1,2,3,4,5,6,7,8}, count=8, time=600, loopCount=10000}

    }

    char=display.newSprite (spriteSheet,sequenceData)

    char:setSequence(“charData”)

    physics.addBody( char, { density=0, bounce=0, friction=1,} )

    char.isFixedRotation = true

    char.myName=“char”

    --char:play()

    char.y=280

    char.x=50

I want to do that when I press a button, the animation “char” changes the sequence from number to number.