hola amigos quisiera saber como hacer que cuando termine el salto de mi mono y vaya callendo cambie el sprite y cuando no tenga un objeto solido debajo de el tenga la animacion de cuando se cae el codigo del salto es este if not place_free(x+0,y+1)
vspeed=-7
if global.direccion=1
{
sprite_index=spr_mono_jumpR;
}
if global.direccion=0
{
sprite_index=spr_mono_jumpL;
}
gracias de antemano
Te doy unos c?digos para cambio de sprites de tu personaje en donde viene incluido eso que pides ;)
En el evento Step:
[gml]if (vspeed < 0)
{
if (left == true) { sprite_index = saltandoizq; }
if (right == true) { sprite_index = saltandoder; }
}
if (vspeed > 0)
{
if (left == true) { sprite_index = cayendoizq; }
if (right == true) { sprite_index = cayendoder; }
}
if (!place_free(x,y+1))
{
if (left == true) { sprite_index = caminandoizq; }
if (right == true) { sprite_index = caminandoder; }
}
if (left == true && !keyboard_check(vk_left) && !place_free(x,y+1))
{ sprite_index = detenidoizq; }
if (right == true && !keyboard_check(vk_right) && !place_free(x,y+1))
{ sprite_index = detenidoder; }[/gml]
En Create:
[gml]left = false;
right = true;[/gml]
En Right:
[gml]left = false; right = true;[/gml]
Y en Left:
[gml]left = true; right = false;[/gml]
As? conseguir?s un buen cambio de sprites (incluyendo el de la ca?da) ?Suerte! ;)
muchas gracias si me funciono
saludos
Claro, de nada :) ?Suerte con tu proyecto! ;)
muchas gracias!!! oye no sabes como hacer que camine en terreno inclinado???
saludos
Para otra pregunta otro tema.