diff --git a/core/assets/arrow1.png b/core/assets/arrow1.png index 43277e1..c0cd968 100644 Binary files a/core/assets/arrow1.png and b/core/assets/arrow1.png differ diff --git a/core/assets/arrow2.png b/core/assets/arrow2.png index 8a3886e..7babcf3 100644 Binary files a/core/assets/arrow2.png and b/core/assets/arrow2.png differ diff --git a/core/src/sagittarius/model/Arrow.java b/core/src/sagittarius/model/Arrow.java index eb8a7c7..ff6f239 100644 --- a/core/src/sagittarius/model/Arrow.java +++ b/core/src/sagittarius/model/Arrow.java @@ -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.