so i got a runner, and i want him to jump when i tap him. i’ve looked around but since he is in animation form, i have no idea how to do this. can i also change the animation while hes in the air and then back to the running position when he lands? i’m assuming variables come to play, no? [import]uid: 91147 topic_id: 16227 reply_id: 316227[/import]
Use sprite Luck. May the manual be with you
[import]uid: 12704 topic_id: 16227 reply_id: 60413[/import]
whats sprite luck? [import]uid: 91147 topic_id: 16227 reply_id: 60416[/import]
you mean sprite loq?
i’m trying to learn corona natively. no third party tools. i can start with the horse animation or jungle scene. but how to i make the green guy or horse jump on touch? [import]uid: 91147 topic_id: 16227 reply_id: 60418[/import]
Lol, this made me laugh and I had to post to it. You can create sprite sheet sets - runningman or jumpingman. When the character jumps, you would play the jumpingman sprite sheet set and when he’s running you play the runningman sprite sheet set.
http://developer.anscamobile.com/reference/index/spritenewspriteset [import]uid: 14218 topic_id: 16227 reply_id: 60419[/import]
oh ok thanks! but how do i get this dude to jump?
also don’t i have to use the destroy self code when jumping and landing? [import]uid: 91147 topic_id: 16227 reply_id: 60421[/import]
So really this code and Docs only make 1/2 bit of sense…
As much as I love y’all, Ansca, you really do need a technical writer, because your doc’s are not up to par.
This might be all fine and dandy for 1 single sprite “SET” but how would you handle multiple sprite sets?
Documentation Code:
-- A sprite sheet with a cat
local sheet1 = sprite.newSpriteSheet( "runningcat.png", 512, 256 )
local spriteSet1 = sprite.newSpriteSet(sheet1, 1, 8)
sprite.add( spriteSet1, "cat", 1, 8, 1000, 0 ) -- play 8 frames every 1000 ms
local instance1 = sprite.newSprite( spriteSet1 )
instance1:prepare("cat")
instance1:play()
Code Question?? - Not sure how to actually do this based on documentation for multiple sets in same sheet.
--Adding 1st sprite set.
sprite.add( spriteSet1, "cat", 1, 8, 1000, 0 )
--- Based on your docs this is what I would expect to do
sprite.add( spriteSet1, "cat2", 9, 15, 1000, 0 ) -- Add Cat2 to same set??
instance1:prepare("cat")
instance1:play()
---- A Bit of time passes - maybe a jump for a tap occurs
--- Based on your docs this is what I would expect to do
instance1:prepare("cat2")
instance1:play()
But if this is how you do it. Well it does not work.
Can someone please chime in on this with a correct example.
Thanks
Larry
[import]uid: 11860 topic_id: 16227 reply_id: 112914[/import]
Just use Spriteloq, I highly recommend it. They have a video tutorial on their website for you. And the way they compress the images to reduce texture memory is pretty sick. Can’t live without it. [import]uid: 108204 topic_id: 16227 reply_id: 112915[/import]
That’s all well and fine,
I do have Texture Packer and it does pretty good, also I do plan on looking at Spriteloq ( cause i can never have to many tools lol ) but that does not help me…
Cause I would like to understand the process instead of just using a tool.
Like Spriteloq or texture packer.
Thanks
Larry [import]uid: 11860 topic_id: 16227 reply_id: 112916[/import]
Also if you are not using FLASH can you even use Spriteloq??
I don’t know. It seems like it is a FlashExporter, not really anything to do with just packing sprite from normal png’s
Since you use it, let me know I would be interested in knowing.
Larry [import]uid: 11860 topic_id: 16227 reply_id: 112921[/import]