Groups | Blog | Home
all groups > flash actionscript > november 2005 >

flash actionscript : How to create a wall in Flash?


meme83
11/21/2005 10:16:31 PM
Im a beginner in flash, and i'm wondering how can i make a graphic in flash
that acts as a 'wall'? such that the player cant walk through it, and bumping
into the wall will stop the player's movement.

do i need to do something like a collision detection?

thanks.
NSurveyor
11/21/2005 10:21:02 PM
sly one
11/21/2005 10:21:41 PM
meme83
11/21/2005 11:57:37 PM
:gift;

Thanks a lot, that works!

Another question. How does one determine a hit test between two objects when
both objects are 'curved shaped'. I understand flash only allows rectangular
bounding boxes, but is there a way around it that is precise ?

I guess one can make multiple bounding boxes to cover the curves of the
object, but its still not very precise.

Much thanks.:rose;
NSurveyor
11/22/2005 12:12:00 AM
I believe you could put tiny "dot" clips along the edge of the curvy object (on
one of them, and set their alpha to 0). Then, when you want to see if the two
objects are touching, you can do a hitTest for each dot clip agains the other
object. Not sure if this is the best way, but I think the idea would work.
Chip W.
11/22/2005 12:59:52 AM
Hey Mem,

peterjoel.com has some real good samples:

http://www.peterjoel.com/Samples/

Interactivity>Bounded Drag - is the one you'd be interested in.

meme83
11/22/2005 2:21:30 AM
Thanks for your help guys!

I found another good tutorial here: http://flash-creations.com/notes/astb_bounceCollide.php

Flash is fun :)

AddThis Social Bookmark Button