Archive for March 2010 - Purple Squirrels
Recently I have been experimenting with WiiFlash – using a Wii remote to control Flash. Below is a video of my first test app. It is a spray painting app like the WiiSpray though obviously not at featured. I will make the Flash projector file available soon.
I decided to learn how to use WiiFlash after seeing the WiiSpray and a number of other videos a while ago. Turns out it is surprisingly easy! The only problem I had was trying to get a MovieClip to move around the stage as a mouse… I couldn’t find anything anywhere that clearly expained how to do this. Then I found that you can access the raw point data from the sensor bar through properties such as:
wiimote.p1.x; // x position between 0 and 1
wiimote.point1; // Point object with x and y values
So below is what I came up with. Very simple although with no smoothing but it still seems to work pretty good. (I hope it works because I am writing this from memory!)
var myWiimote:wiimote = new wiimote();
//note: Box is a symbol in the library
var box:Box = new Box();
//my x values were reversed so I multiplyed it by negative stageWidth and then
//subtracted from normal stageWidth to get a value on stage.
Box.x = stage.stageWidth - (myWiimote.p1.x * stage.stageWidth;
Box.y = myWiimote.p1.y * stage.stageHeight;
The main problem that I came across was Flash getting (i think) confused between the two points on the sensor bar, so I covered up one of the LEDs and it worked great.
Soon I will post up an example if a simple Wiimote Grafitti app I made, inspired by WiiSpray.
Last night I started building a shooting game in AS3 using tangible objects placed on my touch screen. This was inspired by the video I showed in the previous post. The video below shows my first test with directional shooting, though I havent added targets in yet. Since my set up uses FTIR technology I could not use fiducial markers, so I decided to build ‘active’ objects that have two IR LEDs in the bottom and a push button on top. The first LED is always on and provides location, and the second LED is controlled by the push button which triggers the gun provides the shooting angle relative to the first LED.
Found this cool video on the NUI Group forums showcasing an Asteroids game that Javier Marco has created, using actual objects placed on the screen as spaceships that shoot enemies. Very cool. Watch the video below. I think I might try something like this when I get some free time!