يكشنبه ۱۷ بهمن ۹۵
سلام خدمت دوستان ! چون من علاقه زیادی به برنامه نویسی و بازی سازی دارم و دوست دارم تو هر دو حوزه همیشه یاد بگیرم و پیشرفت کنم تصمیم گرفتم
دوباره با موتور گیم میکر کار کنم و یه پروژه رو برای خودم به اتمام برسونم برای کسب تجربه !
اینم عکسش :
کد ها در ادامه مطلب ( قدم زدن کاراکتر )
var right_key = keyboard_check(vk_right);
var left_key = keyboard_check(vk_left);
var up_key = keyboard_check(vk_up);
var down_key = keyboard_check(vk_down);
var right = keyboard_check(ord('D')) ;
var down = keyboard_check(ord('S')) ;
var up = keyboard_check(ord('W')) ;
var left = keyboard_check(ord('A')) ;
if (right_key){
phy_position_x += 4 ;
sprite_index=spr_player_right;
image_speed = 0.2;
}
if (left_key){
phy_position_x -= 4 ;
sprite_index= spr_player_left;
image_speed = 0.2;
}
if (up_key){
phy_position_y -= 4 ;
sprite_index= spr_player_up;
image_speed = 0.2;
}
if (down_key){
phy_position_y += 4 ;
sprite_index= spr_player_down;
image_speed = 0.2;
}
/// key
if (right){
phy_position_x += 4 ;
sprite_index=spr_player_right;
image_speed = 0.2;
}
if (left){
phy_position_x -= 4 ;
sprite_index= spr_player_left;
image_speed = 0.2;
}
if (up){
phy_position_y -= 4 ;
sprite_index= spr_player_up;
image_speed = 0.2;
}
if (down){
phy_position_y += 4 ;
sprite_index= spr_player_down;
image_speed = 0.2;
}
if ( !right_key and !left_key and !down_key and !right and !down and !up and !left and !up_key ) {
image_speed = 0 ;
image_index = 0 ;
}