Connecting gaming device

Posted on 2023-06-22 10:24:02
Enigma has functions for connecting other input devices like a gamepad, joypad or joystick. This is dependent on the platform u are using.

On Linux, this is accomplished by using the joystick functions to map the joystick axes and buttons.

Using my PS3 controller i was able map the left stick to move my character in the left, right, up and down direction.

The code ascertains what type of device is connected first. Then it reveals the name and the amount of buttons there are. With trial and error, one can ascertain for the buttons and map accordingly.

As such you can add another object with the same code to get that a player experience of your game.

No comments have been posted, yet. Log in to post comments.