Hey guys, I have a little problem with the sprite api and would like to hear your suggestions.
In my previous games or prototypes I did never use the sprite api so in this section I am a absolute beginner.
I have read the blog post about the new sprite methods by Brent Sorrentino ( http://www.coronalabs.com/blog/2012/10/02/animated-sprites-and-methods/ ) and tried to include them into my game.
At first I show you how it should work and then I show you how I tried to make it work 
The frame change should correspond to the y speed. The middle frame (7) should be drawn at the highest point in the jump arc, and the last frame(15) should be drawn when his y position is equal to his starting position(where he jumped from). Once the animation finishes, if the player is still falling, the last 3 frames could be used in a sweep loop (16,15,14,15,16,15,14, ectâŚ).
At the very first I would declare some sequences (This is just theoretical!)
Note: I use two different imagesheets, one for the running and one for the jumping animation.
[code]local sequenceData = {
{ name = âRunâ, start = 1, count = 16, time = 800 },
{ name = âjumpBeginâ, start = 1, count = 7, time = 400 },
{ name = âmidJumpâ, start = 8, count = 9, time = 450 },
{ name = âfallingâ, frames = { 16, 15, 14, 15, 16, 15, 14 }, loopCount = 1 }
[/code]
After that I create the player:
local player = display.newSprite(mySheet, sequenceData)
You can see that this sprite uses only the imagesheet âmySheetâ, there may be conflicts with the second imagesheetâŚ
Now I create the jump function (it starts with a button touch) :
local function onButtonJumpEvent(event)
if event.phase == "began" then
player:setLinearVelocity(0, -250)
end
end
This makes the player jump, nothing wrong with it. I have some sort of âif player.isGround == trueâ condition but I want to focus on the important things.
â
And now⌠the most important function for the player animations - the function that handles all the different sequencesâŚ
This is the point were I get stuck! I can check the players current y-speed by using the following:
[code]local function checkVelocity()
local vx, vy = player:getLinearVelocity()
end [/code]
⌠but I have some problems with the next steps. How do I change between different imagesheets and when do I have to change the sequences? Or do I have to use a completely different method?
I have already tried to change the sequences but sometimes the animation stopped or got stuck at one frame.
If you have any suggestions please feel free to answer 
Best Regards,
Max / CineTek [import]uid: 138330 topic_id: 31775 reply_id: 331775[/import]