basic animation problem

Get help using Construct 2

Post » Sun Mar 02, 2014 8:38 pm

https://www.dropbox.com/s/wtpvwo647ldm7u9/project.capx

my animations are all messed up, when i use for example, "left" i indeed go left and i use the animation i want, but if i press "left" and simultaniously use the other keys the other animations trigger, isnt there a way where i can only use 1 at the time? for example if im holding left and press the other keys only left animation is shown
B
5
S
1
Posts: 77
Reputation: 754

Post » Sun Mar 02, 2014 8:56 pm

I'm sure there are a hundred ways to solve this, but here's what I've done in the past:

Map out all the key presses you want to support: assign them an integer called KeyPress or whatever. So left is 1, up-left is 2, up is 3 and so on, all the way around the compass points. Include 0 for no key presses. Be sure to explicitly define the key presses including what keys should not be pressed. So if up is pressed, then down should not be pressed, and so on. Then create your motion and animations based on the KeyPress integer: If 1, then set the left animation and simulate movement left, etc.
B
57
S
15
G
11
Posts: 912
Reputation: 12,606

Post » Sun Mar 02, 2014 9:01 pm

I made one example using variable. It's pretty dirty but it works. If you want cleaner look, use GeometriX's idea :)

Oh, almost forgot the file :P
B
16
S
5
G
4
Posts: 74
Reputation: 3,311

Post » Mon Mar 31, 2014 10:56 pm

it works but it takes way too much time to change animatiions, it takes 1 / 2 seconds to change animations, why?
B
5
S
1
Posts: 77
Reputation: 754


Return to How do I....?

Who is online

Users browsing this forum: Cub3D, David181, yiuyiu6666 and 22 guests