Platformer character turns to the left and right if the mouse cursor moves to the left and right

How to make a platformer character shoot where you aim with the mouse cursor and if the mouse cursor moves to the left of the character, then the character turns to the left and if the mouse cursor moves to the right of the character, then the character turns to the right.

Check the X of the mouse so
if MouseX("".0) < player.X()
player flip = yes
if MouseX("".0) > player.X()
player flip = no
same if the player has some weapon or sword
if MouseX("",0) < playerWeapon.X()
playerWeapon flip = yes
if MouseX("",0) > playerWeapon.X()
playerWeapon flip = no

1 Like