obj_player
Step Event
{
if(keyboard_check(vk_right) && place_free(x+3,y) && sprite_index != stickman_player_attack){
x+=3;
sprite_index = stickman_player_run;
image_speed = .2;
image_xscale = 1;
}
if(keyboard_check(vk_left) && place_free(x-3,y) && sprite_index != stickman_player_attack){
x-=3;
sprite_index = stickman_player_run;
image_speed = .2;
image_xscale = -1;
}
if(keyboard_check(vk_up) && place_free(x,y-3) && sprite_index != stickman_player_attack){
y-=3;
sprite_index = stickman_player_run;
image_speed = .2;
}
if(keyboard_check(vk_down) && place_free(x,y+3) && sprite_index != stickman_player_attack){
y+=3;
sprite_index = stickman_player_run;
image_speed = .2;
}
if(keyboard_check_pressed(ord('C')) && sprite_index != stickman_player_attack) {
sprite_index = stickman_player_attack;
image_speed = .5;
}
if(!keyboard_check(vk_right) && !keyboard_check(vk_left) && !keyboard_check(vk_up) && !keyboard_check(vk_down)) {
image_speed = 0;
sprite_index = stickman_player_stand;
}
if(global.hp <= 0) sprite_index = stickman_player_dead;
}
Neformátovaný
Přidáno: 26.3.2015
Expirace: Neuvedeno