Códigos Juegos Flash

También podría gustarte

Está en la página 1de 2

Código jugador

onClipEvent (load) {
xvel = 6;
yvel = 0;
salto = -14;
limite = 10;
}
onClipEvent (enterFrame) {
if (_root.suelo.hitTest(_x, _y+_height/2, true)) {
while (_root.suelo.hitTest(_x, -2+_y+_height/2, true)) {
_y--;
}
yvel = 0;
if (Key.isDown(Key.UP)) {
yvel = salto;
_y += yvel;
}
} else if (_root.suelo.hitTest(_x, _y-_height/2, true)) {
yvel = yvel*-1;
_y += yvel;
while (_root.suelo.hitTest(_x, _y-_height/2, true)) {
_y++;
}
} else {
_y += yvel;
if (yvelAAAAAAAAAAAA=limite) {
yvel++;
}
}
_x += (Key.isDown(Key.RIGHT)-Key.isDown(Key.LEFT))*xvel;
while (_root.suelo.hitTest(_x+_width/2, _y, true)) {
_x--;
}
while (_root.suelo.hitTest(_x-_width/2, _y, true)) {
_x++;
}
}
onClipEvent (enterFrame) {
if(Key.isDown(Key.LEFT)){
this._xscale = -100
}else
if(Key.isDown(Key.RIGHT)){
this._xscale = 100
}
}
Códigos de "siguiente"
onClipEvent(enterFrame){

if(this.hitTest(_root.personaje)){

_root.nextFrame();

onClipEvent(enterFrame){

if(this.hitTest(_root.personaje)){

_root.gotoAndStop(1);

Código hipervínculo
on(release) {
getURL("http://www.google.com","_self");
}

También podría gustarte