Seb Lee-Delisle

Menu

Give an infinite amount of coders an infinite number of laptops…

… and you should get the Flash equivalent of Hamlet.

Well that’s the theory at least. However we only had seven coders and seven laptops, so we ended up with seven different types of crap. 🙂

At tonight’s FlashBrighton session we had a Flash Pass-the-Parcel, where we all got 5 minutes on each computer before shuffling along onto the next computer.

It’s quite an alarming experience, to be confronted with a timeline of code, you have no idea what the person before you was attempting, whether it’s working and how to improve it. But it was also bloody good fun, and nice for once having no criteria to work towards.

Due to the nature of Flash the work tended to be quite generative-art-like, and some of it really was dreadful. But somehow we managed to craft this little nugget out of the chaos.


[sorry, content no longer available]

And Aral crashed as well to talk to us about his Head conference :


[sorry, qik video no longer available]

And here’s the source code if you’re interested, including all the crap we left in 🙂 It should just work on the timeline if you paste it in.

var WIDTH : int = 450;
var HEIGHT : int = 300;
var bitmapData : BitmapData = new BitmapData(WIDTH,HEIGHT,false, 0x000000);
var bitmap : Bitmap = new Bitmap(bitmapData);
addChild(bitmap);
 
var sprite : Sprite = new Sprite();
addChild(sprite);
sprite.filters=[new GlowFilter(0xf0f0f0,1,6,6,2,1,true),new DropShadowFilter()];
 
//sprite.addEventListener(MouseEvent.CLICK, hammerTime);
 
var colorTransform : ColorTransform = new ColorTransform(0.99,0.99,0.99);
var blurFilter : BlurFilter = new BlurFilter(4,4,1);
 
addEventListener(Event.ENTER_FRAME, enterFrame);
 
var inc1:int = 0;
var inc2:int = 600;
var angle:Number = 0;
function enterFrame(e:Event)
{
	var g : Graphics = sprite.graphics;
	g.clear();
	g.lineStyle(Math.random()*3, 0xcc00cc);
	g.moveTo(Math.cos(angle)*inc2,Math.sin(angle)*inc1);
	//g.lineTo(Math.sin(angle)*inc1,Math.cos(angle)*inc2);
 
	var f : Graphics = sprite.graphics;
	//f.clear();
	f.lineStyle(10, 0xf5f5f5);
	f.moveTo(275+Math.sin(angle)*inc2,200+Math.cos(angle)*inc2);
	f.lineTo(275+Math.cos(angle)*inc1,200+Math.sin(angle)*inc1);
 
	inc1+=1;
	inc2+=1;
	angle += 0.04;
 
	if (inc1 > stage.stageWidth) inc1 -= stage.stageWidth;
	if (inc2 > stage.stageHeight) inc2 -= stage.stageHeight;
 
	if(inc1%4==0)
	{
		bitmapData.colorTransform(bitmapData.rect, colorTransform);
		bitmapData.applyFilter(bitmapData,bitmapData.rect, bitmapData.rect.topLeft, blurFilter);
	}
	bitmapData.draw(sprite);
}
 
function hammerTime(e:Event):void
{
	var isOn:Boolean = hasEventListener(Event.ENTER_FRAME);
 
	if (isOn){
		removeEventListener(Event.ENTER_FRAME, enterFrame);
	} else {
		addEventListener(Event.ENTER_FRAME, enterFrame)
	}
}
This entry was posted in Community, Flash, Speaking. Bookmark the permalink.

8 Responses to Give an infinite amount of coders an infinite number of laptops…