I'm trying to make my character jump while using slope detection... I have the slope detection down but not the jumping...How can i make him jump?? For my slope detection im detecting the slope of the line between the two dots beside the characters feet and rotating the character accordingly..
this is the Jump actionscript i have so far.
g is a var =grav
jumpheight is also a var
and speed is aswell
if (Key.isDown(Key.SPACE) && player.ground.hitTest(_x, _y, true)) {
player.g =- jumpHeight;
player._y -= 4;
player.gotoAndStop(2);
}
if (player.ground.hitTest(_x+(_width/2)+ex, _y-(_height/2), true) || player.ground.hitTest(_x+(_width/2)+ex, _y-(_height/6), true) || player.ground.hitTest(_x+(_width/2)+ex, _y-_height, true)) {
player._x -= speed;
}
if (player.ground.hitTest(_x-(_width/2)-ex, _y-(_height/2), true) || player.ground.hitTest(_x-(_width/2)-ex, _y-(_height/6), true) || player.ground.hitTest(_x-(_width/2)-ex, _y-_height, true)) {
player._x += speed;
any help would be apreciated
Portal


