mirror of
https://github.com/jokerx3/HeatUp
synced 2026-07-27 08:49:44 +02:00
Merge branch 'master' of github.com:jokerx3/prp
This commit is contained in:
@@ -14,6 +14,10 @@ import de.heatup.logging.Logger;
|
||||
import de.heatup.objects.*;
|
||||
|
||||
public class MapEngine {
|
||||
/*
|
||||
* MAGIC NUMBER SINGLE TILE WIDTH
|
||||
*/
|
||||
private static final int singleTileWidth = 25;
|
||||
final int mapHeight = 24;
|
||||
final int mapWidth = 32;
|
||||
HashMap<Character, ArrayList<Point>> allMapTiles = new HashMap<Character, ArrayList<Point>>();
|
||||
@@ -78,11 +82,11 @@ public class MapEngine {
|
||||
/*
|
||||
* setze x und y auf die koordinaten für das objekt im NÄCHSTEN durchlauf
|
||||
*/
|
||||
if (x+25 >= 800) {
|
||||
if (x+singleTileWidth >= 800) {
|
||||
x = 0;
|
||||
y += 25;
|
||||
y += singleTileWidth;
|
||||
} else {
|
||||
x += 25;
|
||||
x += singleTileWidth;
|
||||
}
|
||||
}
|
||||
lineCount++;
|
||||
|
||||
@@ -36,17 +36,28 @@ public class MapObjectHandler {
|
||||
MapObjectHandler.allMapObjects.add(newStaticObject);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* die ganze methode ist unglaublich schlechter und hässlicher programmierstil, aber das weiß ich und ändere ich noch.
|
||||
*
|
||||
* mfg daniel. :)
|
||||
*/
|
||||
protected static void addAllWallsAndWaysTiles(MapEngine me) {
|
||||
for (int i = 0; i<me.getAvailableHardwareTileTypes().size(); i++) {
|
||||
char currentType = me.getAvailableHardwareTileTypes().get(i);
|
||||
if (currentType == '#' || currentType == '-') {
|
||||
ArrayList<Point> allPointsOfCurrentType = me.getAllCoordinatesOfTileType(currentType);
|
||||
for (int j = 0; j<allPointsOfCurrentType.size(); j++) {
|
||||
Point currentPoint = allPointsOfCurrentType.get(j);
|
||||
StaticObject newStaticObject = new StaticObject(currentType, currentPoint);
|
||||
MapObjectHandler.allMapObjects.add(newStaticObject);
|
||||
}
|
||||
}
|
||||
ArrayList<Point> allCoordinatesOfWayTileType = me.getAllCoordinatesOfTileType('#');
|
||||
ArrayList<Point> allCoordinatesOfWallTileType = me.getAllCoordinatesOfTileType('-');
|
||||
|
||||
for (int i = 0; i < allCoordinatesOfWayTileType.size(); i++) {
|
||||
Point currentPoint = allCoordinatesOfWayTileType.get(i);
|
||||
StaticObject newStaticObject = new StaticObject('#', currentPoint);
|
||||
MapObjectHandler.allMapObjects.add(newStaticObject);
|
||||
}
|
||||
for (int i = 0; i < allCoordinatesOfWallTileType.size(); i++) {
|
||||
Point currentPoint = allCoordinatesOfWallTileType.get(i);
|
||||
StaticObject newStaticObject = new StaticObject('-', currentPoint);
|
||||
MapObjectHandler.allMapObjects.add(newStaticObject);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user