pacman.zig
pacman.zig copied to clipboard
added touch input scheme for ios
Probably not the best possible way of implementing touch input support, but it does make the game playable on mobile.
The input scheme is adaptive with regard to the direction that pacman is going. For example, going left creates the following touch input grid:
__________
| | |
| U | |
|______| R |
| | |
| D | |
|______|___|
Similarly every other direction produces a corresponding "adaptive" grid.
Tested it briefly with a mouse and seemed reasonable, testing on a real device might be warranted.
Just a heads up that I've seen the PR, but it'll be a little while until I get around looking into it :)
No worries, also feel free to scrap this PR if you plan to add full, clean touch input support. I've only implemented it on stream to be able to play on iOS while learning how to use Sokol.