Skip to content
This repository was archived by the owner on Jul 30, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public void create() {
//Create new player
switchToPlayer(1);

board = new BoardClientImpl(ImmutableList.copyOf(players), "example.tmx");
board = new BoardClientImpl(ImmutableList.copyOf(players), "RiskyExchangeBoard.tmx");

var viewport = new ScalingViewport(Scaling.fit, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());

Expand All @@ -89,7 +89,7 @@ public void create() {
stage.addActor(table);

table.top();
table.add(new MapRendererWidget(board, 100));
table.add(new MapRendererWidget(board, 35));
table.row();

var bottomConsole = new PrintStreamLabel(3, System.out, skin, "default-font", Color.WHITE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,18 @@
*/
public class BoardClientImpl extends BoardImpl implements ClientBoard {

private final TiledMap map;
private TiledMap map;
public TiledMapTileLayer boardLayer;
public TiledMapTileLayer playerLayer;
public TiledMapTileLayer holeLayer;
public TiledMapTileLayer flagLayer;
public TiledMapTileLayer wallLayer;
public TiledMapTileLayer laserLayer;
public TiledMapTileLayer wrenchLayer;
public TiledMapTileLayer wrench2Layer;
public TiledMapTileLayer gearLayer;
public TiledMapTileLayer startLayer;
public TiledMapTileLayer conveyorLayer;

public TiledMapTileLayer.Cell playerWonCell;
public TiledMapTileLayer.Cell playerDiedCell;
Expand All @@ -35,7 +42,8 @@ public class BoardClientImpl extends BoardImpl implements ClientBoard {
*/
public BoardClientImpl(List<Player> players, String boardFilename) {
super(players, new ArrayList<>());
map = new TmxMapLoader().load(boardFilename);
TmxMapLoader mapLoader = new TmxMapLoader();
map = mapLoader.load(boardFilename);
loadCells();
tiles = tilesFromMap(boardFilename);
height = playerLayer.getHeight();
Expand All @@ -50,6 +58,14 @@ private void loadCells() {
playerLayer = (TiledMapTileLayer) map.getLayers().get("Player");
holeLayer = (TiledMapTileLayer) map.getLayers().get("Hole");
flagLayer = (TiledMapTileLayer) map.getLayers().get("Flag");
wallLayer = (TiledMapTileLayer) map.getLayers().get("Wall");
laserLayer = (TiledMapTileLayer) map.getLayers().get("Laser");
wrenchLayer = (TiledMapTileLayer) map.getLayers().get("Wrench");
wrench2Layer = (TiledMapTileLayer) map.getLayers().get("Wrench2");
gearLayer = (TiledMapTileLayer) map.getLayers().get("Gear");
startLayer = (TiledMapTileLayer) map.getLayers().get("Start");
conveyorLayer = (TiledMapTileLayer) map.getLayers().get("Conveyor");


var tileSize = getTextureTileSize();

Expand Down Expand Up @@ -96,6 +112,7 @@ private ImmutableList<List<List<TileType>>> tilesFromMap(String boardFilename) {

if (flagLayer.getCell(x, y) != null) {
acc.add(Tiles.FLAG);

}

accY.add(ImmutableList.copyOf(acc));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ public void resume() {

@Override
public void show() {

}

@Override
Expand Down
164 changes: 164 additions & 0 deletions src/main/resources/Checkmate.tmx
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.5" tiledversion="1.5.0" orientation="orthogonal" renderorder="right-down" width="12" height="16" tilewidth="300" tileheight="300" infinite="0" nextlayerid="9" nextobjectid="1">
<tileset firstgid="1" source="../player.tsx"/>
<layer id="1" name="Background" width="12" height="16">
<data encoding="csv">
5,5,5,5,5,5,5,5,5,5,5,5,
5,5,5,5,5,5,5,5,5,5,5,5,
5,5,5,5,5,5,5,5,5,5,5,5,
5,5,5,5,5,5,5,5,5,5,5,5,
5,5,5,5,5,5,5,5,5,5,5,5,
5,5,5,5,5,5,5,5,5,5,5,5,
5,5,5,5,5,5,5,5,5,5,5,5,
5,5,5,5,5,5,5,5,5,5,5,5,
5,5,5,5,5,5,5,5,5,5,5,5,
5,5,5,5,5,5,5,5,5,5,5,5,
5,5,5,5,5,5,5,5,5,5,5,5,
5,5,5,5,5,5,5,5,5,5,5,5,
5,5,5,5,5,5,5,5,5,5,5,5,
5,5,5,5,5,5,5,5,5,5,5,5,
5,5,5,5,5,5,5,5,5,5,5,5,
5,5,5,5,5,5,5,5,5,5,5,5
</data>
</layer>
<layer id="5" name="holes" width="12" height="16">
<data encoding="csv">
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,6,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,6,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,6,0,0,0,
0,0,0,0,0,6,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0
</data>
</layer>
<layer id="6" name="yellow numbers" width="12" height="16">
<data encoding="csv">
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,97,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,98,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0
</data>
</layer>
<layer id="3" name="belt" width="12" height="16">
<data encoding="csv">
0,0,0,0,0,0,0,0,0,0,0,0,
0,19,14,14,14,14,14,14,14,14,20,0,
0,13,0,0,0,0,0,0,0,0,21,0,
0,13,0,0,0,0,0,0,0,0,21,0,
0,13,0,0,0,0,0,0,0,0,21,0,
0,13,0,0,0,0,0,0,0,0,21,0,
0,13,0,0,0,0,0,0,0,0,21,0,
0,13,0,0,0,0,0,0,0,0,21,0,
0,13,0,0,0,0,0,0,0,0,21,0,
0,13,0,0,0,0,0,0,0,0,21,0,
0,27,22,22,22,22,22,22,22,22,28,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0
</data>
</layer>
<layer id="4" name="arrows" width="12" height="16">
<data encoding="csv">
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,52,0,52,0,0,0,51,0,0,0,
0,0,0,0,0,52,0,51,0,51,0,0,
0,0,52,0,52,0,0,0,51,0,0,0,
0,0,0,52,0,0,0,51,0,51,0,0,
0,0,52,0,52,0,0,0,0,0,0,0,
0,0,0,52,0,0,0,51,0,51,0,0,
0,0,52,0,52,0,51,0,51,0,0,0,
0,0,0,52,0,52,0,51,0,51,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0
</data>
</layer>
<layer id="7" name="numbers" width="12" height="16">
<data encoding="csv">
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
131,129,0,123,0,121,122,0,124,0,130,132,
0,0,0,0,0,0,0,0,0,0,0,0
</data>
</layer>
<layer id="2" name="Walls" width="12" height="16">
<data encoding="csv">
0,0,31,0,31,0,0,31,0,31,0,0,
0,0,0,29,0,29,29,0,29,0,0,0,
30,0,0,0,0,0,51,0,0,0,0,23,
0,23,0,0,0,0,0,0,0,0,30,0,
30,0,0,0,0,0,0,0,0,0,0,23,
0,23,0,0,0,0,0,0,0,0,30,0,
0,23,0,0,0,0,0,0,0,0,30,0,
30,0,0,0,0,0,0,0,0,0,0,23,
0,23,0,0,0,0,0,0,0,0,30,0,
30,0,0,0,0,0,0,0,0,0,0,23,
0,0,0,31,0,31,31,0,31,0,0,0,
0,0,29,0,29,0,0,29,0,29,0,0,
0,0,31,0,31,0,0,31,0,31,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,30,0,30,0,30,30,30,0,30,0,30,
0,0,29,0,29,0,0,29,0,29,0,0
</data>
</layer>
<layer id="8" name="tools" width="12" height="16">
<data encoding="csv">
0,0,0,0,0,0,0,0,0,0,0,15,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,7,0,0,0,0,0,0,
0,0,0,0,0,0,7,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
15,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0
</data>
</layer>
</map>
144 changes: 144 additions & 0 deletions src/main/resources/Dizzy-Dash.tmx
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.5" tiledversion="1.5.0" orientation="orthogonal" renderorder="right-down" width="12" height="16" tilewidth="300" tileheight="300" infinite="0" nextlayerid="11" nextobjectid="1">
<tileset firstgid="1" source="../player.tsx"/>
<layer id="1" name="background" width="12" height="16">
<data encoding="csv">
5,5,5,5,5,5,5,5,5,5,5,5,
5,5,5,5,5,5,5,5,5,5,5,5,
5,5,5,5,5,5,5,5,5,5,5,5,
5,5,5,5,5,5,5,5,5,5,5,5,
5,5,5,5,5,5,5,5,5,5,5,5,
5,5,5,5,5,5,5,5,5,5,5,5,
5,5,5,5,5,5,5,5,5,5,5,5,
5,5,5,5,5,5,5,5,5,5,5,5,
5,5,5,5,5,5,5,5,5,5,5,5,
5,5,5,5,5,5,5,5,5,5,5,5,
5,5,5,5,5,5,5,5,5,5,5,5,
5,5,5,5,5,5,5,5,5,5,5,5,
5,5,5,5,5,5,5,5,5,5,5,5,
5,5,5,5,5,5,5,5,5,5,5,5,
5,5,5,5,5,5,5,5,5,5,5,5,
5,5,5,5,5,5,5,5,5,5,5,5
</data>
</layer>
<layer id="3" name="belts" width="12" height="16">
<data encoding="csv">
0,0,0,0,0,0,0,0,0,0,0,0,
0,19,14,14,20,0,0,19,14,14,20,0,
0,13,0,0,21,0,0,13,0,0,21,0,
0,13,0,0,21,0,0,13,0,0,21,0,
0,27,22,22,28,0,0,27,22,22,28,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,19,14,14,20,0,0,19,14,14,20,0,
0,13,0,0,21,0,0,13,0,0,21,0,
0,13,0,0,21,0,0,13,0,0,21,0,
0,27,22,22,28,0,0,27,22,22,28,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
52,52,36,0,0,0,0,0,0,33,51,51,
0,0,41,52,52,0,0,51,51,44,0,0
</data>
</layer>
<layer id="5" name="numbers" width="12" height="16">
<data encoding="csv">
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,97,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,99,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,98,0,
131,0,0,0,0,0,0,0,0,0,0,132,
0,129,0,0,0,0,0,0,0,0,130,0,
0,0,0,123,0,0,0,0,124,0,0,0,
0,0,0,0,0,121,122,0,0,0,0,0
</data>
</layer>
<layer id="8" name="tools" width="12" height="16">
<data encoding="csv">
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,15,0,0,0,0,0,7,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,7,0,0,0,0,0,15,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0
</data>
</layer>
<layer id="9" name="repairstation" width="12" height="16">
<data encoding="csv">
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,54,0,0,53,0,0,54,0,0,0,
0,0,0,54,0,0,0,0,0,54,0,0,
0,0,0,0,0,0,53,0,0,0,0,0,
0,0,0,0,53,0,0,0,0,53,0,0,
0,0,53,0,0,0,0,53,0,0,0,0,
0,0,0,0,0,53,0,0,0,0,0,0,
0,0,54,0,0,0,0,0,54,0,0,0,
0,0,0,54,0,0,53,0,0,54,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0
</data>
</layer>
<layer id="10" name="laser" width="12" height="16">
<data encoding="csv">
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,47,0,39,39,0,0,0,0,0,
0,0,0,47,0,0,0,0,0,0,0,0,
0,0,0,47,0,0,0,0,47,0,0,0,
0,0,0,47,0,0,0,0,47,0,0,0,
0,0,0,0,0,0,0,0,47,0,0,0,
0,0,0,0,0,39,39,0,47,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0
</data>
</layer>
<layer id="7" name="walls" width="12" height="16">
<data encoding="csv">
0,0,31,0,31,0,0,31,0,31,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
30,0,0,29,0,0,0,0,0,0,0,23,
0,0,0,0,0,30,23,0,0,0,0,0,
30,0,0,0,0,0,0,0,0,0,0,23,
0,0,0,0,0,0,0,0,31,0,0,0,
0,0,0,29,0,0,0,0,0,0,0,0,
30,0,0,0,0,0,0,0,0,0,0,23,
0,0,0,0,0,30,23,0,0,0,0,0,
30,0,0,0,0,0,0,0,31,0,0,23,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,29,0,29,0,0,29,0,29,0,0,
0,0,31,0,24,0,0,16,0,31,0,0,
0,30,30,0,0,0,0,0,0,23,23,0,
0,0,0,0,0,0,30,0,0,0,0,0,
0,0,0,0,0,0,30,0,0,0,0,0
</data>
</layer>
</map>
Loading