Skip to content

Commit

Permalink
Change how sword damage position is calculated
Browse files Browse the repository at this point in the history
  • Loading branch information
silas-hw committed Sep 11, 2024
1 parent 197981b commit be6dbe1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion src/core/src/com/mygdx/scngame/entity/enemy/Enemy.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ public Enemy(EnemyType type) {
collider.setMask(1, true);

collider.setLayer(0, true);
collider.setLayer(1, true);

collider.solid = true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,15 @@ public void setContainer(Player container) {

switch (this.attackDirection) {
case LEFT:
attackBoxOffset.set(- attackBoxWidth, (container.HEIGHT - attackBoxHeight)/2f);
attackBoxOffset.set(- attackBoxWidth, (container.HEIGHT/2f - attackBoxHeight)/2f);
break;

case RIGHT:
attackBoxOffset.set(container.WIDTH, (container.HEIGHT - attackBoxHeight)/2f);
attackBoxOffset.set(container.WIDTH, (container.HEIGHT/2f - attackBoxHeight)/2f);
break;

case UP:
attackBoxOffset.set((container.WIDTH - attackBoxWidth)/2f, container.HEIGHT);
attackBoxOffset.set((container.WIDTH - attackBoxWidth)/2f, container.HEIGHT/2f);
break;

case DOWN:
Expand Down

0 comments on commit be6dbe1

Please sign in to comment.