Turret pattern rewrite
This commit is contained in:
16
core/src/mindustry/entities/pattern/ShootBarrel.java
Normal file
16
core/src/mindustry/entities/pattern/ShootBarrel.java
Normal file
@@ -0,0 +1,16 @@
|
||||
package mindustry.entities.pattern;
|
||||
|
||||
public class ShootBarrel extends ShootPattern{
|
||||
/** barrels [in x, y, rotation] format. */
|
||||
public float[] barrels = {0f, 0f, 0f};
|
||||
/** offset of barrel to start on */
|
||||
public int barrelOffset = 0;
|
||||
|
||||
@Override
|
||||
public void shoot(int totalShots, BulletHandler handler){
|
||||
for(int i = 0; i < shots; i++){
|
||||
int index = ((i + totalShots + barrelOffset) % (barrels.length / 3)) * 3;
|
||||
handler.shoot(barrels[index], barrels[index + 1], barrels[index + 2], firstShotDelay + shotDelay * i);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user