Ver Mensaje Individual
  #1 (permalink)  
Antiguo 09/12/2004, 17:25
Avatar de martinnieves
martinnieves
 
Fecha de Ingreso: diciembre-2004
Ubicación: San Bernardo del Tuyu, Partido de La Costa, Buenos Aire, Argentina
Mensajes: 33
Antigüedad: 19 años, 4 meses
Puntos: 0
Exclamación ESPECIFICAMENTE.... Necesito esto... Porfa, alguien que sepa ActionScript...

Buenas nuevas... como ya escribi antes, estoy haciend un juego, hay varias cosas que pudieron aclararme, pero el siguiente problema aun no... favor de que alguien me ayudeeeeeeeeee....


lo que necesito es lo siguiente:

PULSANDO LA TECLA ESPACIADORA (SPACE) QUIERO QUE MI PERSONAJE SE MUEVA SOBRE EL EJE Y (VERTICAL) UNOS 100 PX APROX. PERO QUE ESTO LO HAGA UNA DE DOS VECES QUE SE PULSE LA TECLA... ES DECIR, QUE UNA VEZ LO HAGA Y QUE LA OTRA NO, QUE A CONTINUACION VUELVA A HACERLO Y QUE LA PROXIMA NO... Y ASI...

El codigo que utilice para controlar a mim personaje (llamado "gomin"), es el siguiente:



/////////////////////////////////////////////////////////////////////////////////////


// Comienzo del codigo //


onClipEvent (enterFrame) {
if (_root.started && _root._currentframe==1) {
with (_root.gomin) {
//
// Acciones desde las teclas

// Caminar hacia la derecha
if (Key.isDown(Key.LEFT)) {
_x -= 10;
}

// Caminar hacia la izquierda
if (Key.isDown(Key.RIGHT)) {
_x += 10;
}

// Saltar (90% mas que el andar)
if (Key.isDown(Key.SPACE)) {
_Y -= 100;
}



// Detectar si hay obstaculos con el hitTEST (con 10 pixeles de tolerancia izquierda)
if (walls.hitTest(getBounds(_root).xMax, _y, true)) {
_x -= 10;
}

// Detectar si hay obstaculos con el hitTEST (con 10 pixeles de tolerancia derecha)
if (walls.hitTest(getBounds(_root).xMin, _y, true)) {
_x += 10;
}

// Detectar si hay obstaculos con el hitTEST (con 10 pixeles de tolerancia inferior)
if (walls.hitTest(_x, getBounds(_root).yMax, true)) {
_y -= 8;
}

// Detectar si hay obstaculos con el hitTEST (con 10 pixeles de tolerancia superior)
if (walls.hitTest(_x, getBounds(_root).yMin, true)) {
_y += 5;
}


// Bucle final
if (_root.goal.hitTest(_x, getBounds(_root).yMax, true)) {
_root.gotoandstop(3);
}
}
}
}


// Fin del codigo

///////////////////////////////////////////////////////////////////////////////////////


Siendo el siguiente codigo el que quiero modificar para que la accion se lleve a cabo una de cada dos veces:

if (Key.isDown(Key.SPACE)) {
_Y -= 100;
}

Recuerden que es para que el personaje salte, si alguien tiene otra idea, ACEPTO SU OPINION!!...

Gracias de nuevo!!!