Hi Slith! Here's how I would do it.
We're gonna have a global variable called
global.invertControls, and if it's 0, do normal movement, and if it's 1, flipped controls. Let's put this line of code at the beginning of the world object's create event to enable it by default:
global.invertControls = 1;Now, for the actual control inverting. After looking at Lemon's engine, the code for walking left and right is really complicated and weird, so don't feel bad for not understanding it. (I'd recommend Seph's or Yoyo's engine for new projects in the future). In the player's step event, at the top, the
h gets set to 1, 0, or -1, depending on whether walking right, standing still, or walking left. (Don't worry about not understanding the code). So, if we simply multiply
h by -1, we'll reverse our direction! Insert the following code AFTER h gets set to either global.R or global.L:
if (global.invertControls) {
h = -h;
}Your code should look like this now:
https://i.imgur.com/7hp21uY.png. Let me know if that helps!