forked from IF-LK-2020/zulda
textures
This commit is contained in:
@@ -11,8 +11,8 @@ public class Map extends Knoten {
|
||||
for (int x = 0; x < map.length; x++) {
|
||||
for (int y = 0; y < map[0].length; y++) {
|
||||
map[x][y] = new Tile((x == 0 || y == 0 || x == map.length - 1 || y == map[0].length - 1) ? 1 : 0);
|
||||
map[x][y].setX(x * 96);
|
||||
map[x][y].setY(y * 96);
|
||||
map[x][y].setX(x * Tile.getSize());
|
||||
map[x][y].setY(y * Tile.getSize());
|
||||
add(map[x][y]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,27 +1,59 @@
|
||||
package main;
|
||||
|
||||
import java.awt.geom.AffineTransform;
|
||||
import java.awt.image.AffineTransformOp;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
|
||||
import ea.Bild;
|
||||
import ea.Knoten;
|
||||
|
||||
public class Tile extends Knoten {
|
||||
|
||||
|
||||
public static final int GRASS = 0;
|
||||
public static final int WALL = 1;
|
||||
|
||||
private static final int SCALE = 6;
|
||||
|
||||
private Bild img;
|
||||
|
||||
|
||||
public Tile(int id) {
|
||||
img = new Bild(getPathFromId(id));
|
||||
try {
|
||||
BufferedImage buff = ImageIO.read(Tile.class.getResourceAsStream(getPathFromId(id)));
|
||||
if (id == GRASS) {
|
||||
buff = buff.getSubimage(16 * (int) (Math.random() * 8), 0, 16, 16);
|
||||
|
||||
}
|
||||
BufferedImage after = new BufferedImage(buff.getWidth() * SCALE, buff.getHeight() * SCALE, BufferedImage.TYPE_INT_ARGB);
|
||||
AffineTransform at = new AffineTransform();
|
||||
at.scale(SCALE, SCALE);
|
||||
AffineTransformOp scaleOp = new AffineTransformOp(at, AffineTransformOp.TYPE_NEAREST_NEIGHBOR);
|
||||
after = scaleOp.filter(buff, after);
|
||||
int x = 0;
|
||||
int y = 0;
|
||||
if (id == WALL) {
|
||||
y = -after.getHeight() + 16 * SCALE;
|
||||
}
|
||||
img = new Bild(x, y, after);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
add(img);
|
||||
}
|
||||
|
||||
|
||||
private String getPathFromId(int id) {
|
||||
switch (id) {
|
||||
case GRASS:
|
||||
return "res/images/grass.png";
|
||||
return "/res/images/tiles/grass.png";
|
||||
case WALL:
|
||||
return "res/images/stone.png";
|
||||
return "/res/images/tiles/wall.png";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static int getSize() {
|
||||
return 16 * SCALE;
|
||||
}
|
||||
}
|
||||
|
||||
7182
workspace/Zulda/src/res/images/adventurer/adventurer_die_left.eaf
Normal file
7182
workspace/Zulda/src/res/images/adventurer/adventurer_die_left.eaf
Normal file
File diff suppressed because it is too large
Load Diff
7182
workspace/Zulda/src/res/images/adventurer/adventurer_die_right.eaf
Normal file
7182
workspace/Zulda/src/res/images/adventurer/adventurer_die_right.eaf
Normal file
File diff suppressed because it is too large
Load Diff
4107
workspace/Zulda/src/res/images/adventurer/adventurer_hit_left.eaf
Normal file
4107
workspace/Zulda/src/res/images/adventurer/adventurer_hit_left.eaf
Normal file
File diff suppressed because it is too large
Load Diff
4107
workspace/Zulda/src/res/images/adventurer/adventurer_hit_right.eaf
Normal file
4107
workspace/Zulda/src/res/images/adventurer/adventurer_hit_right.eaf
Normal file
File diff suppressed because it is too large
Load Diff
13332
workspace/Zulda/src/res/images/adventurer/adventurer_idle_left.eaf
Normal file
13332
workspace/Zulda/src/res/images/adventurer/adventurer_idle_left.eaf
Normal file
File diff suppressed because it is too large
Load Diff
13332
workspace/Zulda/src/res/images/adventurer/adventurer_idle_right.eaf
Normal file
13332
workspace/Zulda/src/res/images/adventurer/adventurer_idle_right.eaf
Normal file
File diff suppressed because it is too large
Load Diff
6157
workspace/Zulda/src/res/images/adventurer/adventurer_jump_left.eaf
Normal file
6157
workspace/Zulda/src/res/images/adventurer/adventurer_jump_left.eaf
Normal file
File diff suppressed because it is too large
Load Diff
6157
workspace/Zulda/src/res/images/adventurer/adventurer_jump_right.eaf
Normal file
6157
workspace/Zulda/src/res/images/adventurer/adventurer_jump_right.eaf
Normal file
File diff suppressed because it is too large
Load Diff
8207
workspace/Zulda/src/res/images/adventurer/adventurer_run_left.eaf
Normal file
8207
workspace/Zulda/src/res/images/adventurer/adventurer_run_left.eaf
Normal file
File diff suppressed because it is too large
Load Diff
8207
workspace/Zulda/src/res/images/adventurer/adventurer_run_right.eaf
Normal file
8207
workspace/Zulda/src/res/images/adventurer/adventurer_run_right.eaf
Normal file
File diff suppressed because it is too large
Load Diff
10257
workspace/Zulda/src/res/images/adventurer/adventurer_slash_left.eaf
Normal file
10257
workspace/Zulda/src/res/images/adventurer/adventurer_slash_left.eaf
Normal file
File diff suppressed because it is too large
Load Diff
10257
workspace/Zulda/src/res/images/adventurer/adventurer_slash_right.eaf
Normal file
10257
workspace/Zulda/src/res/images/adventurer/adventurer_slash_right.eaf
Normal file
File diff suppressed because it is too large
Load Diff
10257
workspace/Zulda/src/res/images/adventurer/adventurer_slashdown_left.eaf
Normal file
10257
workspace/Zulda/src/res/images/adventurer/adventurer_slashdown_left.eaf
Normal file
File diff suppressed because it is too large
Load Diff
10257
workspace/Zulda/src/res/images/adventurer/adventurer_slashdown_right.eaf
Normal file
10257
workspace/Zulda/src/res/images/adventurer/adventurer_slashdown_right.eaf
Normal file
File diff suppressed because it is too large
Load Diff
10257
workspace/Zulda/src/res/images/adventurer/adventurer_slashup_left.eaf
Normal file
10257
workspace/Zulda/src/res/images/adventurer/adventurer_slashup_left.eaf
Normal file
File diff suppressed because it is too large
Load Diff
10257
workspace/Zulda/src/res/images/adventurer/adventurer_slashup_right.eaf
Normal file
10257
workspace/Zulda/src/res/images/adventurer/adventurer_slashup_right.eaf
Normal file
File diff suppressed because it is too large
Load Diff
BIN
workspace/Zulda/src/res/images/monster_1.gif
Normal file
BIN
workspace/Zulda/src/res/images/monster_1.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.7 KiB |
BIN
workspace/Zulda/src/res/images/tiles/grass.png
Normal file
BIN
workspace/Zulda/src/res/images/tiles/grass.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 430 B |
BIN
workspace/Zulda/src/res/images/tiles/stone_floor.png
Normal file
BIN
workspace/Zulda/src/res/images/tiles/stone_floor.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 211 B |
BIN
workspace/Zulda/src/res/images/tiles/wall.png
Normal file
BIN
workspace/Zulda/src/res/images/tiles/wall.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 391 B |
BIN
workspace/Zulda/src/res/images/trank_grau.png
Normal file
BIN
workspace/Zulda/src/res/images/trank_grau.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.2 KiB |
BIN
workspace/Zulda/src/res/images/trank_lila.png
Normal file
BIN
workspace/Zulda/src/res/images/trank_lila.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.6 KiB |
Binary file not shown.
BIN
workspace/Zulda/src/res/sounds/Blob-Monsters-on-the-Loose.mp3
Normal file
BIN
workspace/Zulda/src/res/sounds/Blob-Monsters-on-the-Loose.mp3
Normal file
Binary file not shown.
BIN
workspace/Zulda/src/res/sounds/Game-Menu_v001.mp3
Normal file
BIN
workspace/Zulda/src/res/sounds/Game-Menu_v001.mp3
Normal file
Binary file not shown.
BIN
workspace/Zulda/src/res/sounds/Hypnotic-Puzzle2.mp3
Normal file
BIN
workspace/Zulda/src/res/sounds/Hypnotic-Puzzle2.mp3
Normal file
Binary file not shown.
BIN
workspace/Zulda/src/res/sounds/Runaway-Food-Truck.mp3
Normal file
BIN
workspace/Zulda/src/res/sounds/Runaway-Food-Truck.mp3
Normal file
Binary file not shown.
BIN
workspace/Zulda/src/res/sounds/Water-Balloon-Maniacs.mp3
Normal file
BIN
workspace/Zulda/src/res/sounds/Water-Balloon-Maniacs.mp3
Normal file
Binary file not shown.
2
workspace/Zulda/src/res/sounds/lizenz.txt
Normal file
2
workspace/Zulda/src/res/sounds/lizenz.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
Music by Eric Matyas
|
||||
http://soundimage.org
|
||||
Reference in New Issue
Block a user