[英]Projectiles In Gamemaker Studio 2 Not Moving
My gun's begin step code: 我的枪的开始步骤代码:
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;
}
}
}
It creates the bullets, but they don't move. 它会创建子弹,但不会移动。 Can anyone help? 有人可以帮忙吗?
If you have physics enabled in a room, the regular speed and direction variables will not work. 如果您在房间中启用了物理功能,则常规的速度和方向变量将不起作用。 Do you have physics enabled? 您启用了物理学吗? The code looks fine. 代码看起来不错。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.