Animation problems

Get help using Construct 2

Post » Fri Jul 18, 2014 12:57 pm

I'm having problems with the animation in my car game project.

1. When right-key and up-key are pressed simultaneously, "up animation" is supposed to play, but the frame freezes. Same happens when up-key and down-key are pressed.


2. second problem is, the default "standing still" animation. It only plays when the game starts. If we drive the car around and stop, the default "standing still" animation freezes.

(I havn't put in the proper animation for "reverse-up" and "reverse-down" yet. so ignore that)

Press space to restart game.

Capx file download link :
Last edited by meman on Sun Jul 20, 2014 8:52 pm, edited 1 time in total.
B
5
Posts: 43
Reputation: 403

Post » Fri Jul 18, 2014 1:53 pm

upright-confusion.png


These are three of your events (I've put them close together, but they are still in the order they are in the event sheet)
if up and right are both down, all of these conditions are true and so all actions will be executed.
Construct reads from top to bottom

so first it sets animation up up from the beginning
then it sets animation forward from beginning
then it sets up up from the beginning

it does this every tick, and because different animations are called
the animation will every tick be restarted from the first frame and as such seem not to run at all

The trick is to add conditions, so only one of these events is true when both keys are down.

adding inverted statements does the trick most of the time, although it's not the prettiest method

In this case you only have to add an up-key is not down condition (right-click invert "up key is down"-condition)to your right key is down event, for both other events have the same action attached.
You do not have the required permissions to view the files attached to this post.
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 » Fri Jul 18, 2014 2:20 pm

Thanks @LittleStain for your help, I tried this, but it's not working..
Last edited by meman on Sun Jul 20, 2014 8:52 pm, edited 4 times in total.
B
5
Posts: 43
Reputation: 403

Post » Fri Jul 18, 2014 2:22 pm

Really appriciate the detailed information :) But I'm sorry, I can't make it work.
B
5
Posts: 43
Reputation: 403


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 3 guests