From be2a195bae4d268267e7c9bacba8dfae5be5a746 Mon Sep 17 00:00:00 2001 From: GammelJAN Date: Fri, 25 Sep 2020 21:58:52 +0200 Subject: [PATCH] Projectiles are being drawed --- core/src/com/trs/game/Controller.java | 5 ++++- core/src/com/trs/game/model/Model.java | 4 ++++ core/src/com/trs/game/model/Projectile.java | 8 ++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/core/src/com/trs/game/Controller.java b/core/src/com/trs/game/Controller.java index 98ebf24..72e4224 100644 --- a/core/src/com/trs/game/Controller.java +++ b/core/src/com/trs/game/Controller.java @@ -13,6 +13,7 @@ import com.badlogic.gdx.graphics.glutils.ShapeRenderer; import com.badlogic.gdx.math.Rectangle; import com.badlogic.gdx.utils.Timer; import com.trs.game.model.Model; +import com.trs.game.model.Projectile; import com.trs.game.model.Wall; import com.trs.game.view.View; import com.trs.game.view.Button; @@ -79,7 +80,9 @@ public class Controller extends ApplicationAdapter implements InputProcessor { for(Wall wall : model.getWalls()){ renderer.rect(wall.getRect().getX(), wall.getRect().getY(),0,0, wall.getRect().getWidth(), wall.getRect().getHeight(),1,1, (float)wall.getRotation()); } - + for(Projectile projectile : model.getProjectiles()){ + renderer.circle(projectile.getxPos(),projectile.getyPos(),5); + } renderer.end(); model.getMonster().drawMonster(renderer); } diff --git a/core/src/com/trs/game/model/Model.java b/core/src/com/trs/game/model/Model.java index 4e5c2c4..618ae53 100644 --- a/core/src/com/trs/game/model/Model.java +++ b/core/src/com/trs/game/model/Model.java @@ -33,4 +33,8 @@ public class Model { public Monster getMonster(){ return monster; } + + public ArrayList getProjectiles() { + return projectiles; + } } diff --git a/core/src/com/trs/game/model/Projectile.java b/core/src/com/trs/game/model/Projectile.java index 89f2ebe..3be523a 100644 --- a/core/src/com/trs/game/model/Projectile.java +++ b/core/src/com/trs/game/model/Projectile.java @@ -30,4 +30,12 @@ public class Projectile { this.xPos += this.movementX; this.yPos += this.movementY; } + + public int getxPos() { + return xPos; + } + + public int getyPos() { + return yPos; + } }