The Holy Grail of Flash

Posted by DesertFox on May 17, 2007, 3:03 p.m.

The Holy Grail of Flash

As any of you who have messed with Actionscript know, smooth collision detection is the Holy Grail of flash game developers.

Suprisingly enough, Flash only has bounding box collision detection, and no built-in smooth collision detection. Now, there are plugins or something that you can buy (I've only found 1 though), but they cost money.

It wouldn't have been very hard for the Flash Developers to code in advanced collision detection, but they didn't. So I did. Smooth, complex-polygon collision detection. It is pure awesomeness, and way better than the default hitTest() which uses bounding boxes only. I wrote this in just under 2 days, and I'll post the actionscript files if you want me to. This code can be used in any language (allowing for syntax changes) like C++, for game development and complex-polygon collision detection.

Its fricken sweet. If you don't think it's fricken sweet, go make your own smooth collision detection in 2 days. From scratch. Remember, Flash doesn't even have built-in line-segment intersection code.

*may take a few seconds to load

*to see the new version, clear your cache!

<p align=center><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="550" height="400" id="Collider" align="middle">

<param name="allowScriptAccess" value="sameDomain" />

<param name="movie" value="Collider.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><embed src="http://64digits.com/users/DesertFox/Collider.swf" quality="high" bgcolor="#ffffff" width="550" height="400" name="Collider" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />

</object></p>

And I invoke [url=http://en.wikipedia.org/wiki/Godwin's_Law]Godwin's Law

<p align=center>*cough*Hitler*cough*<br><br>*cough*Watermelons*cough*</p>

Comments

Dragonos 17 years, 5 months ago

lol

Nice collision detection

twisterghost 17 years, 5 months ago

Hitler only had one testicle.

-Fact.

Jaxx 17 years, 5 months ago

Actually TG is right XD

sirxemic 17 years, 5 months ago

Hitler has only got one ball,

Göring has two but very small,

Himmler is somewhat sim'lar,

But poor old Goebbels has no balls at all.

Dragonos 17 years, 5 months ago

I win!!!

frenchcon1 17 years, 5 months ago

Hitler

Has only got one ball!

The other

Is in the Albert Hall

His mother

The dirty bugger

Sucked it off when he was small

sirxemic 17 years, 5 months ago

Oh and BTW how can we trust you whether it is actually polygon-intersection? Maybe it is just line-line intersection…

DesertFox 17 years, 5 months ago

@Dragonos - Nice - thats because you are overlapping them by just about a pixel =D Or *gasp* you edited the pic!

@Cat - I give you a challenge - make your own complex polygon collision detection. You can't do it without line-intersection detection. But its not JUST line-intersection detection. What if a poly completely surrounds another poly? No intersection, but its still colliding with it.

OL 17 years, 5 months ago

Nice work.

WaleedAmer 17 years, 5 months ago

VERY nice job. I can't use AS for my life…