start of attacking
BIN
assets/player/attack/boy_attack_down_1.png
Normal file
|
After Width: | Height: | Size: 378 B |
BIN
assets/player/attack/boy_attack_down_2.png
Normal file
|
After Width: | Height: | Size: 6.2 KiB |
BIN
assets/player/attack/boy_attack_left_1.png
Normal file
|
After Width: | Height: | Size: 6.1 KiB |
BIN
assets/player/attack/boy_attack_left_2.png
Normal file
|
After Width: | Height: | Size: 6.2 KiB |
BIN
assets/player/attack/boy_attack_right_1.png
Normal file
|
After Width: | Height: | Size: 6.0 KiB |
BIN
assets/player/attack/boy_attack_right_2.png
Normal file
|
After Width: | Height: | Size: 6.2 KiB |
BIN
assets/player/attack/boy_attack_up_1.png
Normal file
|
After Width: | Height: | Size: 306 B |
BIN
assets/player/attack/boy_attack_up_2.png
Normal file
|
After Width: | Height: | Size: 312 B |
BIN
assets/player/attack/boy_axe_down_1.png
Normal file
|
After Width: | Height: | Size: 390 B |
BIN
assets/player/attack/boy_axe_down_2.png
Normal file
|
After Width: | Height: | Size: 393 B |
BIN
assets/player/attack/boy_axe_left_1.png
Normal file
|
After Width: | Height: | Size: 300 B |
BIN
assets/player/attack/boy_axe_left_2.png
Normal file
|
After Width: | Height: | Size: 327 B |
BIN
assets/player/attack/boy_axe_right_1.png
Normal file
|
After Width: | Height: | Size: 315 B |
BIN
assets/player/attack/boy_axe_right_2.png
Normal file
|
After Width: | Height: | Size: 336 B |
BIN
assets/player/attack/boy_axe_up_1.png
Normal file
|
After Width: | Height: | Size: 348 B |
BIN
assets/player/attack/boy_axe_up_2.png
Normal file
|
After Width: | Height: | Size: 312 B |
BIN
assets/player/attack/boy_pick_down_1.png
Normal file
|
After Width: | Height: | Size: 387 B |
BIN
assets/player/attack/boy_pick_down_2.png
Normal file
|
After Width: | Height: | Size: 386 B |
BIN
assets/player/attack/boy_pick_left_1.png
Normal file
|
After Width: | Height: | Size: 350 B |
BIN
assets/player/attack/boy_pick_left_2.png
Normal file
|
After Width: | Height: | Size: 398 B |
BIN
assets/player/attack/boy_pick_right_1.png
Normal file
|
After Width: | Height: | Size: 370 B |
BIN
assets/player/attack/boy_pick_right_2.png
Normal file
|
After Width: | Height: | Size: 396 B |
BIN
assets/player/attack/boy_pick_up_1.png
Normal file
|
After Width: | Height: | Size: 366 B |
BIN
assets/player/attack/boy_pick_up_2.png
Normal file
|
After Width: | Height: | Size: 351 B |
@@ -31,6 +31,7 @@ public class Entity {
|
||||
int dialogueIndex = 0;
|
||||
public boolean collisionOn = false;
|
||||
public boolean invincible = false;
|
||||
boolean attacking = false; //TODO: https://youtu.be/HL39xRzPpm4?t=551
|
||||
|
||||
// COUNTER
|
||||
public int spriteCounter = 0;
|
||||
@@ -127,4 +128,13 @@ public class Entity {
|
||||
return null;
|
||||
}
|
||||
|
||||
public BufferedImage initEntitySprites(String name, int width, int height) {
|
||||
try {
|
||||
return Utility.scaleImage(ImageIO.read(new FileInputStream("assets/" + name + ".png")), width, height);
|
||||
} catch (IOException e) {
|
||||
Boot.logger.log(Level.SEVERE, "Could not load entity-image", e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -31,13 +31,12 @@ public class Player extends Entity {
|
||||
|
||||
setDefaultValues();
|
||||
getPlayerImage();
|
||||
getPlayerAttackImage();
|
||||
}
|
||||
|
||||
public void setDefaultValues() {
|
||||
worldX = panel.tileSize * 23;
|
||||
worldY = panel.tileSize * 21;
|
||||
// worldX = panel.tileSize * 10;
|
||||
// worldY = panel.tileSize * 13;
|
||||
speed = 4;
|
||||
direction = Direction.DOWN;
|
||||
|
||||
@@ -46,17 +45,6 @@ public class Player extends Entity {
|
||||
life = maxLife;
|
||||
}
|
||||
|
||||
public void getPlayerImage() {
|
||||
up1 = initEntitySprites("player/boy_up_1");
|
||||
up2 = initEntitySprites("player/boy_up_2");
|
||||
down1 = initEntitySprites("player/boy_down_1");
|
||||
down2 = initEntitySprites("player/boy_down_2");
|
||||
left1 = initEntitySprites("player/boy_left_1");
|
||||
left2 = initEntitySprites("player/boy_left_2");
|
||||
right1 = initEntitySprites("player/boy_right_1");
|
||||
right2 = initEntitySprites("player/boy_right_2");
|
||||
}
|
||||
|
||||
public void update() {
|
||||
// MOVEMENT
|
||||
if(keyH.upPressed || keyH.downPressed || keyH.leftPressed || keyH.rightPressed || keyH.spacePressed) {
|
||||
@@ -147,4 +135,26 @@ public class Player extends Entity {
|
||||
super.speak();
|
||||
}
|
||||
|
||||
public void getPlayerImage() {
|
||||
up1 = initEntitySprites("player/boy_up_1");
|
||||
up2 = initEntitySprites("player/boy_up_2");
|
||||
down1 = initEntitySprites("player/boy_down_1");
|
||||
down2 = initEntitySprites("player/boy_down_2");
|
||||
left1 = initEntitySprites("player/boy_left_1");
|
||||
left2 = initEntitySprites("player/boy_left_2");
|
||||
right1 = initEntitySprites("player/boy_right_1");
|
||||
right2 = initEntitySprites("player/boy_right_2");
|
||||
}
|
||||
|
||||
public void getPlayerAttackImage() {
|
||||
attackUp1 = initEntitySprites("player/attack/boy_attack_up_1", panel.tileSize, panel.tileSize*2);
|
||||
attackUp2 = initEntitySprites("player/attack/boy_attack_up_2", panel.tileSize, panel.tileSize*2);
|
||||
attackDown1 = initEntitySprites("player/attack/boy_attack_down_1", panel.tileSize, panel.tileSize*2);
|
||||
attackDown2 = initEntitySprites("player/attack/boy_attack_down_2", panel.tileSize, panel.tileSize*2);
|
||||
attackLeft1 = initEntitySprites("player/attack/boy_attack_left_1", panel.tileSize*2, panel.tileSize);
|
||||
attackLeft2 = initEntitySprites("player/attack/boy_attack_left_2", panel.tileSize*2, panel.tileSize);
|
||||
attackRight1 = initEntitySprites("player/attack/boy_attack_right_1", panel.tileSize*2, panel.tileSize);
|
||||
attackRight2 = initEntitySprites("player/attack/boy_attack_right_2", panel.tileSize*2, panel.tileSize);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||