Categories
Speaking

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)
	}
}

8 replies on “Give an infinite amount of coders an infinite number of laptops…”

Watched the video, I wish had that kinda of community in Chicago. Does the “g” graphic have a purpose? Keep up the great work, can’t wait to see you on Sunday!

@Seb, hehehe yeah no idea who put that one in! Other amusing function names of the evening were “updateWriggle()” and “f*ckingYeah()”. Shame that hammer time never happens… perhaps we should try uncommenting the listener and see what happens?

@RyanP why not start one up yourself? It’s not that difficult, and I’m sure there are plenty of Flashers in the windy city! I wrote the “g” bit – it’s just so that I didn’t have to keep typing sprite.graphics! 🙂

All the best things happen in Brighton, like Flash Groups and piers. Time to get back to my own hammerTime functions anyway.

I know “g” is just an instance of the graphics class, but it was just another test of equations that isn’t being drawn, it might be best to comment the rest of those three lines out to save on unneeded processor speed, it’s already pretty intensive power wise with those equations. Defiantly will look into the flash community in the Chicago area, right now we have a flex UG, but I’m not sure how much they actually focus on aS.

@RyanP oops sorry totally misunderstood you there! Yep there’s loads of crap in there that you could take out, but I thought I’d leave it there as an interesting insight into the “process” 🙂

I think it would be cool if we could do this sort of thing at a conference, like FOTB. Have like 10 teams or so, with 5 people a team, and 5 minutes a person. Maybe even voting at the end for best result, just an idea 🙂

Comments are closed.