Restore animation speed?

For questions about using Classic.

Post » Tue Oct 05, 2010 5:44 pm

Is there any way to restore an animation's speed after it's been changed by an event?

To be specific, my player's animations are slowed down to 10 when it's under water, and need to be set back to default the instant the player exits the water. How can this be done? Thanks.
Image
B
225
S
27
G
13
Posts: 1,774
Reputation: 18,024

Post » Tue Oct 05, 2010 6:56 pm

You have "if in water then anim speed is xxx". Now make "else" with mormal speed defining.
Or make "if not in water then anim speed is xxx"
B
19
S
6
G
4
Posts: 171
Reputation: 2,507

Post » Tue Oct 05, 2010 8:19 pm

also add "trigger once" so it won't be setting animation speed every frame :)
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Tue Oct 05, 2010 8:29 pm

The thing is each animation has a different speed so "xxx" would vary. I guess I could use subevents and name each animation speed individually..I just thought it could be done with a single action D:
Image
B
225
S
27
G
13
Posts: 1,774
Reputation: 18,024

Post » Wed Oct 06, 2010 11:17 am

There is a way to get your speed back, not to define it, but it will work only if when you exit for ex. water to new surface that 100% identical to one from which you got into the water.
Something like "if got in water set private variable "oldspeed" to speed, then change speed and if not in water set speed to "oldspeed"" :shock:
But it's a crap :oops:
B
19
S
6
G
4
Posts: 171
Reputation: 2,507

Post » Wed Oct 06, 2010 11:56 am

When a sprite is created it's speed is set to default.
So if you destroy the sprite with the new speed, the spawned sprite will have the old speed.
[url:17c9ss4u]http://dl.dropbox.com/u/666516/animspeedefault.cap[/url:17c9ss4u]

Also dunno wtf is with the text in the cap.
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests