From 39106002a7a63076030a2d557c131de16f6fddca Mon Sep 17 00:00:00 2001 From: Damien Date: Wed, 12 May 2021 13:06:38 +0200 Subject: [PATCH] =?UTF-8?q?Dessin=20des=20planets=20encore=20bien=20bugg?= =?UTF-8?q?=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/src/sagittarius/model/Planet.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/src/sagittarius/model/Planet.java b/core/src/sagittarius/model/Planet.java index ced8438..ea9a8f9 100644 --- a/core/src/sagittarius/model/Planet.java +++ b/core/src/sagittarius/model/Planet.java @@ -1,6 +1,8 @@ package sagittarius.model; import com.badlogic.gdx.graphics.Color; +import com.badlogic.gdx.graphics.Texture; +import com.badlogic.gdx.graphics.g2d.Batch; import com.badlogic.gdx.math.MathUtils; import com.badlogic.gdx.math.Vector2; @@ -9,6 +11,7 @@ public class Planet extends EntityCircle { // ---------- ATTRIBUTEs ---------- float revolutionRate = MathUtils.randomTriangular(1) + 1; + Texture texture = new Texture("core/assets/planet1.png"); // ---------- CONSTRUCTORs ---------- @@ -33,4 +36,9 @@ public class Planet extends EntityCircle { ; } + @Override + public void draw (Batch batch, float parentAlpha) { + batch.draw(texture, getPosition().x - this.radius, getPosition().y - this.radius); + } + }