Compiler errors 读取前未设置点火延迟

Compiler errors 读取前未设置点火延迟,compiler-errors,game-maker-studio-2,Compiler Errors,Game Maker Studio 2,RN我正在使用一个教程,我一直在严格遵循它,但我的代码仍然无法运行 x = oPlayer.x; y = oPlayer.y+10; image_angle = point_direction(x,y,mouse_x,mouse_y); firingdelay = firingdelay - 1; if (mouse_check_button(mb_left)) && (firingdelay < 0) { firingdelay = 5; with (

RN我正在使用一个教程,我一直在严格遵循它,但我的代码仍然无法运行

x = oPlayer.x;
y = oPlayer.y+10;

image_angle = point_direction(x,y,mouse_x,mouse_y);

firingdelay = firingdelay - 1;
if (mouse_check_button(mb_left)) && (firingdelay < 0)
{
    firingdelay = 5;
    with (instance_create_layer(x,y, "Bullet", oBullet))
    {
        speed = 25;
        direction = other.image_angle;
        image_angle = direction;
    }
}
x=oPlayer.x;
y=oPlayer.y+10;
图像角度=点方向(x,y,鼠标x,鼠标y);
firingdelay=firingdelay-1;
如果(鼠标左键)(闪烁延迟<0)
{
飞行延迟=5;
使用(实例创建图层(x,y,“子弹”,oBullet))
{
速度=25;
方向=其他图像角度;
图像角度=方向;
}
}

有什么需要修改的吗?

。。。在gml中读取前未设置它
,通常表示nullreference异常。它试图在变量存在之前使用它

点火延迟
还是
点火延迟
?你在标题中使用了后者
在代码中,这将是两个独立的变量

我认为您需要在Create事件中声明
firingdelay=5