How do I change animation speed acording to moved distance ?

Get help using Construct 2

Post » Sun Sep 14, 2014 2:43 pm

Hi guys, I have a spherical object that is one sprite, it has a 360° rotating animation with 15 frames. How can I make the animation speed changing according to the distance and speed that the sprite rolls on the ground ?
Is that possible ?

thanks :)
B
37
S
16
G
2
Posts: 447
Reputation: 4,860

Post » Sun Sep 14, 2014 2:56 pm

This might not have the effect you want, but you could compare the position of the sprite with it´s last position (every tick or every x seconds) and set the animationframe accordingly..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sun Sep 14, 2014 2:59 pm

thanks, can U write a sample, as beginner it's a bit hard to know how to make that... thanks:)
B
37
S
16
G
2
Posts: 447
Reputation: 4,860

Post » Sun Sep 14, 2014 3:06 pm

Actually based on where this question started, why not set the frame based on the angle of the wheel in the example elios provided?

My version would involve creating a variable oldx and comparing it with the current wheel.x

so basing the frame on wheel.x-wheel.oldx

but using the angle as explained above would be far better..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sun Sep 14, 2014 3:12 pm

I will try , thanks :)... U guys are really so much smarter in coding and programming... I feel like a 10 year old kid ;)...
B
37
S
16
G
2
Posts: 447
Reputation: 4,860

Post » Sun Sep 21, 2014 5:56 am

can you help me? i am making bike race game and wanted to display bike travel distance in hud?

thanks,

i am just born baby :P
B
16
S
4
Posts: 53
Reputation: 1,221

Post » Sun Sep 21, 2014 6:03 am

i just did >

system: set wheel.x its showing bike's current position. however, i wanted to save this as score for next round?
B
16
S
4
Posts: 53
Reputation: 1,221


Return to How do I....?

Who is online

Users browsing this forum: sublimate and 2 guests