[Solved] AS2 Uphill issues
As the title says, I have an object moving downhil just fine but instead of moving uphill it will move through the hill.
How do I make it move along the uphill slope?
Code:
onClipEvent (load) {
grav = 0;
spd = 1;
}
onClipEvent (enterFrame) {
if (_root.ground.hitTest(this._x, this._y, true)) {
grav = 0;
this._x += spd;
} else {
grav += 0.3;
if (grav>5) {
grav = 5;
}
}
this._y += grav;
}
Edit: So it wont let me upload an attachment so ima try this
-O-----O <--- there are 2 balls here, gravity makes them fall hitting the downslope.
\........../ They slide down normally and move to the other side.
\\____ // Where the Uphill for each begins. They will pass through the uphill like it was a flat surface. I hope this helps explain what i mean.
If not please ask for more description.