Weapon#setBulletFrames()

setBulletFrames(min, max, cycle, random) → {Phaser.Weapon}

Sets the texture frames that the bullets can use when being launched.

This is intended for use when you've got numeric based frames, such as those loaded via a Sprite Sheet.

It works by calling Phaser.ArrayUtils.numberArray internally, using the min and max values
provided. Then it sets the frame index to be zero.

You can optionally set the cycle and random booleans, to allow bullets to cycle through the frames
when they're fired, or pick one at random.

Parameters
Name Type Argument Default Description
min integer

The minimum value the frame can be. Usually zero.

max integer

The maximum value the frame can be.

cycle boolean <optional>
true

Should the bullet frames cycle as they are fired?

random boolean <optional>
false

Should the bullet frames be picked at random as they are fired?

Returns

The Weapon Plugin.

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

Please login to continue.