Hello everybody, I want to make a ladder to a plataform game that I'm making...
AS2 Please Help me
Here's the code of the characther (somethings are in spanish)
onClipEvent(load) {
var ground:MovieClip = _root.ground;
var grav:Number = 0;
var gravity:Number = 2;
var speed:Number = 10;
var maxJump:Number = -20;
var touchingGround:Boolean = false;
}
onClipEvent(enterFrame) {
_y += grav;
grav += gravity;
while (ground.hitTest(_x, _y, true)) {
_y -= gravity;
grav = 0;
} if(ground.hitTest(_x, _y+5, true)) {
touchingGround = true;
} else {
touchingGround = false;
}
if(Key.isDown(Key.RIGHT)) {
_x += speed;
}
if (Key.isDown(Key.LEFT)) {
_x -= speed;
}
if(Key.isDown(90) && touchingGround) {
grav = maxJump;
}
}
And the actions:
onClipEvent (enterFrame) {
Jugador = _root.jugador;
if (Key.isDown(Key.RIGHT)) {
Jugador._xscale = 100;
Jugador.gotoAndStop("caminando");
} else if (Key.isDown(Key.LEFT)) {
Jugador._xscale = -100;
Jugador.gotoAndStop("caminando");
} else {
Jugador.gotoAndStop("normal");
}
this._visible = false;
}
(EDIT)
Ah, and I want to make a submit score button or something like that