I’ve been rather enjoying tooling around with these little guys. I’ve created a little “memory” game as a jumping-off point (find matching pairs in the grid).
At the moment each Blink randomly selects its own colour during setup. This was just a temporary stopgap so I could move on and get the rest of it running, but I’d like to go back and fix it so that the setup generates coloured pairs of blinks (e.g. 2 red, 2 green, 2 blue etc). Ideally, these pairs wouldn’t necessarily always be adjacent.
I’m not sure how to tackle it – I can broadcast a message like “I am green, who’s with me?” easily enough, but what’s got me stuck is how to boil any responses back to a single “winner” without just randomly selecting a directly connected peer.
- it should be possible for a match to be adjacent
- it should also be equally possible for a match to be on the other side of the grid
Any advice/pointers? The networking stuff is the most interesting part of working with these but it’s also the part that completely bakes my noodle!