Comunidad Game Maker

Ayuda => Preguntas y respuestas => Mensaje iniciado por: shaggymon en Agosto 08, 2011, 09:58:58 AM

Título: ?Como golpear a enemigos?
Publicado por: shaggymon en Agosto 08, 2011, 09:58:58 AM
Hola, una consulta , como puedo hacer que mi personaje al golpear tres veces a un enemigo lo elimine  ? ... me pasa que lo mata al primer golpe x.x

estoy usando este script..


[gml]

CREATE EVENT
combo=0

STEP EVENT
if keyboard_check_pressed(ord('X')){

  switch(combo){
  case 0:
    image_index=0;
    sprite_index=n_attack;
    combo=1;
  break;
  case 1:
    if sprite_index=n_attack and image_index>2.3 {
      image_index=0;
      if keyboard_check(vk_up){
        sprite_index=n_attack_3;
      } else {
        sprite_index=n_attack_2;
      }
      combo=2;
    }
  break;
  case 2:
    if sprite_index=n_attack_2 and image_index>2.5 {
      image_index=0;
      if keyboard_check(vk_up){
        sprite_index=n_attack_2;
      } else {
        sprite_index=n_attack_3;
      }
      combo=2;

 
}}
}[/gml]
Título: Re: ?Como golpear a enemigos?
Publicado por: Gabriel Moreno en Agosto 09, 2011, 02:01:31 AM
Flata El Codigo En Donde Muere El Enemigo -_-"
Título: Re: ?Como golpear a enemigos?
Publicado por: Zedenox en Agosto 09, 2011, 03:02:51 AM
oye si, yo tambien intente algo asi y no funciono.
si quieres crear un juego de plataformas, te recomiendo q visites mi post, es un creador de plataformas : https://sites.google.com/site/gmzedenox/files/GMWorldEditor-1.0.zip?attredirects=0&d=1

chao