Weapon#bulletKillType

bulletKillType : integer

This controls how the bullets will be killed. The default is Phaser.Weapon.KILL_WORLD_BOUNDS.

There are 7 different "kill types" available:

  • Phaser.Weapon.KILL_NEVER
    The bullets are never destroyed by the Weapon. It's up to you to destroy them via your own code.

  • Phaser.Weapon.KILL_LIFESPAN
    The bullets are automatically killed when their bulletLifespan amount expires.

  • Phaser.Weapon.KILL_DISTANCE
    The bullets are automatically killed when they exceed bulletDistance pixels away from their original launch position.

  • Phaser.Weapon.KILL_WEAPON_BOUNDS
    The bullets are automatically killed when they no longer intersect with the Weapon.bounds rectangle.

  • Phaser.Weapon.KILL_CAMERA_BOUNDS
    The bullets are automatically killed when they no longer intersect with the Camera.bounds rectangle.

  • Phaser.Weapon.KILL_WORLD_BOUNDS
    The bullets are automatically killed when they no longer intersect with the World.bounds rectangle.

  • Phaser.Weapon.KILL_STATIC_BOUNDS
    The bullets are automatically killed when they no longer intersect with the Weapon.bounds rectangle.
    The difference between static bounds and weapon bounds, is that a static bounds will never be adjusted to
    match the position of a tracked sprite or pointer.

Source code: plugins/weapon/WeaponPlugin.js (Line 1136)
doc_phaser
2017-02-14 11:19:45
Comments
Leave a Comment

Please login to continue.