Código: Selecionar todos
if place_free(x,y+2)
{gravity=1}
else
{gravity=0}
if rast = 1
{
mask_index = player_parado;
sprite_index = player_parado;
if keyboard_check_pressed(vk_left)
{hspeed-=2;
image_speed = 1.5;
sprite_index=player_andandoe_squerda;}
if keyboard_check_pressed(vk_right)
{hspeed+=2;
image_speed = 1.5;
sprite_index=player_andando_direita;}
if keyboard_check_released(vk_left)
{hspeed=0;
sprite_index=player_andandoe_squerda;
image_index=6;image_speed=0;}
if keyboard_check_released(vk_right)
{hspeed=0;
sprite_index=player_andando_direita;
image_index=6;image_speed=0;}
}
if rast = 2
{
mask_index = player_rastejando_parado;
sprite_index = player_rastejando_parado;
if keyboard_check_pressed(vk_left)
{hspeed-=2;
image_speed = 1.5;
sprite_index=player_rastejando_esquerda;}
if keyboard_check_pressed(vk_right)
{hspeed+=2;
image_speed = 1.5;
sprite_index=player_rastejando_esquerda;}
if keyboard_check_released(vk_left)
{hspeed=0;
sprite_index=player_rastejando_esquerda;
image_index=1;image_speed=0;}
if keyboard_check_released(vk_right)
{hspeed=0;
sprite_index=player_rastejando_direita;
image_index=1;image_speed=0;}
}
if rast = 1
{
if keyboard_check_pressed(vk_control)
{
rast += 1;
}
}
if rast = 2
{
if keyboard_check_pressed(vk_control)
{
rast -= 1;
}
}
if place_free(x,y-2)
{if sprite_index=pulo_player
{if hspeed=0
{sprite_index=player_parado}
else{sprite_index=player_andando_direita}}}
if place_free(x,y+2)
{sprite_index=pulo_player}
if (xprevious > x) {
image_xscale=-2}
else if (xprevious < x){
image_xscale=2
}
if not place_free(x+hspeed,y){ hspeed = 0 }
if keyboard_check_pressed(vk_up)
{if !place_free(x,y+2)
{vspeed=-15
sprite_index=pulo_player
}}
if sprite_index=pulo_player
{
image_index= 3;
image_speed= 0;
}