diff --git a/core/src/mindustry/entities/bullet/BasicBulletType.java b/core/src/mindustry/entities/bullet/BasicBulletType.java index 96b3bfc3bc..3bc63da0e4 100644 --- a/core/src/mindustry/entities/bullet/BasicBulletType.java +++ b/core/src/mindustry/entities/bullet/BasicBulletType.java @@ -4,6 +4,7 @@ import arc.Core; import arc.graphics.Color; import arc.graphics.g2d.Draw; import arc.graphics.g2d.TextureRegion; +import arc.math.*; import mindustry.gen.*; import mindustry.graphics.Pal; @@ -12,6 +13,7 @@ public class BasicBulletType extends BulletType{ public Color backColor = Pal.bulletYellowBack, frontColor = Pal.bulletYellow; public float width = 5f, height = 7f; public float shrinkX = 0f, shrinkY = 0.5f; + public float spin = 0; public String sprite; public TextureRegion backRegion; @@ -42,11 +44,12 @@ public class BasicBulletType extends BulletType{ public void draw(Bullet b){ float height = this.height * ((1f - shrinkY) + shrinkY * b.fout()); float width = this.width * ((1f - shrinkX) + shrinkX * b.fout()); + float offset = -90 + (spin != 0 ? Mathf.randomSeed(b.id, 360f) + b.time * spin : 0f); Draw.color(backColor); - Draw.rect(backRegion, b.x, b.y, width, height, b.rotation() - 90); + Draw.rect(backRegion, b.x, b.y, width, height, b.rotation() + offset); Draw.color(frontColor); - Draw.rect(frontRegion, b.x, b.y, width, height, b.rotation() - 90); + Draw.rect(frontRegion, b.x, b.y, width, height, b.rotation() + offset); Draw.color(); } }