tout le monde a une texture maintenant il faut que ca soit un peu plus joli
This commit is contained in:
parent
ffd7957afb
commit
7c6132426f
Binary file not shown.
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 3.7 KiB |
Binary file not shown.
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 3.7 KiB |
|
@ -2,6 +2,8 @@ package sagittarius.model;
|
|||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import com.badlogic.gdx.graphics.Texture;
|
||||
import com.badlogic.gdx.graphics.g2d.Batch;
|
||||
import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
|
||||
import com.badlogic.gdx.math.Intersector;
|
||||
import com.badlogic.gdx.math.Vector2;
|
||||
|
@ -24,6 +26,8 @@ public class Arrow extends EntityQuad {
|
|||
private Planet crash;
|
||||
private Vector2 offset;
|
||||
|
||||
private Texture texture;
|
||||
|
||||
// ---------- CONSTRUCTORs ----------
|
||||
|
||||
/**
|
||||
|
@ -41,6 +45,8 @@ public class Arrow extends EntityQuad {
|
|||
this.setSize(100, 4);
|
||||
this.force = computeForce();
|
||||
this.landed = false;
|
||||
|
||||
this.texture = new Texture("core/assets/arrow1.png");
|
||||
}
|
||||
|
||||
// ---------- METHODs ----------
|
||||
|
@ -76,6 +82,12 @@ public class Arrow extends EntityQuad {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw (Batch batch, float parentAlpha) {
|
||||
batch.draw(texture, getPosition().x - 0.8f * getWidth(), getPosition().y - getHeight()/2 - 10, 0.8f * this.getWidth(), this.getHeight()/2 + 10, getWidth(), 20 + getHeight(),
|
||||
1, 1, getRotation(), 0, 0, texture.getWidth(), texture.getHeight(), false, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Computes the {@link Arrow#force} exerted on the Arrow,
|
||||
* according to the other weighted entities.
|
||||
|
|
Loading…
Reference in a new issue