New weapon pattern system

This commit is contained in:
Anuken
2022-02-24 20:06:52 -05:00
parent 30787e49ad
commit c3e9a961c5
24 changed files with 219 additions and 126 deletions

View File

@@ -0,0 +1,14 @@
package mindustry.entities.pattern;
public class SpreadPattern extends ShotPattern{
/** 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);
}
}
}