GAMEPAD CONTROLS: GAME AXIS
To make the ‘Gamepad’ work, download a copy of it in order not to lose the project.
I go to ‘Gamepad’ and click ‘Compare Axis’
These are analog joysticks. If I move the x-axis, we have between a negative 1 to 1 and a negative y-axis 1 to 1.
It’s like math, where anything in the top right corner is a positive number. In theory, if the gamepad ‘Left analog X axis’ is greater than 0.8 we should be able to move it left.
You can see that here. As you can see, by calling this function, this move ‘Player’ left is easier because you don’t have to write everything out twice.
We move ‘Player’ up, down, and to the right.
I move them up here.
We make everything the same here.
Now, we copy and paste them.
I move this.
Let’s cut this out and place it here.
You copy and paste it here.
Perfect. Now I copy this as well.
We set up the analog stick here.
We have ‘Left analog X axis’, and we set this as less than negative 0.8.
Next is the ‘Left Analogue Y-Axis’ which is larger than 0.8.
I’m doing 0.8 because ‘Gamepad’ has a peculiar problem with not quite 100 percent signups.
If we go back to html5gamapad.com
I move it to the side a bit, and it doesn’t have to be one.
That’s eight. Now move ‘Player’ up.
The y axis is less than negative 0.8.
Then move ‘Player’ down.
Let’s take a look at this here.
Everything still works with the ‘D-pad’. It is not exactly perfect.
You might have to add some sub-conditions, but for the most part, this is how you use the analog joysticks. If you are creating a simple game, I recommend not using the joysticks. However, some people prefer to use joysticks for platforms. That’s how you use the ‘Construct 3’ game model.