How to make a character flip horizontally problem

So if the player is on his left then this character flips him self to the left and same for right .

How to do that ?

1 Like

You just need to use the action to flip the sprite:

[code]Conditions: Left key is pressed
Player is on floor
Actions: Flip Player horizontally: yes

Conditions: Right key is pressed
Player is on floor
Actions: Flip Player horizontally: no[/code]

Lizard-13 yeah i know that but this is not what i mean .

i have a character in the game (not the player).
i need this character to face left when the player (the one i’m controlling) is on his left
and to face right when the player in on his right .

1 Like

Then you’ve to check if the Player is at the left or the right of the Character to flip it:

[code]Conditions: Character X position is >= Player.X()
Actions: Flip Player horizontally: yes

Conditions: Character X position is < Player.X()
Actions: Flip Player horizontally: no[/code]

2 Likes

Lizard-13 Thank you so much … it worked . I have another thing that i can’t quite understand .
So i have a (jump thru block) and i need :-
when the player is on this (jump thru block) and when i press the down button with the jump button … the player can actually go down this platform .
you know this effect ? it’s in a lot of 2d games and it gives the player more freedom to move .

Thank you again …

1 Like

Cool i did it .
just used :-

the cursor/touch in on down button > activate behavior Platform of jumpthru block : no
the cursor/touch in on down button ( reverse ) > activate behavior Platform of jumpthru block : yes

And now there is freedom :slight_smile:

2 Likes