Skip to content
This repository was archived by the owner on May 27, 2023. It is now read-only.

Commit 722057d

Browse files
Try for hitboxes
1 parent b5da0e1 commit 722057d

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

core/src/main/java/info/zthings/geem/main/GameplayState.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
import com.badlogic.gdx.graphics.g3d.attributes.ColorAttribute;
1717
import com.badlogic.gdx.graphics.g3d.decals.CameraGroupStrategy;
1818
import com.badlogic.gdx.graphics.g3d.environment.DirectionalLight;
19-
import com.badlogic.gdx.math.Vector3;
2019
import com.badlogic.gdx.utils.TimeUtils;
2120
import com.badlogic.gdx.utils.Timer;
2221
import com.badlogic.gdx.utils.Timer.Task;
@@ -199,7 +198,7 @@ public void update(float dt) {
199198
if (ship.position.x < -xb) ship.position.x = -xb;
200199
else if (ship.position.x > xb) ship.position.x = xb;
201200

202-
final Vector3 vecBuf = new Vector3();
201+
//final Vector3 vecBuf = new Vector3();
203202
for (Asteroid a : obstacles) {
204203
if (a.position.x < -xb || a.position.x > xb) continue;
205204

@@ -217,8 +216,8 @@ public void update(float dt) {
217216
GeemLoop.getRC().ass.get("sfx/oof.wav", Sound.class).play(.8F);
218217
continue;
219218
} else for (Bullet b : bullets) {
220-
vecBuf.set(b.position.x, a.getCurrentBounds().getCenterY(), b.position.z);
221-
if (a.getCurrentBounds().contains(vecBuf)) {
219+
//vecBuf.set(b.position.x, a.getCurrentBounds().getCenterY(), b.position.z);
220+
if (a.getCurrentBounds().intersects(b.getCurrentBounds())) {
222221
b.destroyed = true;
223222
float dist = a.position.z - ship.position.z;
224223
GeemLoop.getRC().ass.get("sfx/biem.wav", Sound.class).play((dist < 60 ? 1 - dist / 60 : 0) * .8F);

0 commit comments

Comments
 (0)