Hello, yeah there are more questions from me! Hooray?
Well, the thing is, I don’t know how to change the speed of sprites. Is there even any way to do this? [import]uid: 8901 topic_id: 2222 reply_id: 302222[/import]
Hello, yeah there are more questions from me! Hooray?
Well, the thing is, I don’t know how to change the speed of sprites. Is there even any way to do this? [import]uid: 8901 topic_id: 2222 reply_id: 302222[/import]
Hmm, because no one is replying, I think it’s impossible. [import]uid: 8901 topic_id: 2222 reply_id: 6975[/import]
Looking in the API docs I found this:
sprite.add( spriteSet, “startFlying”, startFrame, frameCount, time, [loopCount])
Adds a sequence named “startFlying” to the sprite set with the specified frames. The sequence has frameCount frames, and will play for time milliseconds. You can control the frame rate of each sequence individually by altering this time parameter.
Is that what you mean by “change the speed of sprites?”
Jay (J. A. Whye)
[import]uid: 9440 topic_id: 2222 reply_id: 7001[/import]
I found this too, but I tried everything but the animation still went crazy fast.
What I would mean is, if the speed would be really high, the animation should be fast. When the speed is low, then the animaiton should be slow. [import]uid: 8901 topic_id: 2222 reply_id: 7024[/import]
What value are you using for “time”? If you set the time to 5000 (5 seconds) that will complete the animation cycle (for all the images in the sprite) in 5 seconds.
-Tom [import]uid: 7559 topic_id: 2222 reply_id: 7033[/import]
if the speed would be really high
There is no speed parameter, only time.
If you’re looking to change speed dynamically you can manually set current frame. Just don’t call play(). [import]uid: 3953 topic_id: 2222 reply_id: 7044[/import]
The time pramatere is really a problem for me. I don’t know what I do wrong. The console doesn’t show me any ererors. I can even set to 50000ms but the animation still goes extremly fast.
Example:
local WallMove = sprite.newSpriteSet(WallSheet, 1, 31, 50000) [import]uid: 8901 topic_id: 2222 reply_id: 7073[/import]
You’re specifying the time in sprite.newSpriteSet when it should be in sprite.add. See http://developer.anscamobile.com/content/game-edition-sprite-sheets
-Tom [import]uid: 7559 topic_id: 2222 reply_id: 7087[/import]
Yes! I finally found out. I thought sprite.add is the same as sprite.newSpriteSet. Silly me!
Now I fixed this and it’s working perfectly.
Thanks guys!
[import]uid: 8901 topic_id: 2222 reply_id: 7094[/import]