From 2c3f7b5e15570d1104e05f2c5f07e186c46a013c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=85rne=20Reime?= <aarnereime01@gmail.com>
Date: Sat, 26 Mar 2022 11:47:25 +0100
Subject: [PATCH] =?UTF-8?q?La=20til=20en=20hvit=20border=20rundt=20tekstbo?=
 =?UTF-8?q?ksene,=20og=20fikset=20koordinatene=20n=C3=A5r=20du=20d=C3=B8r.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../java/inf112/skeleton/app/model/Checkpoint.java     | 10 +++++++---
 src/main/java/inf112/skeleton/app/model/NPC.java       | 10 ++++++++++
 src/main/java/inf112/skeleton/app/model/Player.java    |  2 +-
 src/main/java/inf112/skeleton/app/model/Waffle.java    |  4 ++++
 src/main/java/inf112/skeleton/app/view/Game.java       |  2 +-
 5 files changed, 23 insertions(+), 5 deletions(-)

diff --git a/src/main/java/inf112/skeleton/app/model/Checkpoint.java b/src/main/java/inf112/skeleton/app/model/Checkpoint.java
index d449a67..98fa2e5 100644
--- a/src/main/java/inf112/skeleton/app/model/Checkpoint.java
+++ b/src/main/java/inf112/skeleton/app/model/Checkpoint.java
@@ -67,11 +67,11 @@ public class Checkpoint implements IGameObject {
         gc.drawImage(checkpointImg, (this.x - this.w/2.0) - player.getX() + player.screenX, this.y - this.h/2.0, this.w, this.h);
     }
 
-    public void drawCheckpointText(GraphicsContext gc) {
+    public void drawCheckpointText(GraphicsContext gc, double w, double h) {
         int width = 240;
         int height = 50;
-        double x = (900/2.0) - width/2.0;
-        double y = 100;
+        double x = w/2 - width/2;
+        double y = h/3.5 - height/2;
 
         gc.setFill(Color.rgb(0, 0, 0, 0.8));
         gc.fillRoundRect(x, y, width, height, 35, 35);
@@ -80,6 +80,10 @@ public class Checkpoint implements IGameObject {
         gc.setFont(new Font("Comic sans MS", 20));
         gc.fillText("Checkpoint updated", x + 20, y + 30);
         gc.restore();
+
+        gc.setStroke(Color.WHITE);
+        gc.setLineWidth(5);
+        gc.strokeRoundRect(x, y, width, height, 35, 35);
     }
     
 }
diff --git a/src/main/java/inf112/skeleton/app/model/NPC.java b/src/main/java/inf112/skeleton/app/model/NPC.java
index bf53471..a40bab9 100644
--- a/src/main/java/inf112/skeleton/app/model/NPC.java
+++ b/src/main/java/inf112/skeleton/app/model/NPC.java
@@ -6,6 +6,8 @@ import javafx.scene.image.Image;
 import javafx.scene.paint.Color;
 import javafx.scene.text.Font;
 
+import java.awt.*;
+
 public class NPC implements IGameObject{
     int x, y, w, h, drawW;
     Image i1, i2, i3, i4, i5, i6;
@@ -114,6 +116,10 @@ public class NPC implements IGameObject{
         gc.fillText("Who goes there! Oh greetings,\n young traveler. I have heard\n a rumor that there is " +
                 "a mighty fine\ntreasure for the one who dear cross\n the forbidden lands.", x + 20, y + 50);
         gc.restore();
+
+        gc.setStroke(Color.WHITE);
+        gc.setLineWidth(5);
+        gc.strokeRoundRect(x, y, width, height, 35, 35);
     }
 
     public void drawInteractableOption(GraphicsContext gc, double w, double h) {
@@ -129,6 +135,10 @@ public class NPC implements IGameObject{
         gc.setFont(new Font("Comic sans MS", 20));
         gc.fillText("Hold x to interact with npc", x + 20, y + 50);
         gc.restore();
+
+        gc.setStroke(Color.WHITE);
+        gc.setLineWidth(5);
+        gc.strokeRoundRect(x, y, width, height, 35, 35);
     }
 
 }
diff --git a/src/main/java/inf112/skeleton/app/model/Player.java b/src/main/java/inf112/skeleton/app/model/Player.java
index 9369c95..15a8efa 100644
--- a/src/main/java/inf112/skeleton/app/model/Player.java
+++ b/src/main/java/inf112/skeleton/app/model/Player.java
@@ -15,7 +15,7 @@ public class Player implements IGameObject{
     public int runCounter = 0;
     public int invincibleTimer = 100;
 
-    public int spawnX = 7000; //45
+    public int spawnX = 45;
     public int spawnY = 50;
 
     public boolean move_left = false;
diff --git a/src/main/java/inf112/skeleton/app/model/Waffle.java b/src/main/java/inf112/skeleton/app/model/Waffle.java
index 3fca15b..ddd3234 100644
--- a/src/main/java/inf112/skeleton/app/model/Waffle.java
+++ b/src/main/java/inf112/skeleton/app/model/Waffle.java
@@ -82,6 +82,10 @@ public class Waffle implements IGameObject {
         gc.fillText("Hi! Waffle Thursday is closed and due\n to an error in the system, the very\n last waffle is made for " +
                 "two people,\n you and Anya!!! Battle against Anya\n to secure the last waffle.", x + 20, y + 50);
         gc.restore();
+
+        gc.setStroke(Color.WHITE);
+        gc.setLineWidth(5);
+        gc.strokeRoundRect(x, y, width, height, 35, 35);
     }
 
     public void waffleCount(GraphicsContext gc, Player player) {
diff --git a/src/main/java/inf112/skeleton/app/view/Game.java b/src/main/java/inf112/skeleton/app/view/Game.java
index 5991cdf..a57199b 100644
--- a/src/main/java/inf112/skeleton/app/view/Game.java
+++ b/src/main/java/inf112/skeleton/app/view/Game.java
@@ -501,7 +501,7 @@ public class Game extends Application {
             for (Checkpoint checkpoint : ListCheckpoint) {
                 checkpoint.drawCheckpoint(context, player);
                 if (checkpoint.drawText) {
-                    checkpoint.drawCheckpointText(context);
+                    checkpoint.drawCheckpointText(context, this.width, this.height);
                 }
             }
 
-- 
GitLab