deviant art

Deviant Login Shop  Join deviantART for FREE Take the Tour
[x]
Download File
SWF, 1.6 KB
more ▶

More from =psykopath

Featured in Groups:

Details

January 3, 2007
1.6 KB
550×400
Link
Thumb

Statistics

Comments: 13
Favourites: 4 [who?]

Views: 771 (0 today)
Downloads: 40 (0 today)
[x]
:iconpsykopath:
I was getting tired of working on my game so I whipped this up just for something to do.

The balls move around by themselves and when they are close they connect, and are pulled toward each other.

If a bunch get stuck together than you can hold your mouse button down and any balls near it will stop being gravitified.
Add a Comment:
 
:iconshnitzelkiller:
Wow, I love the color transitions, and even the thickness is inherited on both ends! Is there some function for transitions like this, or did you code it yourself? (I don't quite understand hexadecimals.)
Reply
:iconpsykopath:
The way I did this is the lines connecting them aren't actually lines, they're polygons. That way I can taper the edges as I want. And it's just filled with a properly rotated gradient.
Reply
:iconshnitzelkiller:
So, you didn't use graphics.lineTo(x,y) or anything? (I'm assuming AS3 here)
Reply
:iconpsykopath:
Yeah, I used lineTo, but with an invisible line.

moveTo()
lineStyle() //make line invisible
beginFill() //fill with gradient
lineTo()
.....
lineTo()
endFill()


I've left out the arguments, but that's the jist of it.
Reply
:iconshnitzelkiller:
So, the shapes which resemble thick lines are actually fills and you somehow coded a roundish boundary with lots of lines? It doesn't seem to lag at all, so i must have misunderstood.
Reply
:iconpsykopath:
Also, this original deviation is only AS2.
Reply
:iconpsykopath:
There are four points, connected and filled with a gradient.

[link] This is AS3 (uses the graphics class, and drawCircle), but you can easily adapt to AS2 if that's what you use.
Reply
:iconshnitzelkiller:
No, I use AS3 too.
Reply
:iconbaldil:
Very Impressive
Reply
:iconwonderwhy-er:
Heh cool. You should do it so that i can pool balls with mouse.
What kind of game are you doing?
Reply
Add a Comment: