【问题标题】:Projectiles In Gamemaker Studio 2 Not MovingGamemaker Studio 2 中的弹丸不动
【发布时间】:2018-08-22 17:38:42
【问题描述】:

我的枪的开始步骤代码:

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;
        } 
    }
}

它会产生子弹,但它们不会移动。有人可以帮忙吗?

【问题讨论】:

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


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 2021-10-09
      • 2022-08-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-11-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多