New weapon pattern system
This commit is contained in:
14
core/src/mindustry/entities/pattern/SpreadPattern.java
Normal file
14
core/src/mindustry/entities/pattern/SpreadPattern.java
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user