Bläddra i källkod

Erstes UI, Grundgerüst für das Spiel

BuildTools 8 månader sedan
förälder
incheckning
8441f07404

+ 3 - 0
.idea/.gitignore

@@ -0,0 +1,3 @@
+# Default ignored files
+/shelf/
+/workspace.xml

+ 9 - 0
src/main/java/main/Main.java

@@ -0,0 +1,9 @@
+package main;
+
+import ui.Entry;
+
+public class Main {
+    public static void main(String[] args) {
+        Entry.entry();
+    }
+}

+ 59 - 0
src/main/java/ui/Camera.java

@@ -0,0 +1,59 @@
+package ui;
+
+import ui.entity.Entity;
+import util.KeyHandler;
+
+import javax.imageio.ImageIO;
+import java.awt.*;
+import java.io.IOException;
+
+public class Camera extends Entity {
+    private GamePanel gp;
+    private KeyHandler keyH;
+
+    private Image optionalPlayerImage;
+
+    public final int screenX;
+    public final int screenY;
+
+    public Camera(GamePanel gamePanel, KeyHandler keyHandler){
+        gp = gamePanel;
+        keyH = keyHandler;
+        screenX = gp.screenWidth/2 - gamePanel.tileSize/2;
+        screenY = gp.screenHeight/2 - gamePanel.tileSize/2;
+        getPlayerImage();
+        setDefaultValues();
+    }
+    private void getPlayerImage(){
+        try{
+            optionalPlayerImage = ImageIO.read(getClass().getResourceAsStream("/sprites/bigrock.png"));
+        }catch (IOException e){
+            e.printStackTrace();
+        }
+    }
+    public void setDefaultValues(){
+        worldX = gp.tileSize * 23;
+        worldY = gp.tileSize * 21;
+        speed = 4;
+    }
+
+    public void update(){
+        if(keyH.upPressed){
+            worldY -= speed;
+        }
+        if(keyH.downPressed){
+            worldY += speed;
+        }
+        if(keyH.leftPressed){
+            worldX -= speed;
+        }
+        if(keyH.rightPressed){
+            worldX += speed;
+        }
+    }
+    public void draw(Graphics2D g2){
+        g2.setColor(Color.WHITE);
+
+        g2.drawImage(optionalPlayerImage,screenX, screenY, gp.tileSize, gp.tileSize, null);
+    }
+}

+ 23 - 0
src/main/java/ui/Entry.java

@@ -0,0 +1,23 @@
+package ui;
+
+import javax.swing.*;
+
+public class Entry {
+    public static void entry(){
+        JFrame window = new JFrame();
+        window.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
+        window.setResizable(false);
+        window.setTitle("Tiny Settlement");
+
+        GamePanel gamePanel = new GamePanel();
+        window.add(gamePanel);
+
+        window.pack();
+
+
+        window.setLocationRelativeTo(null);
+        window.setVisible(true);
+
+        gamePanel.startGameThread();
+    }
+}

+ 116 - 0
src/main/java/ui/GamePanel.java

@@ -0,0 +1,116 @@
+package ui;
+
+import ui.tile.TileManager;
+import util.GAMESTATE;
+import util.KeyHandler;
+
+import javax.swing.*;
+import java.awt.*;
+
+public class GamePanel extends JPanel implements Runnable{
+
+    //Screen Settings
+    final int originalTileSize = 16;
+    final int scale = 3;
+
+    int fps = 60;
+
+    public int tileSize = originalTileSize * scale;
+    public int maxScreenCol = 16;
+    public int maxScreenRow = 12;
+    public int screenWidth = tileSize * maxScreenCol;
+    public int screenHeight = tileSize * maxScreenRow;
+
+    // World Settings
+    public final int maxWorldCol = 50;
+    public final int maxWorldRow = 50;
+    public final int worldWidth = tileSize * maxWorldCol;
+    public final int worldHeight = tileSize * maxWorldRow;
+
+    //System
+    public UI ui = new UI(this);
+    // Game State
+    public GAMESTATE gameState;
+
+
+
+    TileManager tileManager = new TileManager(this);
+    KeyHandler keyH = new KeyHandler(this);
+    Thread gameThread;
+    public Camera camera = new Camera(this, keyH);
+
+    public GamePanel(){
+        this.setPreferredSize(new Dimension(screenWidth, screenHeight));
+        this.setBackground(Color.BLACK);
+        this.setDoubleBuffered(true);
+        this.addKeyListener(keyH);
+        this.setFocusable(true);
+
+        gameState = GAMESTATE.PLAY;
+    }
+
+    public void zoomInOut(int i){
+        int oldWorldWidth = tileSize * maxWorldCol;
+        if((tileSize > 1 && i < 0) || (tileSize < (originalTileSize * scale)*3 && i > 0)){
+            tileSize += i;
+        }
+
+
+        int newWorldWidth = tileSize * maxWorldCol;
+
+        double multiplier = (double)newWorldWidth/oldWorldWidth;
+        double newCameraWorldX = camera.worldX * multiplier;
+        double newCameraWorldY = camera.worldY * multiplier;
+
+        camera.worldX = newCameraWorldX;
+        camera.worldY = newCameraWorldY;
+    }
+
+    public void startGameThread(){
+        gameThread = new Thread(this);
+        gameThread.start();
+    }
+    public void paintComponent(Graphics g){
+        super.paintComponent(g);
+
+        Graphics2D g2 = (Graphics2D) g;
+
+        tileManager.draw(g2);
+        camera.draw(g2);
+        // UI
+        ui.draw(g2);
+        g2.dispose();
+    }
+    public void update(){
+        if(gameState == GAMESTATE.PLAY){
+            camera.update();
+        }
+    }
+    @Override
+    public void run() {
+        double drawInterval = 1000000000/fps;
+        double delta = 0;
+        long lastTime = System.nanoTime();
+        long currentTime;
+        long timer = 0;
+        int drawCount = 0;
+        while (gameThread != null){
+            currentTime = System.nanoTime();
+
+            delta += (currentTime - lastTime) / drawInterval;
+            timer += (currentTime - lastTime);
+            lastTime = currentTime;
+            if(delta >= 1){
+                update();
+                repaint();
+                delta--;
+                drawCount++;
+            }
+            if(timer >= 1000000000){
+                System.out.println("FPS: " + drawCount);
+                drawCount = 0;
+                timer = 0;
+            }
+        }
+    }
+}

+ 52 - 0
src/main/java/ui/UI.java

@@ -0,0 +1,52 @@
+package ui;
+
+import util.GAMESTATE;
+
+import java.awt.*;
+
+public class UI {
+    private GamePanel gp;
+    private Graphics2D g2;
+    private Font arial_40;
+    private String message = "";
+    private boolean messageOn;
+
+    public UI(GamePanel gp){
+        this.gp = gp;
+        arial_40 = new Font("Arial", Font.PLAIN, 80);
+    }
+
+    public void showMessage(String text){
+        message = text;
+        messageOn = true;
+    }
+
+    public void draw(Graphics2D g2){
+        this.g2 = g2;
+        g2.setFont(arial_40);
+        g2.setColor(Color.white);
+
+        if(gp.gameState == GAMESTATE.PLAY){
+
+        }else if(gp.gameState == GAMESTATE.PAUSED){
+            drawPauseScreen();
+        }
+    }
+
+    private void drawPauseScreen(){
+        String text = "PAUSED";
+        int x = getXForCenteredText(text);
+        int y = gp.screenHeight / 2;
+
+        g2.setColor(new Color(25,31,52, 80));
+        g2.fillRect(0, 0, gp.screenWidth, gp.screenHeight);
+
+        g2.setColor(Color.WHITE);
+        g2.drawString(text, x, y);
+
+    }
+    public int getXForCenteredText(String text){
+        int length = (int)g2.getFontMetrics().getStringBounds(text, g2).getWidth();
+        return gp.screenWidth/2 - length/2;
+    }
+}

+ 7 - 0
src/main/java/ui/entity/Entity.java

@@ -0,0 +1,7 @@
+package ui.entity;
+
+public class Entity {
+
+    public double worldX, worldY;
+    public int speed;
+}

+ 9 - 0
src/main/java/ui/tile/Tile.java

@@ -0,0 +1,9 @@
+package ui.tile;
+
+import java.awt.image.BufferedImage;
+
+public class Tile {
+
+    public BufferedImage image;
+    public boolean collision = false;
+}

+ 103 - 0
src/main/java/ui/tile/TileManager.java

@@ -0,0 +1,103 @@
+package ui.tile;
+
+import ui.GamePanel;
+
+import javax.imageio.ImageIO;
+import java.awt.*;
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+
+public class TileManager {
+
+    GamePanel gamePanel;
+    Tile[] tile;
+    int mapTileNum[] [];
+
+    public TileManager(GamePanel gp){
+        this.gamePanel = gp;
+        tile = new Tile[10];
+        mapTileNum = new int[gp.maxWorldCol][gp.maxWorldRow];
+        getTileImage();
+        loadMap("/maps/world01.txt");
+    }
+
+    public void loadMap(String filePath){
+        try{
+            InputStream is = getClass().getResourceAsStream(filePath);
+            BufferedReader br = new BufferedReader(new InputStreamReader(is));
+
+            int col = 0;
+            int row = 0;
+            while(col < gamePanel.maxWorldCol && row < gamePanel.maxWorldRow){
+                String line = br.readLine();
+
+                while(col < gamePanel.maxWorldRow){
+                    String numbers[] = line.split(" ");
+
+                    int num = Integer.parseInt(numbers[col]);
+
+                    mapTileNum[col][row] = num;
+                    col++;
+                }
+                if(col == gamePanel.maxWorldCol) {
+                    col = 0;
+                    row++;
+                }
+            }
+            br.close();
+
+        }catch (Exception e){
+            e.printStackTrace();
+        }
+    }
+
+    public void draw(Graphics2D g2){
+        int worldCol = 0;
+        int worldRow = 0;
+
+        while (worldCol<gamePanel.maxWorldCol && worldRow < gamePanel.maxWorldRow){
+
+            int tileNum = mapTileNum[worldCol][worldRow];
+
+            int worldX = worldCol * gamePanel.tileSize;
+            int worldY = worldRow * gamePanel.tileSize;
+            double screenX = worldX - gamePanel.camera.worldX + gamePanel.camera.screenX;
+            double screenY = worldY - gamePanel.camera.worldY + gamePanel.camera.screenY;
+
+
+            if(worldX + gamePanel.tileSize > gamePanel.camera.worldX - gamePanel.camera.screenX &&
+               worldX - gamePanel.tileSize < gamePanel.camera.worldX + gamePanel.camera.screenX &&
+               worldY + gamePanel.tileSize > gamePanel.camera.worldY - gamePanel.camera.screenY &&
+               worldY - gamePanel.tileSize < gamePanel.camera.worldY + gamePanel.camera.screenY   ) {
+
+                g2.drawImage(tile[tileNum].image, (int) screenX, (int) screenY, gamePanel.tileSize, gamePanel.tileSize, null);
+            }
+
+            worldCol++;
+
+            if(worldCol == gamePanel.maxWorldCol){
+                worldCol = 0;
+                worldRow++;
+            }
+        }
+    }
+
+    public void getTileImage(){
+        try{
+            setupTile(0, "/tiles/grass.png");
+            setupTile(1, "/tiles/wall.png");
+            setupTile(2, "/tiles/water.png");
+            setupTile(3, "/tiles/earth.png");
+            setupTile(4, "/tiles/tree.png");
+            setupTile(5, "/tiles/sand.png");
+        }catch (IOException e){
+            e.printStackTrace();
+        }
+    }
+    private void setupTile(int index, String path) throws IOException {
+        tile[index] = new Tile();
+        tile[index].image = ImageIO.read(getClass().getResourceAsStream(path));
+    }
+}

+ 6 - 0
src/main/java/util/GAMESTATE.java

@@ -0,0 +1,6 @@
+package util;
+
+public enum GAMESTATE {
+    PLAY,
+    PAUSED
+}

+ 69 - 0
src/main/java/util/KeyHandler.java

@@ -0,0 +1,69 @@
+package util;
+
+import ui.GamePanel;
+
+import java.awt.event.KeyEvent;
+import java.awt.event.KeyListener;
+
+public class KeyHandler implements KeyListener {
+
+    public boolean upPressed, downPressed, leftPressed, rightPressed;
+
+    GamePanel gp;
+
+    public KeyHandler(GamePanel gp){
+        this.gp = gp;
+    }
+
+    @Override
+    public void keyTyped(KeyEvent e) {
+        // Not used
+    }
+
+    @Override
+    public void keyPressed(KeyEvent e) {
+        int code = e.getKeyCode();
+        if(code == KeyEvent.VK_W){
+            upPressed = true;
+        }
+        if(code == KeyEvent.VK_A){
+            leftPressed = true;
+        }
+        if(code == KeyEvent.VK_S){
+            downPressed = true;
+        }
+        if(code == KeyEvent.VK_D){
+            rightPressed = true;
+        }
+        if(code == KeyEvent.VK_UP){
+            gp.zoomInOut(1);
+        }
+        if(code == KeyEvent.VK_DOWN){
+            gp.zoomInOut(-1);
+        }
+        if(code == KeyEvent.VK_ESCAPE){
+            if(gp.gameState == GAMESTATE.PLAY){
+                gp.gameState = GAMESTATE.PAUSED;
+            }else if(gp.gameState == GAMESTATE.PAUSED){
+                gp.gameState = GAMESTATE.PLAY;
+            }
+        }
+    }
+
+    @Override
+    public void keyReleased(KeyEvent e) {
+        int code = e.getKeyCode();
+        if(code == KeyEvent.VK_W){
+            upPressed = false;
+        }
+        if(code == KeyEvent.VK_A){
+            leftPressed = false;
+        }
+        if(code == KeyEvent.VK_S){
+            downPressed = false;
+        }
+        if(code == KeyEvent.VK_D){
+            rightPressed = false;
+        }
+    }
+}

+ 12 - 0
src/main/resources/maps/map01.txt

@@ -0,0 +1,12 @@
+0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+0 0 0 0 0 0 0 1 2 1 0 0 0 0 0 0
+0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+0 0 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4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4

BIN
src/main/resources/sprites/bigrock.png


BIN
src/main/resources/sprites/hut.png


BIN
src/main/resources/tiles/earth.png


BIN
src/main/resources/tiles/grass.png


BIN
src/main/resources/tiles/sand.png


BIN
src/main/resources/tiles/tree.png


BIN
src/main/resources/tiles/wall.png


BIN
src/main/resources/tiles/water.png


+ 10 - 0
src/test/java/GUI/BasicGUITest.java

@@ -0,0 +1,10 @@
+package GUI;
+
+import org.junit.jupiter.api.Test;
+
+public class BasicGUITest {
+    @Test
+    public static void startUI(){
+
+    }
+}