update bounding box

- should fix collision for enemy with custom scale
- update ooze sprite size to utilize 32x32
This commit is contained in:
Anthony Calosa
2023-03-02 13:10:49 +08:00
parent e7b7556589
commit 0424093cc7
4 changed files with 90 additions and 89 deletions

View File

@@ -49,7 +49,10 @@ public class EnemySprite extends CharacterSprite {
@Override @Override
void updateBoundingRect() { //We want enemies to take the full tile. void updateBoundingRect() { //We want enemies to take the full tile.
boundingRect.set(getX(), getY(), getWidth(), getHeight()); float scale = data == null ? 1f : data.scale;
if (scale < 0)
scale = 1f;
boundingRect.set(getX(), getY(), getWidth()*scale, getHeight()*scale);
} }
public void moveTo(Actor other, float delta) { public void moveTo(Actor other, float delta) {

View File

@@ -1,93 +1,90 @@
ooze.png ooze.png
size: 256,160 size: 242, 106
format: RGBA8888 format: RGBA8888
filter: Nearest,Nearest filter: Nearest, Nearest
repeat: none repeat: none
Avatar Avatar
xy: 9, 151 xy: 36, 4
size: 15, 9
Idle
xy: 0, 0
size: 32, 32
Idle
xy: 32, 0
size: 32, 32
Idle
xy: 64, 0
size: 32, 32
Idle
xy: 96, 0
size: 32, 32 size: 32, 32
Idle Idle
xy: 0, 96 xy: 172, 4
size: 32, 32 size: 32, 32
Idle Idle
xy: 32, 96 xy: 2, 4
size: 32, 32 size: 32, 32
Idle orig: 32, 32
xy: 64, 96 Idle
size: 32, 32 xy: 36, 4
Idle size: 32, 32
xy: 96, 96 Idle
size: 32, 32 xy: 172, 4
Walk size: 32, 32
xy: 0, 32 Idle
size: 32, 32 xy: 70, 4
Walk size: 32, 32
xy: 32, 32 Idle
size: 32, 32 xy: 104, 4
Walk size: 32, 32
xy: 64, 32 Idle
size: 32, 32 xy: 138, 4
Walk size: 32, 32
xy: 96, 32 Walk
size: 32, 32 xy: 172, 4
Walk size: 32, 32
xy: 128, 32 Walk
size: 32, 32 xy: 2, 4
Walk size: 32, 32
xy: 160, 32 Walk
size: 32, 32 xy: 206, 4
Walk size: 32, 32
xy: 192, 32 Walk
size: 32, 32 xy: 2, 38
Walk size: 32, 32
xy: 224, 32 Walk
size: 32, 32 xy: 36, 38
Attack size: 32, 32
xy: 0, 64 Walk
size: 32, 32 xy: 70, 38
Attack size: 32, 32
xy: 32, 64 Walk
size: 32, 32 xy: 104, 38
Attack size: 32, 32
xy: 64, 64 Walk
size: 32, 32 xy: 138, 38
Attack size: 32, 32
xy: 96, 64 Attack
size: 32, 32 xy: 172, 4
Attack size: 32, 32
xy: 128, 64 Attack
size: 32, 32 xy: 2, 4
Attack size: 32, 32
xy: 160, 64 Attack
size: 32, 32 xy: 172, 38
Death size: 32, 32
xy: 0, 128 Attack
xy: 206, 38
size: 32, 32
Attack
xy: 2, 72
size: 32, 32
Attack
xy: 36, 72
size: 32, 32
Death
xy: 172, 4
size: 32, 32
Death
xy: 70, 72
size: 32, 32
Death
xy: 104, 72
size: 32, 32
Death
xy: 138, 72
size: 32, 32
Death
xy: 172, 72
size: 32, 32
Death
xy: 206, 72
size: 32, 32 size: 32, 32
Death
xy: 32, 128
size: 32, 32
Death
xy: 64, 128
size: 32, 32
Death
xy: 96, 128
size: 32, 32
Death
xy: 128, 128
size: 32, 32
Death
xy: 160, 128
size: 32, 32

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

View File

@@ -3993,6 +3993,7 @@
{ {
"name": "Ooze", "name": "Ooze",
"sprite": "sprites/dungeon/ooze.atlas", "sprite": "sprites/dungeon/ooze.atlas",
"scale": 0.6,
"deck": [ "deck": [
"decks/ooze.json" "decks/ooze.json"
], ],