Schlave
10-19-2001, 04:52 AM
okay I'd solved my previous problem about the "person" not being able to land.
Now when the person touches the side of the "block", I can't get him to stop moving to the side (i.e. he moves into the "block").
What should I do?
Code for "person":
onClipEvent (enterFrame) {
if (this.hitTest(_root["block"])) {
this._y += 0;
//here's the problem: what to put?
} else {
this._y += 4;
}
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT)) {
_root.person._x+=5;
}
if (Key.isDown(Key.LEFT)) {
_root.person._x-=5;
}
}
Now when the person touches the side of the "block", I can't get him to stop moving to the side (i.e. he moves into the "block").
What should I do?
Code for "person":
onClipEvent (enterFrame) {
if (this.hitTest(_root["block"])) {
this._y += 0;
//here's the problem: what to put?
} else {
this._y += 4;
}
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT)) {
_root.person._x+=5;
}
if (Key.isDown(Key.LEFT)) {
_root.person._x-=5;
}
}