Last experiment

Since everybody’s showcasing their work on the design forum…

The Blob

Pretty unaesthetic, but I like it. Try to click and drag it a bit.

pom :cowboy:

pretty cool… well, give it up!


OMG how do you do these things?
so cool

That is realy quite impressive. I have no idea how that could even be made.

Well, I have a few points that move randomly, and I use a little trick with the curveTo method to get that blob shape. Here is the source:

function doDrag(){
function noDrag(){
	if (!this.pressed)
		if (!(this.loop=(++this.loop)%(5))) {
			this.brownX = (Math.random() - .5) * .35;
			this.brownY = (Math.random() - .5) * .35;}
		this.velX += (-.002 * (this._x - this.centx)) + this.brownX;
		this.velY += (-.002 * (this._y - this.centy)) + this.brownY;
		this._x += (this.velX *= (this.frictionX=.96));
		this._y += (this.velY *= this.frictionX);};
for (var p=0;p < (nClip=10);p++) 
	mid=new Array();
	for (var j=0;j < nClip;j++) 
	this.lineStyle(1, 0, 100);
	this.beginFill(0x384862, 50);
	this.moveTo(mid[0].x, mid[0].y);
	for (j=1;j <= nClip;j++)
		this.curveTo(_root["ball"+j%nClip]._x, _root["ball"+j%nClip]._y, mid[j%nClip].x, mid[j%nClip].y);};

Sorry, it’s a bit messy, I had to crush everything in 25 lines :-\

My God! I hope I can code like that some day. I thought that the Blob looked so cool because it looked organic. You don’t see much organic stuff in flash or at least I don’t.:slight_smile:

I want to code that way too some day…
omg! Gotta start learning flash!

if you delete the line:
mid.push({x:(_root[“ball”+j]._x+_root[“ball”+(j+1)%nClip]._x)/2, y:(_root[“ball”+j]._y+_root[“ball”+(j+1)%nClip]._y)/2});
Then only lines come out of that corner.
I have no idea what’s happening but hey… cool!

I think I understood what each action does
but what does this “%” really do?
I read the flash help but I didn’t understand anything there…
12 % 5 = 2
what does the “%” do?

Actually, what I do is the following:
For each point, draw a line till the next point. My points are put in an array, so I draw a line from point 0 to 1, 1 to 2… 10 to 0.

If I had written [“ball”+(j+1)] only, I wouldn’t have gone back to point 0. With the % trick, (j+1)%nClip will equal 0 when j+1=nClip which is the case at the last turn of the loop.

I hope it’s clearer now :slight_smile: I’ll try and make a readable version of the code, because it’s is really unreadable…

pom :-\

12 % 5 = 2

2 is the remainder after 12 is divided by 5.

The % symbol gets the remainder after the first digit is divided by the second digit.

Am I right Ilyas?

Oups sorry, I didn’t read your question till the end Syko. And yep, Lost, that’s exactly what it does.

Now that makes a bit sense now…
Thanx y’all

I see that you have 10 buttons there and each button streches a part of the …“thing”.
But isn’t there any way to stop the button that you are currently holding down moving itself? You see if you hold a button down for too long it moves away and then if you release the mouse button it’s still streching the …“thing” like if you have moved out of the .swf area…
I hope I’m making sense here… :crazy:

quite nice pom…u could fill it with a gradient to make it even more blob like…dunno just a sugestion :slight_smile:

Well, I suppose I could, Bezzer, but I don’t know how. Maybe if I put the gradient behind, and mask it with the blob… I’ll have to think about that, it sounds like a good idea.

pom :cowboy:

well if ur using api u can just use beginGradientFill instead of begin fill…and then u have to put ur colours and stuff…theres a thing on it in the as dictionary…just look for beginGradientFill :slight_smile: