Gamemaker Studio 2中的弹丸未移动

时间:2018-08-22 17:38:43

标签: game-maker gml projectile game-maker-language game-maker-studio-2

我的枪的开始步骤代码:

if (global.night == true) {

    image_angle = point_direction(x, y, mouse_x, mouse_y);
    image_index = 1;
    alarm[0] = 0.5 * room_speed;
    firingdelay -= 1;

    if (mouse_check_button_pressed(mb_left)) && (firingdelay < 0) {

        firingdelay = 10;
        with (instance_create_layer(Revolver.x+12, Revolver.y, "Bullets", Bullet)) {
            direction = Revolver.image_angle;
            speed = 25;
            image_angle = direction;
        } 
    }
}

它会创建子弹,但不会移动。有人可以帮忙吗?

1 个答案:

答案 0 :(得分:1)

如果在房间中启用了物理功能,则常规的速度和方向变量将不起作用。您启用了物理学吗?代码看起来不错。