M
Mevxill
Guest
hello i code animation idle no working
var Right_key = keyboard_check(vk_right);
var Left_key = keyboard_check(vk_left);
// moveRight
if (Right_key){
phy_position_x += spd;
sprite_index = player_walk;
image_speed =10;
Direction = "Right"
}
}
// moveleft
if (Left_key){
phy_position_x -= spd;
sprite_index = player_walkleft;
image_speed = 10;
Direction = "Left"
}
if(!Right_key) and (!Left_key){
if(Direction = "Right"){
sprite_index = player_idle
}
if(Direction = "Left"){
sprite_index = player_idleleft
}
}
var Right_key = keyboard_check(vk_right);
var Left_key = keyboard_check(vk_left);
// moveRight
if (Right_key){
phy_position_x += spd;
sprite_index = player_walk;
image_speed =10;
Direction = "Right"
}
}
// moveleft
if (Left_key){
phy_position_x -= spd;
sprite_index = player_walkleft;
image_speed = 10;
Direction = "Left"
}
if(!Right_key) and (!Left_key){
if(Direction = "Right"){
sprite_index = player_idle
}
if(Direction = "Left"){
sprite_index = player_idleleft
}
}
Last edited by a moderator: