ForumsProgramming ForumNeed Help!

16 5255
Maaron
offline
Maaron
47 posts
Nomad

Hey all,

I'm trying to make a maze game but everytime I try and draw the walls and convert them to a movieclip the blue box around it becomes massive.

http://farm4.static.flickr.com/3034/3014833498_2c05f2c9d4_o.png

^^^ScreenShot^^^

How do I fix this. Thanks in advance.

  • 16 Replies
Greenfaerie
offline
Greenfaerie
56 posts
Nomad

That blue box looks fine to me. If it gets any larger than it should, though, it means you've drawn something really small and out of sight on the same layer and it's getting converted along with the wall. Try just selecting that line before converting, and not the whole layer.

Maaron
offline
Maaron
47 posts
Nomad

The thing is my character doesn't even need to touch the wall to lose, all he needs to do is touch the blue box, how do i fix this.

Greenfaerie
offline
Greenfaerie
56 posts
Nomad

Unfortunatly that is nto something I can help with, I do flash animation, not games sorry.

dank
offline
dank
986 posts
Peasant

I assume you're using a basic hit test and are therefor are checking against the bounding boxes. What you need to do is use a point hitest with shapeflagging and test the xy coords with the wall.

Maaron
offline
Maaron
47 posts
Nomad

Could you point me to a tutorial for that?

Maaron
offline
Maaron
47 posts
Nomad

Can someone please show me where I could find a tutorial for that? Thanks.

Captain_J_Sheridan
offline
Captain_J_Sheridan
313 posts
Nomad

Joey just explained it in this other thread

http://armorgames.com/community/thread/2243587/collision-detection-in-flashdevelop

Maaron
offline
Maaron
47 posts
Nomad

Oh dam, I forgot to tell you guys, I only use AS 2.0, in that other thread its AS 3.0.

IQAndreas
offline
IQAndreas
299 posts
Peasant

Otherwise you could try creating several "segments" of wall, instead of one big curvy line. That way it will run faster by using bounding box hit testing.

It might even look smoother.

LonLonRanch
offline
LonLonRanch
172 posts
Nomad

What is the hitTest code you are using right now? I imagine you would be looking to do something like this:

if (Wall.hitTest(player._x, player._y, true){
trace("hit"
}

Captain_J_Sheridan
offline
Captain_J_Sheridan
313 posts
Nomad

Is this AS 2 LonLonRanch? If so, the "true" is for shape instead of the bounding box?

Maaron
offline
Maaron
47 posts
Nomad

Hey all,

Sorry I haven't replied, I've been busy with school stuff. Anyway here is the code I'm using, no errors are coming up but it just isn't working.


Player.onEnterFrame = function() {
if (Wall.hitTest(Player._x, Player._y, true)) {

I have no idea why it Isn't working, please help me.

Maaron
offline
Maaron
47 posts
Nomad

Never mind everybody, I got it working, I just didn't have the right instance name on my wall, i can't believe I've wasted so much time because of that, anyway thank you all again for your help.

Jeronimo
offline
Jeronimo
53 posts
Nomad

blue box means its grouped, Crtl+B to break

PixelSmash
offline
PixelSmash
566 posts
Nomad

Glad you got it working. I've had that same error quite a few times, where you waste many hours trying to fix a bug, while the error is somewhere else... mindbreaking O_o

Showing 1-15 of 16