满足游戏制造商的条件时如何使对象产生

How to make an object spawn when a condition is met on game maker

我一直在 game maker 上制作游戏,我希望在达到一定分数时在我的房间里生成一个对象。我已经尝试这样做了:

if global.score >= 10
{
    instance_create(obj_flag);
}

但是当我转到 运行 它说“函数 instance_create 的参数数量错误”

如果有人能帮助我,我将不胜感激。 谢谢

我不了解 game-maker,但快速 google 搜索显示 instance_create() 接受三个参数,因此出现关于 参数数量错误的错误 :

http://gamedesign.wikidot.com/gamemaker:instance-create

id = instance_create( x, y, obj );

 id = returned instance id
  x = x location to create object
  y = y location to create object
obj = name of object to create an instance of

instance_create() creates an instance of an object at 
the specified x/y coordinates. It also returns the instance 
id of the instance created, which can be put into a variable
and used to manipulate the instance.

看起来 API 需要您指定创建它的位置。