Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only returning one type of layer #133

Open
JSLLW opened this issue Sep 10, 2023 · 0 comments
Open

Only returning one type of layer #133

JSLLW opened this issue Sep 10, 2023 · 0 comments
Labels
bug Something isn't working sprint 2

Comments

@JSLLW
Copy link
Contributor

JSLLW commented Sep 10, 2023

Description

Trying to get layer of the target that a projectile is coming into contact with so projectile effects can be properly implemented. It's only returning one type of layer, the engineer layer, even when engineers aren't being spawned. Code can be found in the onCollision methods under:
source/core/src/main/com/csse3200/game/components/EffectsComponent.java
and
source/core/src/main/com/csse3200/game/components/TouchAttackComponent.java

Entity target = ((BodyUserData) other.getBody().getUserData()).entity;
CombatStatsComponent targetStats = target.getComponent(CombatStatsComponent.class);

If you call the print statement below, it will print "target layer: 2" regardless of what entity should be the target.

System.out.println("target layer: " + otherEntity.getLayer());

Expected Behaviour

It should be returning the layer that's allocated to a specific entity.

Screenshots

targetLayer

@JSLLW JSLLW added bug Something isn't working sprint 2 labels Sep 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working sprint 2
Projects
None yet
Development

No branches or pull requests

1 participant