all… please help… how can i change my image (character) when my character JUMP…
n it back to normal when it on Ground, please help… already check…
didnt get the answer…
all… please help… how can i change my image (character) when my character JUMP…
n it back to normal when it on Ground, please help… already check…
didnt get the answer…
You need to provide more details. Are you using individual images or sprite sheets? Perhaps posting some code showing how you’re creating your images would be helpful.
Rob
hi rob iam using sprite sheet…
n dis is my code…
[lua]–
p_options =
{
– Required params
width = 100,
height = 100,
numFrames = 11,
– content scaling
sheetContentWidth = 1100,
sheetContentHeight = 100,
}
ponySheet = graphics.newImageSheet( “skatesss.png”, p_options )
sequenceData = {
{name=“intro”, start = 5, count = 1, loopDirection=“bounce”},
{name=“walk”, start = 1, count = 4, time = 1000},
{name=“jump”, frames={7}, loopCount=1},
}
pony= display.newSprite(ponySheet, sequenceData)
pony.x, pony.y = centerX -300, centerY+50
pony.collided = false
physics.addBody( pony,{ friction=1.0, density=1.0, bounce=0.5} )
pony.isFixedRotation = true
[/lua]
n dis is my function.
[lua]–
function onScreenTouch (event)
print(“touched”)
pony:setLinearVelocity(0, -200)
return true
end
[/lua]
everything is works good… but i want change my image when it “JUMP” to (jump image)
n it back to “WALK” ( walk image )when my character on the ground…
You need to provide more details. Are you using individual images or sprite sheets? Perhaps posting some code showing how you’re creating your images would be helpful.
Rob
hi rob iam using sprite sheet…
n dis is my code…
[lua]–
p_options =
{
– Required params
width = 100,
height = 100,
numFrames = 11,
– content scaling
sheetContentWidth = 1100,
sheetContentHeight = 100,
}
ponySheet = graphics.newImageSheet( “skatesss.png”, p_options )
sequenceData = {
{name=“intro”, start = 5, count = 1, loopDirection=“bounce”},
{name=“walk”, start = 1, count = 4, time = 1000},
{name=“jump”, frames={7}, loopCount=1},
}
pony= display.newSprite(ponySheet, sequenceData)
pony.x, pony.y = centerX -300, centerY+50
pony.collided = false
physics.addBody( pony,{ friction=1.0, density=1.0, bounce=0.5} )
pony.isFixedRotation = true
[/lua]
n dis is my function.
[lua]–
function onScreenTouch (event)
print(“touched”)
pony:setLinearVelocity(0, -200)
return true
end
[/lua]
everything is works good… but i want change my image when it “JUMP” to (jump image)
n it back to “WALK” ( walk image )when my character on the ground…