reduced hitbox and started with objects
BIN
assets/objects/axe.png
Normal file
|
After Width: | Height: | Size: 6.6 KiB |
BIN
assets/objects/blueheart.png
Normal file
|
After Width: | Height: | Size: 613 B |
BIN
assets/objects/boots.png
Normal file
|
After Width: | Height: | Size: 680 B |
BIN
assets/objects/chest (OLD).png
Normal file
|
After Width: | Height: | Size: 733 B |
BIN
assets/objects/chest.png
Normal file
|
After Width: | Height: | Size: 6.1 KiB |
BIN
assets/objects/chest_opened.png
Normal file
|
After Width: | Height: | Size: 6.2 KiB |
BIN
assets/objects/coin_bronze.png
Normal file
|
After Width: | Height: | Size: 6.3 KiB |
BIN
assets/objects/door.png
Normal file
|
After Width: | Height: | Size: 638 B |
BIN
assets/objects/door_iron.png
Normal file
|
After Width: | Height: | Size: 5.8 KiB |
BIN
assets/objects/heart_blank.png
Normal file
|
After Width: | Height: | Size: 7.0 KiB |
BIN
assets/objects/heart_full.png
Normal file
|
After Width: | Height: | Size: 7.4 KiB |
BIN
assets/objects/heart_half.png
Normal file
|
After Width: | Height: | Size: 7.3 KiB |
BIN
assets/objects/key.png
Normal file
|
After Width: | Height: | Size: 711 B |
BIN
assets/objects/lantern.png
Normal file
|
After Width: | Height: | Size: 6.3 KiB |
BIN
assets/objects/manacrystal_blank.png
Normal file
|
After Width: | Height: | Size: 5.5 KiB |
BIN
assets/objects/manacrystal_full.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
assets/objects/pickaxe.png
Normal file
|
After Width: | Height: | Size: 591 B |
BIN
assets/objects/potion_red.png
Normal file
|
After Width: | Height: | Size: 6.2 KiB |
BIN
assets/objects/shield_blue.png
Normal file
|
After Width: | Height: | Size: 6.5 KiB |
BIN
assets/objects/shield_wood.png
Normal file
|
After Width: | Height: | Size: 6.3 KiB |
BIN
assets/objects/sword_normal.png
Normal file
|
After Width: | Height: | Size: 6.4 KiB |
BIN
assets/objects/tent.png
Normal file
|
After Width: | Height: | Size: 6.7 KiB |
@@ -1,6 +1,7 @@
|
|||||||
package de.miaurizius.jgame2d.core;
|
package de.miaurizius.jgame2d.core;
|
||||||
|
|
||||||
import de.miaurizius.jgame2d.entity.Player;
|
import de.miaurizius.jgame2d.entity.Player;
|
||||||
|
import de.miaurizius.jgame2d.object.SuperObject;
|
||||||
import de.miaurizius.jgame2d.tile.TileManager;
|
import de.miaurizius.jgame2d.tile.TileManager;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
@@ -33,6 +34,7 @@ public class GamePanel extends JPanel implements Runnable {
|
|||||||
Thread gameThread;
|
Thread gameThread;
|
||||||
public CollisionHandler collisionH = new CollisionHandler(this);
|
public CollisionHandler collisionH = new CollisionHandler(this);
|
||||||
public Player player = new Player(this, keyH);
|
public Player player = new Player(this, keyH);
|
||||||
|
public SuperObject[] obj = new SuperObject[10];
|
||||||
|
|
||||||
public GamePanel() {
|
public GamePanel() {
|
||||||
this.setPreferredSize(new Dimension(screenWidth, screenHeight));
|
this.setPreferredSize(new Dimension(screenWidth, screenHeight));
|
||||||
|
|||||||
@@ -25,10 +25,10 @@ public class Player extends Entity {
|
|||||||
screenY = panel.screenHeight/2 - panel.tileSize/2;
|
screenY = panel.screenHeight/2 - panel.tileSize/2;
|
||||||
|
|
||||||
solidArea = new Rectangle();
|
solidArea = new Rectangle();
|
||||||
solidArea.x = 9;
|
solidArea.x = 12;
|
||||||
solidArea.y = 18;
|
solidArea.y = 20;
|
||||||
solidArea.width = 32;
|
solidArea.width = 24;
|
||||||
solidArea.height = 32;
|
solidArea.height = 24;
|
||||||
|
|
||||||
setDefaultValues();
|
setDefaultValues();
|
||||||
getPlayerImage();
|
getPlayerImage();
|
||||||
|
|||||||
19
src/de/miaurizius/jgame2d/object/KeyObj.java
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
package de.miaurizius.jgame2d.object;
|
||||||
|
|
||||||
|
import javax.imageio.ImageIO;
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.security.Key;
|
||||||
|
|
||||||
|
public class KeyObj extends SuperObject {
|
||||||
|
|
||||||
|
public KeyObj() {
|
||||||
|
name = "key";
|
||||||
|
try {
|
||||||
|
image = ImageIO.read(new FileInputStream("assets/objects/key.png"));
|
||||||
|
} catch(IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
12
src/de/miaurizius/jgame2d/object/SuperObject.java
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
package de.miaurizius.jgame2d.object;
|
||||||
|
|
||||||
|
import java.awt.image.BufferedImage;
|
||||||
|
|
||||||
|
public class SuperObject {
|
||||||
|
|
||||||
|
public BufferedImage image;
|
||||||
|
public String name;
|
||||||
|
public boolean collision = false;
|
||||||
|
public int worldX, worldY;
|
||||||
|
|
||||||
|
}
|
||||||