4 ms·
The Up Arrow usually scrolls the page up. I could suppress it with preventDefault(), but this wouldn't work in Opera. I'm therefore hesitant to enable it. You
by phoboslab 16y ago
The Up Arrow usually scrolls the page up. I could suppress it with preventDefault(), but this wouldn't work in Opera. I'm therefore hesitant to enable it.
You can enter the following in the address bar, while the game is running, though:
javascript:ig.input.bind(ig.input.UP_ARROW, 'jump');
- TamDenholm 16y agovery cool thanks. Also, awesome making of video, signed up to be notified of the release of the game engine.
- bd 16y agoThe Up Arrow usually scrolls the page up. I could suppress it with preventDefault(), but this wouldn't work in Opera. I'm therefore hesitant to enable it. Maybe it's better to enable it, so that Opera users would complain and it would finally get fixed (by Opera team). You could use "keypress" event instead of "keydown" (for which for some reason preventDefault in Opera works), but this just brings other problems. (BTW it was me who left comment about events in your blog post. For my HTML5 games, I chose to use arrows and preventDefault, as in majority of browsers it improves user experience (even in Opera problems come only when page is larger than window). Just don't forget to cancel events only for keycodes that you actually consume).