3 ms·
I'm doing a little game in it at the moment. Had to write my own allegro bindings (https://github.com/bluepeppers/allegro https://github.com/bluepeppers/allegro
by lclarkmichalek 13y ago
I'm doing a little game in it at the moment. Had to write my own allegro bindings (https://github.com/bluepeppers/allegro https://github.com/bluepeppers/allegro), but it's fun enough. One thing I really enjoy is mixing event handling with the goroutines. For example, I wanted to start scrolling the map on the user's click, and then stop when they release the button. So on click, I fired up a goroutine just to watch for the button release and handle the scrolling. So much easier than having some variable somewhere called "isButtonXDown" and then checking it in the main loop. Of course, you have to be carefully with concurrency, but it's a lot of fun.