Switch facing left to facing right without mirror

Get help using Construct 2

Post » Fri Nov 27, 2015 11:19 pm

I would like to be able to switch from left to right animations (and vice versa) without using mirror in code sheet but still retaining the Platform behavior.
I have different sets for animations and would like to use them instead of just mirroring 1 set.
I have managed to work the running animations by introducing a global variable that once a direction is pressed becomes active and through that I trigger the appropriate animation, but I am having a problem with the idle animation facing direction.

Thanks for the help.
Brick by brick, stone by stone.
B
50
S
22
G
13
Posts: 273
Reputation: 10,413

Post » Fri Nov 27, 2015 11:25 pm

Something like this should work:
Give your sprite an instance variable..

on left arrow pressed - set instance variable direction to "left"
on right arrow pressed - set instance variable direction to "right"

sprite compare variable is "left"
- set animation to "idle left"

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 » Fri Nov 27, 2015 11:39 pm

@LittleStain

Awesome! Thanks man!!
Brick by brick, stone by stone.
B
50
S
22
G
13
Posts: 273
Reputation: 10,413

Post » Sat Nov 28, 2015 10:44 am

Hmm, now Im having problems when pushing both left and right arrow simultaneously, the animation freezes and does not respond and I end up with a still frame that is sliding...
Brick by brick, stone by stone.
B
50
S
22
G
13
Posts: 273
Reputation: 10,413


Return to How do I....?

Who is online

Users browsing this forum: KazaaMafia, Kenthria, QuantumMMX and 13 guests