I am making a labyrinth in Adobe Flash at my school. I have
already made the ball, which you must play with through the
labyrinth. You click the ball with mouse and move it with your
mouse. How I get the walls of the labyrinth to be solid that the
ball cant go over the walls?
Is there any way to make it solid? Another idea I had is to
make te ball jump one pixel farther from the wall when it touches
I have tried some several scripts, but all I have achieved is
that the ball jumps over the wall, so in a way the wall is solid,
but I want the ball to bounce from the wall.
The game is simple. The ball is drawn movieclip and the walls
are lines made into movieclip.
Generally, start doing some reading on collision detection in
Flash. How you
implement it depends on how your maze is setup. If you use
instance, it's pretty easy to just check the oncoming tile to
see if it is
ok to move to it. If you're trying to use a bitmap, you could
movieClip.hitTest, but there are many ways. Check Grant
Skinner's blog for
some good collision detection stuff.