I’m trying to make a simple piano keyboard for my programming class. I’ve made it in pygame because it’s nice and simple to use. I’ve managed to get it working by making a mouse rect and individual rects for each note on the piano and having the note play by linking it to a mousebuttondown event. So it’s working pretty good but I’ll be demonstrating it on a smartboard and I was wondering if I could make it multiplayer. The problem is I can’t work out a way that two people can play at the same time because obviously there’s only one mouse (which is detected by the player tapping on screen) and therefore one mouse.get_pos() for the rect collision detection. If anyone can suggest a work around that’d be cool!
Thanks for the help
-Laura
Currently, the Python based kivy framework is emerging as an alternative to multiplatform multimedia application – and one of their proeminet features is the support for multi-touch. Of course your hardware (and drivers) will have to have multi-touch capbilities, but the Kivy framework can certainly deliver what you need on the Python side –
The alternative, without leaving Pygame, would be to emulate a second cursor that would be keyboard or game-controler controled – but it would require much more coding than simply detect the coordinates of a click.