| View previous topic :: View next topic |
| Author |
Message |
robomancer
Joined: 16 Dec 2006 Posts: 3
Digg It |
Posted: Sat Dec 16, 2006 9:32 pm Post subject: Pygame Wiimote module |
|
|
Hey all,
I'm working on a pygame.wiimote module for homebrew Wiimote-enabled games in Python. So far things are looking pretty promising. I started with the WMD 0.0.4.15 codebase and have adapted things to fit the Pygame API. I also have multiple Wiimotes working (up to 4 at once tested so far; in theory 7 at once should work). I have a simple 2-person Pong game implemented -- the y-position of each player's paddle depends on the Wiimote's y-axis tilt.
I'm a bit short on time at the moment (got a Wii party in an hour!) but tomorrow I'll post a preliminary patch against pygame 1.7.1, and the Pong sample code. |
|
| Back to top |
|
 |
robomancer
Joined: 16 Dec 2006 Posts: 3
Digg It |
Posted: Sun Dec 17, 2006 2:42 pm Post subject: |
|
|
Hi all,
I've created a first step toward Wii Remote support in Pygame. This also includes a 1 or 2-player Pong game that uses the Wiimote force sensing and buttons. Patch is against 0.7.1 because the current SVN doesn't build for me. I expect that future patches will be against SVN head, or 0.8 when that is released. Let me know what you think. You can download the current sample code here (mangled because I am a new user... sorry):
gs3080.sp.cs.cmu.edu slash wiimote
Here's the README file:
Preliminary Wii Remote support for Pygame. This is definitely
proof-of-concept code, and is only likely to work in Linux. The only
supported features are: discovering Wiimotes via Bluetooth, polling
the buttons and 3-axis force vector, and setting the LEDs. The
wiimote.py module has useful docstrings for all public functions, so
"pydoc pygame.wiimote" should give you some helpful documentation once
it's installed. You can also just look at the LiiPong sample code.
Files in this package:
liipong-0.1.py
Pong for Linux with the Wii Remote. See the top of liipong-0.1.py for
some setup instructions. You can play 1-player or 2-player! To play
2-player, just sync 2 Wii Remotes when the game prompts you to.
pygame-0.7.1-wiimote1.patch
Patch to Pygame 0.7.1 that enables preliminary Wii Remote support.
I'll generate a new patch against Pygame 0.8 when that comes out (for
now, the SVN isn't building for me; I seem to need a new version of
SDL, which I'm too lazy to compile from scratch at the moment).
__init__.py, locals.py, wiimote.py
Full versions of the Pygame 0.7.1 files I changed to enable Wiimote
support. If you don't want to use the patch program, you can just
drop these in to the lib/ directory of the Pygame-0.7.1 source
distribution.
robomancer |
|
| Back to top |
|
 |
Asraniel
Joined: 15 Dec 2006 Posts: 4
Digg It |
Posted: Mon Dec 18, 2006 10:24 pm Post subject: |
|
|
why dont you join the developement of wmd? i think it would benefit everyone  |
|
| Back to top |
|
 |
robomancer
Joined: 16 Dec 2006 Posts: 3
Digg It |
Posted: Mon Dec 18, 2006 11:36 pm Post subject: |
|
|
| Certainly, if I make any useful patches to WMD I will send it their way... right now I've not added any functionality beyond what was already in WMD, though. I've simply taken the existing code and made it modular (i.e. removed all the global variables and exposed a class-based interface) and fit it into the pygame framework. |
|
| Back to top |
|
 |
acapulco
Joined: 05 Feb 2008 Posts: 14
Digg It |
Posted: Tue Feb 05, 2008 6:29 pm Post subject: |
|
|
I know this post is very very old, but, do you still hang around?
I would love to know how to toggle the Wiimote LEDs on and off. I'm using WMD 0.1.2 and I see some code for the LEDs, it's just that I have no idea where to register the event and how to handle it so I can link accelerometer data to the LEDs (ie, if it's tilted all the way left, the first LED turns on, if its tilted right the last LED turns on)
Any help would be greately appreaciated. |
|
| Back to top |
|
 |
|