How do I make an event that can check if a Player is moving left or right? For example, the event I want to make is:
if {Player is moving left and you click a button} → do {the player moves to the right}
and vice versa.
I’ll preface this by letting you know my way of doing it is probably not the best or right way! I’m just a newbie in the forum, really!
Assuming you’re using a Behavior - either Platform Movement of Top-Down Movement - the action of “Moving Left” should be triggered by a key press, whether or not it’s a real key press or a “Simulated” key press through events, with the default key for moving left being the Left Arrow key.
I think you could use the “Keyboard > Key Pressed” condition to check if the Left Arrow key is being pressed, and this way, you would know if the object is moving left or right by which key is being pressed at that moment.
Now, if the object is being moved not by a key-press, but by a Force - I don’t know exactly how to help!
Thank you; it is a force though
use
player.ForceAngle() to get the angle of your sprite. As it returns negative values add 360 to the returned value and you will have a 0 to 360 angle
thanks. i will try it out.
Check if the sprite is flipped horizontally or not.