From aec79e01ba110cc2145d3643fabc0af756c0d7ca Mon Sep 17 00:00:00 2001 From: mithe24 Date: Wed, 7 May 2025 17:17:44 +0200 Subject: fix/small-fixes (#14) * fix(model/entities): entites start in center of tile * style(pacman): It should be width and height, not height and width. * refactor(view): Changing setting of background color --- pacman/view/src/main/java/com/gr15/pacman/view/GameView.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'pacman/view/src/main') diff --git a/pacman/view/src/main/java/com/gr15/pacman/view/GameView.java b/pacman/view/src/main/java/com/gr15/pacman/view/GameView.java index d56a1e1..d9235f6 100644 --- a/pacman/view/src/main/java/com/gr15/pacman/view/GameView.java +++ b/pacman/view/src/main/java/com/gr15/pacman/view/GameView.java @@ -12,6 +12,7 @@ import javafx.scene.canvas.Canvas; import javafx.scene.canvas.GraphicsContext; import javafx.scene.image.Image; import javafx.scene.layout.StackPane; +import javafx.scene.paint.Color; import com.gr15.pacman.model.entities.Entity; import com.gr15.pacman.model.entities.Items; @@ -30,8 +31,8 @@ public class GameView private float scaleX = 4.0f; private float scaleY = 4.0f; - private int tileHeight; private int tileWidth; + private int tileHeight; private Map tileTextures = new HashMap<>(); private Map entityTextures = new HashMap<>(); @@ -41,7 +42,7 @@ public class GameView private Sprite pacmanSprite; public GameView(GameState gameState, - int tileHeight, int tileWidth) { + int tileWidth, int tileHeight) { super(new StackPane()); root = (StackPane)super.getRoot(); @@ -52,6 +53,7 @@ public class GameView this.tileHeight = tileHeight; this.tileWidth = tileWidth; this.gameState = gameState; + this.setFill(Color.BLACK); tileTextures.put(TileType.WALL, new Image( this.getClass().getResourceAsStream("/gameAssets/wall.png"))); -- cgit v1.2.3-70-g09d2