Game Development Community

Wii remote working with TGE

by Rob Terrell · in Torque Game Engine · 12/14/2006 (9:01 pm) · 4 replies

I just posted this on my GG "blog" page so it's perhaps redundant, but since I have no idea how long those things take to get approved, I wanted to mention this here on the Mac forum.

I hacked some support for the Wii remote into TGE 1.5. Until the GG blog is approved, you can see the screenshot and Quicktime movie at [url]http://www.robterrell.com/?p=11[url].

Right now it listens to the motion sensor for X and Y axis movement, and translates that into SI_XAXIS and SI_YAXIS events that are fed in via Game->postEvent(event). I've started support for the A and B buttons but I wasn't sure if I should make them into some new kind of keypress, or map them onto an existing keyboard character. Right now, A = space and B = return.

It's using the Cocoa bluetooth objects, and there some weirdness left over from calling Cocoa from Carbon, but nothing too serious so far. But it's pretty ugly. The sample code I appropriated was ugly to start with... and I uglied it up a good bit more. Still, it seems to work really well.

I'm sure it's only a matter of time until someone does the same for Windows, but for now it's a rare TGE Mac-first.

Edit: and now the resource has gone live, so this is redundant. Sorry folks! http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=11880

#1
12/14/2006 (9:07 pm)
This is exactly what I was thinking about doing last night, and actively went searching for a wiimote to try it, but couldn't find one :-/

Gary (-;
#2
12/14/2006 (9:31 pm)
Go get one. Actually, get the whole Wii. It's a lot of fun, and the pack-in game can help you understand the controller's limitations. Our local Target seems to get a shipment every week or so.
#3
12/14/2006 (9:38 pm)
Quote: Go get one. Actually, get the whole Wii.

Dude. Trying.
#4
12/15/2006 (12:59 am)
I read this in your .plan earlier, but it's so cool, I had to find out more. I'm a Windows user, but I must say it would be cool to see how you got this working. It might provide a starting point for us John Hodgman folks. :)