Mis à jour les tiles de gazon

This commit is contained in:
galaxyoyo 2015-01-08 13:59:28 +01:00
parent 0eff34c418
commit 91679db18d
4 changed files with 87 additions and 10 deletions

View File

@ -25,7 +25,10 @@ public class EditorAPI
for (int x = 1; x < width; x += 16)
{
bytes.add((byte) 0);
bytes.add((byte) 0);
bytes.add((byte) (Byte.MIN_VALUE / 2));
}
bytes.remove(bytes.lastIndexOf((byte) (Byte.MIN_VALUE / 2)));
bytes.add(Byte.MIN_VALUE);
}

View File

@ -24,6 +24,11 @@ public class SpriteRegister
@SuppressWarnings("unchecked")
public static void refreshAllSprites()
{
if (nameToCoords != null && !nameToCoords.isEmpty() && !sprites.isEmpty())
{
return;
}
try
{
BufferedReader br = new BufferedReader(new InputStreamReader(SpriteRegister.class.getResourceAsStream("/assets/unknown/textures/sprites/sprites.json")));
@ -43,9 +48,7 @@ public class SpriteRegister
{
int x = list.get(0).intValue();
int y = list.get(1).intValue();
int width = list.get(2).intValue() * 16;
int height = list.get(3).intValue() * 16;
BufferedImage child = img.getSubimage(x, y, width, height);
BufferedImage child = img.getSubimage(x, y, 16, 16);
Sprite sprite = new Sprite(child);
lSprites.add(sprite);
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

@ -1,11 +1,82 @@
{
"gazon": [
[0,15,1,5],
[0,144,1,3],
[16,144,2,2],
[32,208,6,2],
[128,144,1,2],
[160,156,3,2],
[160,32,1,3]
[0,0],
[0,16],
[0,32],
[0,48],
[0,64],
[0,144],
[0,160],
[0,176],
[16,144],
[32,144],
[16,160],
[32,160],
[32,224],
[48,224],
[64,224],
[80,224],
[96,224],
[112,224],
[112,208],
[159,48],
[160,166],
[176,166],
[128,144],
[128,160],
[144,80],
[48,36],
[64,36],
[54,53],
[70,53],
[48,70],
[16,28],
[16,16],
[16,32],
[16,48],
[16,64],
[16,80],
[32,16],
[32,32],
[32,48],
[32,64],
[32,80],
[48,64],
[48,80],
[64,64],
[64,80],
[80,64],
[80,80],
[96,64],
[96,80],
[112,64],
[112,80],
[128,80],
[128,64],
[112,48],
[128,48],
[112,32],
[128,32],
[112,16],
[128,16],
[64,128],
[80,128],
[96,128],
[48,144],
[64,144],
[80,144],
[96,144],
[48,160],
[96,160],
[48,176],
[96,176],
[32,176],
[112,176],
[64,160],
[80,160],
[64,176],
[80,176],
[64,192],
[80,192]
]
}