Comunidad Game Maker

Ayuda => Preguntas y respuestas => Mensaje iniciado por: The-King-Makero en Diciembre 09, 2009, 06:29:43 AM

Título: [AYUDA]Perseguir en juego de Pok?mon
Publicado por: The-King-Makero en Diciembre 09, 2009, 06:29:43 AM
Bueno hola a todos  8) !
Mi problema es que estoy creando un juego de pokemon y quiero ponerle que el pokemon ''te siga'' PERO, respetando la cuadricula 16x16, nose si se les ocurre algun script se los agradeceria mucho...
PD: si les srive de algo les dejo el script del steep del Char... desde ya GRACIAS...  XD

if (place_snapped(16,16) && alarm[0]=-1 && global.canmove) {
if (moving && !hitblock && !cycling && global.canrun)
{running=keyboard_check(ord("X"))}
if (!moving && global.havebike && keyboard_check_pressed(vk_backspace))
{cycling=!cycling}if (moving=1 && !keyboard_check(vk_up) &&
!keyboard_check(vk_down) && !keyboard_check(vk_left) &&
!keyboard_check(vk_right)) {moving=0; running=0; image_index=0;}

if (keyboard_check(vk_left)) {if (moving) {direction=180;}
if (!moving) {if (direction=180) {step=!step
if (!step) {image_index=1} else {image_index=3}moving=1;
} else {alarm[0]=4; direction=180; image_index=3;}}}
   
if (keyboard_check(vk_right)) {if (moving) {direction=0}
if (!moving) {if (direction=0) {step=!step
if (!step) {image_index=1} else {image_index=3}moving=1;
} else {alarm[0]=4; direction=0; image_index=3;}}}

if (keyboard_check(vk_up)) {if (moving) {direction=90;}
if (!moving) {if (direction=90) {step=!step
if (!step) {image_index=1} else {image_index=3}
moving=1;} else {alarm[0]=4; direction=90; image_index=3;}}}

if (keyboard_check(vk_down)) {if (moving) {direction=270;}
if (!moving) {if (direction=270) {step=!step
if (!step) {image_index=1} else {image_index=3}
moving=1;} else {alarm[0]=4; direction=270; image_index=3;}}}

if (direction=0) {sprite_index=spr_char_6;
if (running) {sprite_index=spr_char_r6;}
if (cycling) {sprite_index=spr_char_b6;}}

if (direction=90) {sprite_index=spr_char_8;
if (running) {sprite_index=spr_char_r8;}
if (cycling) {sprite_index=spr_char_b8;}}

if (direction=180) {sprite_index=spr_char_4;
if (running) {sprite_index=spr_char_r4;}
if (cycling) {sprite_index=spr_char_b4;}}

if (direction=270) {sprite_index=spr_char_2;
if (running) {sprite_index=spr_char_r2;}
if (cycling) {sprite_index=spr_char_b2;}}}

hitblock=0;
if (running or cycling) {movespeed=4}
if (!running && !cycling) {movespeed=2}
if (moving && global.canmove) {
image_speed=0.2 speed=movespeed;
if (running or cycling) {image_speed=0.3.3}
} else {speed=0; image_speed=0;}
depth=-(y/100)
Título: Re: [AYUDA]Perseguir en juego de Pok?mon
Publicado por: Legendar en Diciembre 10, 2009, 03:40:41 AM
Bueno, no tengo el Game Maker instalado en mi PC por el momento, pero por lo que veo en el script, lo primero que hace el script es comprobar que el objeto este alineado 16x16, por ende, lo que pongas abajo de esa linea, tambien va a tener que respetar esa "alineaci?n". Yo creo que con un move_towards_object() estar?as hecho.