finished dialogue system
This commit is contained in:
@@ -37,7 +37,7 @@ public class GamePanel extends JPanel implements Runnable {
|
||||
|
||||
// SYSTEM
|
||||
public TileManager tileM = new TileManager(this);
|
||||
KeyHandler keyH = new KeyHandler(this);
|
||||
public KeyHandler keyH = new KeyHandler(this);
|
||||
Sound se = new Sound();
|
||||
Sound music = new Sound();
|
||||
public CollisionHandler collisionH = new CollisionHandler(this);
|
||||
|
||||
@@ -51,10 +51,14 @@ public class UI {
|
||||
int height = panel.tileSize*4;
|
||||
drawSubWindow(x, y, width, height);
|
||||
|
||||
graphics2d.setFont(graphics2d.getFont().deriveFont(Font.PLAIN, 23));
|
||||
graphics2d.setFont(graphics2d.getFont().deriveFont(Font.PLAIN, 28F));
|
||||
x += panel.tileSize;
|
||||
y += panel.tileSize;
|
||||
graphics2d.drawString(currentDialogue, x, y);
|
||||
|
||||
for(String line : currentDialogue.split("\n")) {
|
||||
graphics2d.drawString(line, x, y);
|
||||
y += 40;
|
||||
}
|
||||
}
|
||||
|
||||
public void drawSubWindow(int x, int y, int width, int height) {
|
||||
|
||||
@@ -8,7 +8,7 @@ import java.awt.event.KeyListener;
|
||||
|
||||
public class KeyHandler implements KeyListener {
|
||||
|
||||
public boolean upPressed, downPressed, leftPressed, rightPressed;
|
||||
public boolean upPressed, downPressed, leftPressed, rightPressed, spacePressed;
|
||||
public GamePanel panel;
|
||||
// DEBUG
|
||||
public boolean checkDrawTime = false;
|
||||
@@ -31,6 +31,7 @@ public class KeyHandler implements KeyListener {
|
||||
case KeyEvent.VK_S, KeyEvent.VK_DOWN -> downPressed = true;
|
||||
case KeyEvent.VK_A, KeyEvent.VK_LEFT -> leftPressed = true;
|
||||
case KeyEvent.VK_D, KeyEvent.VK_RIGHT -> rightPressed = true;
|
||||
case KeyEvent.VK_SPACE -> spacePressed = true;
|
||||
|
||||
// DEBUG OPTIONS
|
||||
case KeyEvent.VK_T -> checkDrawTime = !checkDrawTime;
|
||||
|
||||
Reference in New Issue
Block a user