ActionScript
1
Jan 10
hex – a (multitouch) game.
I got inspired this year at the 26C3 in Berlin to code a game called hex.
This is my Multi-Touch game prototype, open source and free download coming these days.
You can play it online @ www.31media.de/hexTouch (If you have a Multi-Touch device: hex connects on port 3000 an requires a running flosc server.)
“Hex is a board game played on a hexagonal grid, theoretically of any size and several possible shapes, but traditionally as an 11×11 rhombus.
Each player has an allocated color, Red and Blue being conventional. Players take turns placing a stone of their color on a single cell within the overall playing board.
The goal is to form a connected path of your stones linking the opposing sides of the board marked by your colors, before your opponent connects his or her sides in a similar fashion. The first player to complete his or her connection wins the game.”
Check out HEX ON WIKIPEDIA
1
Dec 09
colorWheel: change the color of RGB LEDs
This is a demo of my colorWheel prototype.
Since I bought the Philips Ambilight I was frustrated because I was not able to change the color with my Mac or the iPhone. I now bought some IR controllable LEDs and integrated them into my HAL9031 API.
The iPhone App simply uses the build in accelerometer to rotate the colorWheel selection.
Tap the screen and the LEDs change their color!
The Flash Multitouch App changes the color of the LEDs and of the animation that loops in the background.
// The sound you can hear is programmed. It was generated by Flash & Midi.
26
Nov 09
Fiducial Tracking
New experiment! I modified my Multi-Touch setup to recognize Objects.
Flash is connected to Reactivision via TCP. The UDP Signals of Reactivision are transformed with a UDP TCP bridge.
11
Nov 09
HAL9031: Presenting an artificial intelligence
Welcome to the future.
Science has always been influenced by science fiction. Developments are often inspired by the inconceivably future technology found in literature and movies.
Inspired by Kubricks Movie 2001 – A Space Odyssey and a lot of Star-Trek I am proud to announce HAL9031.
In the past 3 years I have been working on HAL.

HAL was planned as an artificial intelligence that could learn from human behavior to support humans in their daily life.
The catchment area of HAL is unlimited:
- HAL has access to motion sensors. The system knows where you are
- HAL can control different Macintoshs in a network
- HAL can control Infra-Red based devices
- HAL can control light and electric circuits
- HAL can send audio via wireless-lan
- HAL can trigger shell commands
- HAL can notice RFID events
- HAL is able to speak. (By using the native Mac OS X speech synthesizers and wireless-lan)
- HAL can run on several touchscreen panels for local input.
- HAL is also available on iPhone, providing a input interface for communication.
- HAL is the next generation of home automation.
- HAL is a boardcomputer for modern living.
- HAL is different.
- HAL is intelligent.
HAL is constantly learning from human behavior.
To know how long a person is inside one room the AI differentiates between a space change or activity in a room.
The AI is able to recognize if a room inside a house is “still needed“.
To know if a room is still needed the AI has to learn what a person is doing. HAL has access to a lot of informations like e.g. the position of the sun, how long you usually sleep or when was the last time you ate something.
Intelligence means to reduce, relate and evaluate the given facts.
The AI uses motion profiles to recognize patterns in daily tasks to so communicate what HAL “thinks” a person is doing.
At the Moment HAL can differentiate between the following situations:
- you fall asleep
- you wake up
- you are not at home
- you come back home
- you are under the shower
- you are on the toilet
- you are working
- you are reading
- you are running around in your house
- you stay at one position
- you have visitors
If a situation is recognized the AI adjusts itself to provide useful support.
Example:
When you wake up HAL recognizes the moment you enter the bathroom. Music fades in. If you just woke up it is very probably that you use your shower. If you are still at the bathroom after a couple of minutes the shower mode is confirmed. The AI now evaluate it’s decision as correct.
The music you are listening to gets louder (it’s loud under the shower, adjust the volume so that the user can hear to sound).
Every 5 minutes the HAL announces the current time so that you don’t get lost under the shower.
When you are listening to music HAL recognizes your movement and decides automatically to send your music to (multiple) rooms you entered. Exactly like the light, the AI decides when it makes sense to turn it off.
HAL can also wake you up. There is no need for a bell that shocks you in the morning. With the native HAL app on the iPhone a wake up time can easily be submitted to HAL.
HAL loves Macintosh. (“Only Macintosh was designed to function perfectly” (Quote HAL9000, Apple AD))
HAL can communicate with nearly every program on a mac, your wake up time e.g. is also saved inside iCal!
Videos are coming soon, stay tuned! Don’t you Dave?
31
Oct 09
Throwing elements naturally with ActionScript 3
This is a demo of the throwableItem Class. Click, drag & throw.
The throwableItem engine only has 175 lines of code!
It it easy to use and it’s for free. Open source for a better world.
Feel free to download it here.
/* IMPORT THROWING ENGINE: */
import com.thirtyOne.prototypes.physics.throwableItem;
var throwEngine:throwableItem;
for (var i:uint=0; i<20; i++) {
/* CREATE A THROWABLE ITEM: */
var YOUR_CONTAINER:Sprite = new Sprite();
var randomScale:Number = Math.random()*1+.5;
YOUR_CONTAINER.scaleX = randomScale;
YOUR_CONTAINER.scaleY = randomScale;
YOUR_CONTAINER.graphics.lineStyle(1, 0xFFFFFF);
YOUR_CONTAINER.graphics.beginFill(0x000000);
YOUR_CONTAINER.graphics.drawCircle(0, 0, 75);
YOUR_CONTAINER.graphics.endFill();
/* ASSIGN ITEM TO throwableItem CLASS: */
/* throwEngine.throwableItem(STAGE:Stage, FORCE:Number, DEBUG:Boolean) */
/* throwEngine.create(CONTAINER:*, X:Number, Y:Number):Sprite */
throwEngine=new throwableItem(stage,4,false);
stage.addChild(throwEngine.create(YOUR_CONTAINER, Math.random()*stage.stageWidth,Math.random()*stage.stageHeight));
}
28
Oct 09
3D Cube Demo
I have been working with papervision since a long time now but even with a simple cube the performance is not even a bit comparable to the native CS4 3D power of Flash itself. Textures doesn’t have do be cached and transformed as Bitmaps, Flash handles MovieClips in 3D like in 2D; vector graphics are still scalable.
This is how to create a simple Cube in CS4:
function createCube():Sprite {
function createElement(_ausgabe:uint, __x:Number, __y:Number, __z:Number, __rotationX:Number, __rotationY:Number, __rotationZ:Number):void {
var _container:Sprite = new Sprite;
_container.x=__x;
_container.y=__y;
_container.z=__z;
_container.rotationX=__rotationX;
_container.rotationY=__rotationY;
_container.rotationZ=__rotationZ;
}
var _container:Sprite=new Sprite ;
//FRONT:
_cube.addChild(createElement(1, 0, 0, -100, 0, 0, 0));
//BACK:
_cube.addChild(createElement(3, 0, 0, 100, 0, 180, 0));
// RIGHT:
_cube.addChild(createElement(2, 100, 0, 0, 0, 90+180, 0));
// LEFT
_cube.addChild(createElement(4, -100, 0, 0, 0, 90, 0));
// TOP:
_cube.addChild(createElement(5, 0, -100, 0, 90+180, 0, 0));
// BOTTOM:
_cube.addChild(createElement(6, 0, 100, 0, 90, 0, 0));
return _container;
}
1 l mate later:
Why not combining the ability to scale without quality-loss with actual Multi-Touch gestures?
Here is the result:




