After writing a simple pong game, as I mentioned in my last post, I’m still studying Go. This week I challenged myself to write a more exciting thing, so I decided to write a Go program that controls a Stardew Valley1 game :-)
I found this tiny lib that helped my program to trigger keyboard events: https://github.com/micmonay/keybd_event. It’s a pretty straightforward lib, however, I noticed it had an issue with macOS, and I could help with the fix I get my first Go PR merged 🎉
I could solve my initial challenge in less than one hour, and it didn’t seem hard enough. So I spent some time making enhancements, and I could make tweets control my Stardew Valley game.
It works by consuming the Twitter Streaming API - of course, it’s still super simple, but the result is fun, see:
Even with this cool video, personally, the most rewarding part in this small project was to get my PR on keybd_event lib merged :-) It’s always rewarding to contribute in OS projects.
Stardew Valley is a farming simulation role-playing video game developed by Eric “ConcernedApe” Barone and originally published by Chucklefish (https://en.wikipedia.org/wiki/Stardew_Valley) ↩