Hello Pico8-community!
I recently bought myself a Pocket Chip and just finished making my first game on it.
Now I wanted to upload it to Itch.io (it's for the 1-button-jam), so I exported it as .html, renamed the exported .html-file to index.html and bundled it with the .js-file into a .zip witch I uploaded to Itch.io.
Now my problem is, that despite my game showing up and running on the website, it doesn't recognize any button presses at all. (Even tried it on different machines which normally run other Pico8 games on Ich.io just fine, but had no luck.)
One more thing to note might be that the page scrolls when using the arrow keys?
Is there anything specific I have to watch out for when uploading to Itch.io?
Anyone have an idea what to change in order for the controls to work?
Have you tried clicking the game window? If it starts responding after doing that, it's a focus issue.
The default .html export is pretty basic. You can add an 'onload="window.focus()"' to your <body> tag to fix that issue - this will request focus for your game when it's first loaded into an iframe by itch.io.
Thanks for the suggestion, but I did already try clicking on it,
and adding onload to the body didn't help as well. :(
Still no idea what causes/fixes it...
I'm having the same issue (no input being received in HTML5 ver). Example https://www.lexaloffle.com/bbs/?tid=4107
Any help would be much appreciated!
Ok I think I may have figured out what was causing the issue I was having. I only was calling update60 instead of update(). So adding the following before update60() seems to work
function _update() _update60() _update60() end |
bntp() will register two frames in a row, add _update_buttons() :
function _update() _update60() _update_buttons() _update60() end |
I just figuired out that clicking any of the panels below the game (fullscreen, sound etc.) makes the HTML5 version gain focus (and therefore accept input).
This shouldn't be surprising, but it's a bit odd that clicking the game window itself (which I tried before) doesn't make it gain focus, especially since this method works with other pico-8 webgames on itch.io...
[Please log in to post a comment]