How can I change the animation speed at runtime?

My character implements the animation principles described in this tutorial: http://justaddli.me/tutorial.php?t=0&id=11

I am using a joystick to manipulate player horizontal movement. This allows the user to more fluidly control the walking speed. When the “handle” of the joystick is only a short distance from the center, it moves the character slower than when it’s further away.

I want to adjust the animation transition speed of the sequence so when the player is moving slower, the animations change frames slower too. Otherwise, when the player walks slowly in one direction, his feet are always at a full sprint.

Thanks!
Darin [import]uid: 89126 topic_id: 15847 reply_id: 315847[/import]

I believe you use the timeScale property.

player.timeScale = 2.0

1.0 = normal speed, 2.0 = 2x the speed. etc. [import]uid: 49447 topic_id: 15847 reply_id: 58791[/import]

Is that timeScale new? I don’t think I’ve seen it before. Probably just missed it in the docs. In theory Lime should be fine with that but if it doesn’t work I will look into it. [import]uid: 5833 topic_id: 15847 reply_id: 58840[/import]

it’s from build 527, so it’s maybe around 1.5 months old [import]uid: 49447 topic_id: 15847 reply_id: 58851[/import]

Ah whoops, completely missed it then :slight_smile: Will have a look into it and see if it works. [import]uid: 5833 topic_id: 15847 reply_id: 58853[/import]

Thanks for response. That was exactly what I was looking for… however, I think I need to add a couple more walking frames now… :slight_smile: [import]uid: 89126 topic_id: 15847 reply_id: 59023[/import]

Atleast the property is working though :slight_smile: ( I assume anyway ) [import]uid: 5833 topic_id: 15847 reply_id: 59026[/import]

Yep. I got the property working. When I implemented it, the character looked choppy… so I added 4 extra frames to the walking animations… however, he currently only walks to the right, moonwalks to the left, and jumps like a sumo wrestler with a jet pack. I’m determined to resolve movement and physics problems by the end of the week so I can get into making his pick-axe. Then I’ll draw up a couple of mobs, or maybe some gems to collect.

I’ve wrote a quick, Level1 soundtrack candidate while taking a break, if you’re interested http://aeious.soundfolder.com I’m not sure I’m going to use it yet, but it’s a start. Well, I’m off to bed. (1:00am here in California)

Thanks for the help. The sprite.timeScale was exactly what I needed. [import]uid: 89126 topic_id: 15847 reply_id: 59034[/import]

Getting there :slight_smile: I will be getting to those other issues in your email too :slight_smile:

Really liking the music, very nice! [import]uid: 5833 topic_id: 15847 reply_id: 59311[/import]