PLATFORMER: managing players speed and animation

Get help using Construct 2

Post » Thu Nov 03, 2011 9:29 am

This is an example i made of a player changing animation, depending on its speed.
It was suposed to be sonic like runner but i cant seem to get the player slide by holding oposite dirrection when in high speed.
Anyway,heres a first try of managing the characters speed with animation speed state.

Sudgestions and examples with other ideas for this topic are welcome!



Example contains:
-Basic description in eventsheet
-Managing players speed with global variables
-Changing animation, depending on the players speed (stand,walk,runn,break)

File: http://dl.dropbox.com/u/5214903/GM/Runner%20Speed%20up1.zipMiu32011-11-03 09:31:01
B
43
S
9
G
5
Posts: 231
Reputation: 7,291

Post » Fri Nov 04, 2011 8:10 am

Yup!

Good example, I use it to apply in a game based on the space.

I just add some Sine who changes according to the speed.
The next time I'll add that when you release a key when you are in high speed that the animation of the character goes trough "walk" for more fluidity.

runouterspace.capx
B
23
S
5
G
5
Posts: 112
Reputation: 4,737

Post » Fri Nov 04, 2011 8:16 am

I can't remember exactly how it works in Sonic, but one way to get a character to have a sliding animation is to check like this:

Right Arrow is down
Player.Platform.VectorX < 0
>> Set animation to Slide

Left Arrow is down
Player.Platform.VectorX > 0
>> Set animation to Slide

If you want it to be more specific, such as only sliding while turning at VERY high speeds, simply modify the 0 in both of those checks to whatever you want it to be. Just remember that when you're heading left, VectorX is negative.
B
20
S
9
G
6
Posts: 607
Reputation: 6,112

Post » Fri Nov 04, 2011 3:05 pm

[QUOTE=wilfryed] Yup!

Good example, I use it to apply in a game based on the space.

I just add some Sine who changes according to the speed.
The next time I'll add that when you release a key when you are in high speed that the animation of the character goes trough "walk" for more fluidity.

runouterspace.capx[/QUOTE]


How about giving it rotation instead seting the angle and play a bit with combining sine movement with global?
http://dl.dropbox.com/u/5214903/GM/UfoSpeeder.zip
B
43
S
9
G
5
Posts: 231
Reputation: 7,291

Post » Fri Nov 04, 2011 3:06 pm

[QUOTE=SullyTheStrange] I can't remember exactly how it works in Sonic, but one way to get a character to have a sliding animation is to check like this:

Right Arrow is down
Player.Platform.VectorX < 0
>> Set animation to Slide

Left Arrow is down
Player.Platform.VectorX > 0
>> Set animation to Slide

If you want it to be more specific, such as only sliding while turning at VERY high speeds, simply modify the 0 in both of those checks to whatever you want it to be. Just remember that when you're heading left, VectorX is negative.[/QUOTE]

Thankyou for the tip!
The movement looks much better now the way i wanted :D
B
43
S
9
G
5
Posts: 231
Reputation: 7,291


Return to How do I....?

Who is online

Users browsing this forum: djcrazypants, marekmk and 6 guests