Log In  

How can I change the controls of HTML exported games? KEYCONFIG only works locally. I want to have WASD as the movement buttons instead of arrow keys.

P#60728 2019-01-10 03:56 ( Edited 2019-01-10 20:26)

Hey, I see nobody else stepped up to answer, so I'll take a stab.

As far as I know, PICO-8 itself doesn't give you that option. But there two ways to tack it on afterwards.

One way is to control the state of the in-game buttons from Javascript in the template page, - listen for keypresses in Javascript and control the PICO-8 button state through a pico8_buttons array. My pico8gamepad.js does something similar for the purpose of enabling gamepad support in the web export.

The other solution would be hacking the exported JS file that represents the cart - the core logic of binding keyboard to PICO-8 buttons lives in there, but it'd probably be very annoying to try and do it this way (and any hacks you do would be lost on re-export).

P#60773 2019-01-12 14:30

[Please log in to post a comment]

About | Contact | Updates | Terms of Use
Follow Lexaloffle:        
Generated 2019-07-23 05:29 | 0.010s | 2097k | Q:11