此函数非常适合那些不需要 粒子发射器 提供的任何函数 (例如,通过导弹产生烟雾或简单的爆炸效果) 的效果,因为它允许您在游戏室的任何位置快速轻松地创建粒子。请注意,必须先创建粒子系统和粒子类型,然后才能使用此函数。
part_particles_create(ind, x, y, parttype, number);
参数 | 类型 | 描述 |
---|---|---|
ind | Particle System Instance | 粒子系统的索引。 |
x | Real | 创建粒子的位置的x坐标。 |
y | Real | 创建粒子的位置的y坐标。 |
parttype | Particle Type ID | 要创建的粒子的索引(类型)。 |
number | Real | 要创建的粒子数。 |
N/A
if (mouse_check_button(mb_left))
{
part_particles_create(sname, mouse_x, mouse_y, p_CursorEffect, 5);
}
上述代码检查是否按下鼠标按钮,如果返回true,则会在鼠标位置生成5个粒子。