diff options
| author | ilotterytea <iltsu@alright.party> | 2024-10-07 02:35:36 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2024-10-07 02:35:36 +0500 |
| commit | 2451b7d78a1f0bd9df1d01f254c30a14b731688a (patch) | |
| tree | 3d36f3c4ff1788dc7c1f43ee205e38285fc54544 /core/src/kz/ilotterytea/maxon/player | |
| parent | 3de9d004e99851f38f8700839fa2f7aa6f1c0172 (diff) | |
upd: splitToTextureRegions returns now ArrayList because default arrays fucking suck
Diffstat (limited to 'core/src/kz/ilotterytea/maxon/player')
| -rw-r--r-- | core/src/kz/ilotterytea/maxon/player/DecalPlayer.java | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/core/src/kz/ilotterytea/maxon/player/DecalPlayer.java b/core/src/kz/ilotterytea/maxon/player/DecalPlayer.java index 5ce2abe..d7cb680 100644 --- a/core/src/kz/ilotterytea/maxon/player/DecalPlayer.java +++ b/core/src/kz/ilotterytea/maxon/player/DecalPlayer.java @@ -11,20 +11,22 @@ import com.badlogic.gdx.math.collision.BoundingBox; import com.badlogic.gdx.math.collision.Ray; import kz.ilotterytea.maxon.MaxonGame; +import java.util.ArrayList; + public class DecalPlayer { - private final TextureRegion[] regions; + private final ArrayList<TextureRegion> regions; private int regionIndex; private final Decal decal; private final BoundingBox box; private final Savegame savegame; - public DecalPlayer(Savegame savegame, TextureRegion[] regions) { + public DecalPlayer(Savegame savegame, ArrayList<TextureRegion> regions) { this.savegame = savegame; this.regions = regions; this.regionIndex = 0; - this.decal = Decal.newDecal(this.regions[this.regionIndex]); + this.decal = Decal.newDecal(this.regions.get(this.regionIndex)); this.decal.setScale(0.025f); this.decal.setPosition(2.0f, 1.75f, 2.0f); @@ -67,11 +69,11 @@ public class DecalPlayer { private void updateTextureRegion() { this.regionIndex++; - if (this.regions[this.regionIndex] == null) { + if (this.regions.get(this.regionIndex) == null) { this.regionIndex = 0; } - this.decal.setTextureRegion(this.regions[this.regionIndex]); + this.decal.setTextureRegion(this.regions.get(this.regionIndex)); } public Decal getDecal() { |
