From 9e251b9d01f0230b537bce47a68c4915b7c72bbb Mon Sep 17 00:00:00 2001 From: Benjamin Date: Mon, 17 Jun 2024 20:52:45 +0200 Subject: [PATCH] =?UTF-8?q?feat=F0=9F=91=A3:=20dauerfeuer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game/core/src/main/de/dhbw/tinf22b6/gameobject/Player.java | 4 ++++ game/core/src/main/de/dhbw/tinf22b6/weapon/Ak.java | 2 +- game/core/src/main/de/dhbw/tinf22b6/weapon/M4.java | 2 +- game/core/src/main/de/dhbw/tinf22b6/weapon/MP7.java | 4 ++-- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/game/core/src/main/de/dhbw/tinf22b6/gameobject/Player.java b/game/core/src/main/de/dhbw/tinf22b6/gameobject/Player.java index bc20e0f..3172e5d 100644 --- a/game/core/src/main/de/dhbw/tinf22b6/gameobject/Player.java +++ b/game/core/src/main/de/dhbw/tinf22b6/gameobject/Player.java @@ -6,6 +6,7 @@ import static de.dhbw.tinf22b6.util.Constants.TILE_SIZE; import com.badlogic.gdx.Gdx; +import com.badlogic.gdx.Input; import com.badlogic.gdx.graphics.Camera; import com.badlogic.gdx.graphics.g2d.Animation; import com.badlogic.gdx.graphics.g2d.Batch; @@ -155,6 +156,9 @@ public void tick(float delta) { pos.x = body.getPosition().x - (float) TILE_SIZE / 2; pos.y = body.getPosition().y - (float) TILE_SIZE / 4; } + if (Gdx.input.isButtonPressed(Input.Buttons.LEFT)) { + shoot(); + } } public void applyForce(Vector2 motionVector) { diff --git a/game/core/src/main/de/dhbw/tinf22b6/weapon/Ak.java b/game/core/src/main/de/dhbw/tinf22b6/weapon/Ak.java index 659fc7a..f721395 100644 --- a/game/core/src/main/de/dhbw/tinf22b6/weapon/Ak.java +++ b/game/core/src/main/de/dhbw/tinf22b6/weapon/Ak.java @@ -12,7 +12,7 @@ public class Ak extends Weapon { public Ak() { - super("ak", 25, 0.2f, 50); + super("ak", 25, 0.3f, 50); this.shootingAnimation = new Animation<>(0.01f, Assets.instance.getAnimationAtlasRegion("ak")); } diff --git a/game/core/src/main/de/dhbw/tinf22b6/weapon/M4.java b/game/core/src/main/de/dhbw/tinf22b6/weapon/M4.java index 41083ac..eb3b283 100644 --- a/game/core/src/main/de/dhbw/tinf22b6/weapon/M4.java +++ b/game/core/src/main/de/dhbw/tinf22b6/weapon/M4.java @@ -9,7 +9,7 @@ public class M4 extends Weapon { public M4() { - super("m4", 30, 0.05f, 40); + super("m4", 30, 0.2f, 40); this.shootingAnimation = new Animation<>(0.001f, Assets.instance.getAnimationAtlasRegion("m4")); } diff --git a/game/core/src/main/de/dhbw/tinf22b6/weapon/MP7.java b/game/core/src/main/de/dhbw/tinf22b6/weapon/MP7.java index c4fed8b..3c8414a 100644 --- a/game/core/src/main/de/dhbw/tinf22b6/weapon/MP7.java +++ b/game/core/src/main/de/dhbw/tinf22b6/weapon/MP7.java @@ -10,8 +10,8 @@ public class MP7 extends Weapon { public MP7() { - super("mp7", 40, 0.003f, 40); - this.shootingAnimation = new Animation<>(0.003f, Assets.instance.getAnimationAtlasRegion("mp7")); + super("mp7", 40, 0.05f, 40); + this.shootingAnimation = new Animation<>(0.005f, Assets.instance.getAnimationAtlasRegion("mp7")); } @Override