remise des autres fleches

This commit is contained in:
Damien 2021-05-14 10:37:40 +02:00
parent 58eb1f7136
commit 457dcbf7c2

View file

@ -52,7 +52,7 @@ public class Arrow extends EntityQuad {
if (!preview) { if (!preview) {
texture = new ArrayList<>(); texture = new ArrayList<>();
String path = "core/assets/arrow" + MathUtils.random(0); String path = "core/assets/arrow" + MathUtils.random(2);
int i = 0; int i = 0;
while (true) { while (true) {
@ -121,7 +121,7 @@ public class Arrow extends EntityQuad {
@Override @Override
public void draw(Batch batch, float parentAlpha) { public void draw(Batch batch, float parentAlpha) {
int i = (int) (TTL * 3) % 4; int i = (int) (TTL * 3) % texture.size();
batch.draw(texture.get(i), getPosition().x - getOriginX(), getPosition().y - getWidth()/2, getOriginX(), getWidth()/2, getWidth(), getWidth(), batch.draw(texture.get(i), getPosition().x - getOriginX(), getPosition().y - getWidth()/2, getOriginX(), getWidth()/2, getWidth(), getWidth(),
1, 1, getRotation(), 0, 0, texture.get(i).getWidth(), texture.get(i).getHeight(), false, false); 1, 1, getRotation(), 0, 0, texture.get(i).getWidth(), texture.get(i).getHeight(), false, false);
super.draw(batch, parentAlpha); super.draw(batch, parentAlpha);