Turret pattern rewrite

This commit is contained in:
Anuken
2022-02-24 23:29:36 -05:00
parent c3e9a961c5
commit 45f27eaeec
17 changed files with 239 additions and 240 deletions

View File

@@ -0,0 +1,14 @@
package mindustry.entities.pattern;
public class ShootSpread extends ShootPattern{
/** spread between bullets, in degrees. */
public float spread = 5f;
@Override
public void shoot(int totalShots, BulletHandler handler){
for(int i = 0; i < shots; i++){
float angleOffset = i * spread - (shots - 1) * spread / 2f;
handler.shoot(0, 0, angleOffset, firstShotDelay + shotDelay * i);
}
}
}