Phaser Weapon插件,设置kill_DISTANCE

Phaser Weapon plugin, set the kill_DISTANCE

我正在使用相位器武器插件,我已将击杀类型设置为 kill_distance:

weapon.bulletKillType = Phaser.Weapon.KILL_DISTANCE;

但是,它会自动设置为 2,这实际上并不能让它行驶很远。我想知道如何将它设置为更大的数字

提前致谢

[static] KILL_DISTANCE : integer A bulletKillType constant that automatically kills the bullets after they exceed the bulletDistance from their original firing position.

不幸的是,我尝试在文档中搜索,但找不到 "bulletDistance"。例如,如果您使用KILL_LIFESPAN,您可以更改bulletLifespan 变量,但文档中没有"bulletDistance"。这要么没有实现,要么他们在文档中忘记了。试试这个,它 may/may 不起作用。

您只需设置 bulletKillDistance:

weapon.bulletKillType = Phaser.Weapon.KILL_DISTANCE;
weapon.bulletKillDistance = 50;

这让我觉得 an oversight in the documentation

更新

This has been updated in the documentation source,一旦有 release/deployment.

应该在线更新