all groups > flash actionscript > october 2006 >
You're in the

flash actionscript

group:

Collision Detection Help



Collision Detection Help The_Real_Ciber
10/22/2006 10:50:17 PM
flash actionscript: Okay, first take a look at my current collision script:

[quote]if (_root.man.hitTest(_parent.land.clip16) or
_root.man.hitTest(_parent.land.clip22) or _root.man.hitTest(_parent.land.clip1)
or _root.man.hitTest(_parent.land.clip2) or
_root.man.hitTest(_parent.land.clip15) or
_root.man.hitTest(_parent.land.clip20)) {UPmoveSpeed=0
}
else if (Key.isDown(Key.SHIFT)) {UPmoveSpeed=4
} else {
if (Key.isDown(Key.END)) {
if (_root.car==1) {
UPmoveSpeed=8 } } else {
UPmoveSpeed=2 }
}
if (_root.man.hitTest(_parent.land.clip3) or
_root.man.hitTest(_parent.land.clip28) or
_root.man.hitTest(_parent.land.clip27) or
_root.man.hitTest(_parent.land.clip25) or _root.man.hitTest(_parent.land.clip4)
or _root.man.hitTest(_parent.land.clip13)) {LEFTmoveSpeed=0
}
else if (Key.isDown(Key.SHIFT)) {LEFTmoveSpeed=4
}
else {
if (Key.isDown(Key.END)) {
if (_root.car==1) {
LEFTmoveSpeed=8 } } else {
LEFTmoveSpeed=2 }
}
if (_root.man.hitTest(_parent.land.clip5) or
_root.man.hitTest(_parent.land.clip26) or _root.man.hitTest(_parent.land.clip6)
or _root.man.hitTest(_parent.land.clip21) or
_root.man.hitTest(_parent.land.clip23) or
_root.man.hitTest(_parent.land.clip19)) {RIGHTmoveSpeed=0
}
else if (Key.isDown(Key.SHIFT)) {RIGHTmoveSpeed=4
}
else {
if (Key.isDown(Key.END)) {
if (_root.car==1) {
RIGHTmoveSpeed=8 } } else {
RIGHTmoveSpeed=2 }
}
if (_root.man.hitTest(_parent.land.clip8) or
_root.man.hitTest(_parent.land.clip24) or
_root.man.hitTest(_parent.land.clip12) or
_root.man.hitTest(_parent.land.clip0)) {DOWNmoveSpeed=0
}
else if (Key.isDown(Key.SHIFT)) {DOWNmoveSpeed=4
}
else {
if (Key.isDown(Key.END)) {
if (_root.car==1) {
DOWNmoveSpeed=8 } } else {
DOWNmoveSpeed=2 }
}
[/quote]

It's a huge script because it's for my city, each wall (side of street) has
it's own MC and all ties into this.

I was wondering if anyone would be nice enough to help me make a better one :)?

I once saw one where they had an invisible MC with red squares, when you hit
them you stoped, they were all in 1 MC and very small coding.

Anyone have any idea what I mean :(?
Re: Collision Detection Help The_Real_Ciber
10/22/2006 11:57:32 PM
Re: Collision Detection Help The_Real_Ciber
10/23/2006 6:54:57 PM
AddThis Social Bookmark Button