diff options
| author | mithe24 <mithe24@student.sdu.dk> | 2025-05-07 17:17:44 +0200 |
|---|---|---|
| committer | mithe24 <mithe24@student.sdu.dk> | 2025-05-07 17:31:53 +0200 |
| commit | aec79e01ba110cc2145d3643fabc0af756c0d7ca (patch) | |
| tree | 09e35571a96265a6d5ba0733a4e8e7411bd19eb5 /pacman/view | |
| parent | c164daed53574babb26796b05682432709e2c5c1 (diff) | |
| download | pacman-aec79e01ba110cc2145d3643fabc0af756c0d7ca.tar.gz pacman-aec79e01ba110cc2145d3643fabc0af756c0d7ca.zip | |
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
Diffstat (limited to 'pacman/view')
| -rw-r--r-- | pacman/view/src/main/java/com/gr15/pacman/view/GameView.java | 6 |
1 files changed, 4 insertions, 2 deletions
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<TileType, Image> tileTextures = new HashMap<>(); private Map<Entity, Image> 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"))); |