diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..6b2f7db Binary files /dev/null and b/.DS_Store differ diff --git a/res/pause/PauseOverlay.png b/res/pause/PauseOverlay.png new file mode 100644 index 0000000..3fc1f0d Binary files /dev/null and b/res/pause/PauseOverlay.png differ diff --git a/src/drawing/GameScreen.java b/src/drawing/GameScreen.java index a11457c..45abb3b 100644 --- a/src/drawing/GameScreen.java +++ b/src/drawing/GameScreen.java @@ -7,7 +7,9 @@ import javafx.scene.input.KeyEvent; import javafx.scene.input.MouseButton; import javafx.scene.input.MouseEvent; +import javafx.scene.layout.StackPane; import javafx.scene.paint.Color; +import javafx.scene.shape.Rectangle; import logic.game.GameLogic; import sharedObject.IRenderable; import sharedObject.RenderableHolder; @@ -77,6 +79,11 @@ public void paintComponent() { } } + public void drawGamePauseOverlay() { + GraphicsContext gc = this.getGraphicsContext2D(); + gc.drawImage(RenderableHolder.pauseOverlay, 480, 252 ); + } + public GameScreen getGameScreen() { return this; } diff --git a/src/logic/entity/Chicknight.java b/src/logic/entity/Chicknight.java index 00e9b7b..970976d 100644 --- a/src/logic/entity/Chicknight.java +++ b/src/logic/entity/Chicknight.java @@ -128,13 +128,13 @@ public void update() { } public void initSolidArea() { - solidArea = new Rectangle(16, 0, 32, 64); + solidArea = new Rectangle(0, 0, 32, 64); } public void initAttackBlock() { // screenX = worldX-gameLogic.getPlayer().worldX+gameLogic.getPlayer().screenX; // screenY = worldY-gameLogic.getPlayer().worldY+gameLogic.getPlayer().screenY; - attackBlock = new Rectangle(screenX, screenY, 20 * 2, 20 * 2); + attackBlock = new Rectangle(screenX, screenY, 10 * 2, 7 * 2); // attackOffset = (int)(*2); } @@ -179,7 +179,7 @@ public void drawHitbox(GraphicsContext gc) { public void drawAttackBlock(GraphicsContext gc) { gc.setFill(Color.BLACK); - gc.strokeRect(attackBlock.getX(), attackBlock.getY(), attackBlock.getWidth(), attackBlock.getHeight()); + gc.strokeRect(attackBlock.getX()+solidArea.getWidth(), attackBlock.getY(), attackBlock.getWidth(), attackBlock.getHeight()); } } diff --git a/src/logic/entity/Player.java b/src/logic/entity/Player.java index d12ad41..2fe5b9c 100644 --- a/src/logic/entity/Player.java +++ b/src/logic/entity/Player.java @@ -183,7 +183,7 @@ else if (health<=0) { } public void initSolidArea() { - solidArea = new Rectangle(0,0,44,64); + solidArea = new Rectangle(0,0,32,64); } public void initAttackBlock() { @@ -195,7 +195,7 @@ public void updateAttackBlock() { attackBlock.setX(screenX+(int)solidArea.getWidth()); // attackBlock.setLayoutX(0); }else if(direction=="left") { - attackBlock.setX(screenX+(int)solidArea.getWidth()-(int)(42d*2)); + attackBlock.setX(screenX+(int)solidArea.getWidth()-(int)(30*2)); } attackBlock.setY(screenY+(int)(10*2)); } diff --git a/src/logic/entity/ShadowPot.java b/src/logic/entity/ShadowPot.java new file mode 100644 index 0000000..69461e6 --- /dev/null +++ b/src/logic/entity/ShadowPot.java @@ -0,0 +1,5 @@ +package logic.entity; + +public class ShadowPot { + +} diff --git a/src/logic/game/GameLogic.java b/src/logic/game/GameLogic.java index affaa55..4593009 100644 --- a/src/logic/game/GameLogic.java +++ b/src/logic/game/GameLogic.java @@ -5,6 +5,7 @@ import drawing.GameScreen; import input.InputUtility; +import javafx.scene.canvas.GraphicsContext; import javafx.scene.input.KeyCode; import logic.entity.Chicknight; import logic.entity.Entity; @@ -159,6 +160,7 @@ public void checkGameState() { if(gameState == playState) { gameState = pauseState; + gameScreen.drawGamePauseOverlay(); } else if (gameState == pauseState) { gameState = playState; diff --git a/src/sharedObject/RenderableHolder.java b/src/sharedObject/RenderableHolder.java index 4e03b82..bb0515b 100644 --- a/src/sharedObject/RenderableHolder.java +++ b/src/sharedObject/RenderableHolder.java @@ -24,7 +24,7 @@ public class RenderableHolder { public static Image blackStarTile; public static Image blackTile; public static Image CKLeft, CKLeftWalk1, CKLeftWalk2, CKLeftAtk, CKRight, CKRightWalk1, CKRightWalk2, CKRightAtk; - public static Image pauseMenu, soundButton, urm, volumeButton; + public static Image pauseOverlay,pauseMenu, soundButton, urm, volumeButton; public static Image GELeft, GELeftWalk, GELeftWalk2, GERight, GERightWalk, GERightWalk2; public static Image MTLeft1, MTLeft2, MTRight1, MTRight2; public static Image moonSprite; @@ -81,10 +81,11 @@ public static void loadResource() { MTRight2 = new Image(ClassLoader.getSystemResource("MagicalTortoise/MagicalTortoiseRight2.png").toString()); // Pause - pauseMenu = new Image(ClassLoader.getSystemResource("pause/pause_menu.png").toString()); - soundButton = new Image(ClassLoader.getSystemResource("pause/sound_button.png").toString()); - urm = new Image(ClassLoader.getSystemResource("pause/urm_buttons.png").toString()); - volumeButton = new Image(ClassLoader.getSystemResource("pause/volume_buttons.png").toString()); + pauseOverlay = new Image(ClassLoader.getSystemResource("pause/PauseOverlay.png").toString()); +// pauseMenu = new Image(ClassLoader.getSystemResource("pause/.png").toString()); +// soundButton = new Image(ClassLoader.getSystemResource("pause/sound_button.png").toString()); +// urm = new Image(ClassLoader.getSystemResource("pause/urm_buttons.png").toString()); +// volumeButton = new Image(ClassLoader.getSystemResource("pause/volume_buttons.png").toString()); // StatusBar healthBar = new Image(ClassLoader.getSystemResource("health_power_bar.png").toString());