Package mindustry.entities.pattern
Class ShootPattern
java.lang.Object
mindustry.entities.pattern.ShootPattern
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
ShootAlternate
,ShootBarrel
,ShootHelix
,ShootMulti
,ShootSine
,ShootSpread
,ShootSummon
Handles different types of bullet patterns for shooting.
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionfloat
delay in ticks before first shotfloat
delay in ticks between shotsint
amount of shots per "trigger pull" -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncopy()
void
flip()
Subclasses should override this to flip its sides.void
shoot
(int totalShots, ShootPattern.BulletHandler handler) Called on a single "trigger pull".void
shoot
(int totalShots, ShootPattern.BulletHandler handler, Runnable barrelIncrementer) Called on a single "trigger pull".
-
Field Details
-
shots
public int shotsamount of shots per "trigger pull" -
firstShotDelay
public float firstShotDelaydelay in ticks before first shot -
shotDelay
public float shotDelaydelay in ticks between shots
-
-
Constructor Details
-
ShootPattern
public ShootPattern()
-
-
Method Details
-
shoot
public void shoot(int totalShots, ShootPattern.BulletHandler handler, @Nullable Runnable barrelIncrementer) Called on a single "trigger pull". This function should call the handler with any bullets that result. -
shoot
Called on a single "trigger pull". This function should call the handler with any bullets that result. -
flip
public void flip()Subclasses should override this to flip its sides. -
copy
-