Animation freezes while 2 keys pressed

Get help using Construct 2

Post » Tue May 12, 2015 11:18 am

Hola,

I'm currently working on 2 games and seem to have a problem with the running animation while pressing 2 keys at once for diagonal movement. I've tried various movements plug ins, but they all react the same. As soon you press 2 keys at once, the animation freezes. Doesn't matter if you stick the animation to the player-box or move the animation directly. In both instances the animation freezes, the m0tion works. It's just the animation.

Anybody got an idea about this?
B
20
S
5
G
1
Posts: 148
Reputation: 1,736

Post » Tue May 12, 2015 11:35 am

Looks like you've got conflicting events..

When the conditions of an event are true - the actions will be executed

when the conditions of more than one event are true - all the actions of those events are executed

so if you have

on up key pressed - set animation up

on left key pressed - set animation left

on up key pressed and on left key pressed - set animation upleft

All three of these events will run when up and left key are pressed at the same time..

so every tick the animation is first set to up, then to left and then to upleft
in effect it will look like the animation freezes..

Adding more conditions will prevent the conditions of all three events to be true at the same time..


One solution (albeit not the best) would be:

If up key is pressed and left key is not pressed - play animation up
etcetera
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 » Tue May 12, 2015 11:06 pm

Thanks LittleStain, will have a try with this option.
B
20
S
5
G
1
Posts: 148
Reputation: 1,736

Post » Tue May 12, 2015 11:49 pm

@LittleStain Thankx man, had another sort of conflict with my game and with you suggestion I solved it. So, I am positive this should also work for the animation [hopefully ;-)]
B
20
S
5
G
1
Posts: 148
Reputation: 1,736


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 14 guests