mirror of
https://github.com/jokerx3/HeatUp
synced 2026-07-27 08:49:44 +02:00
Karte kann nun skalieren.
Config.setGamePanelWidth(int width);
This commit is contained in:
@@ -5,10 +5,18 @@ package de.heatup.cfg;
|
||||
*/
|
||||
public class Config {
|
||||
/*
|
||||
* Map related magic numbers
|
||||
* de.heatup.mapengine.*
|
||||
*/
|
||||
public static final int singleTilePixels = 25;
|
||||
public static final int triggerAreaAddition = 20;
|
||||
public static final int mapMaxTilesWidth = 32;
|
||||
public static final int mapMaxTilesHeight = 24;
|
||||
public static int gamePanelWidth = 800;
|
||||
public static int singleTilePixels = gamePanelWidth/mapMaxTilesWidth;
|
||||
public static void setGamePanelWidth(int width) {
|
||||
gamePanelWidth = width;
|
||||
updateSingleTilePixels();
|
||||
}
|
||||
private static void updateSingleTilePixels() {
|
||||
singleTilePixels = gamePanelWidth/mapMaxTilesHeight;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ public class MapEngine {
|
||||
private static final int singleTileWidth = Config.singleTilePixels;
|
||||
private final int mapHeight = Config.mapMaxTilesHeight;
|
||||
private final int mapWidth = Config.mapMaxTilesWidth;
|
||||
private final int gamePanelWidth = Config.gamePanelWidth;
|
||||
|
||||
HashMap<Character, ArrayList<Point>> allMapTiles = new HashMap<Character, ArrayList<Point>>();
|
||||
ArrayList<Character> availableHardwareTileTypes = new ArrayList<Character>();
|
||||
@@ -70,7 +71,7 @@ public class MapEngine {
|
||||
/*
|
||||
* setze x und y auf die koordinaten für das objekt im NÄCHSTEN durchlauf
|
||||
*/
|
||||
if (x+singleTileWidth >= 800) {
|
||||
if (x+singleTileWidth >= gamePanelWidth) {
|
||||
x = 0;
|
||||
y += singleTileWidth;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user