Doors fixed

master
Jonathan Hager 5 years ago
parent 8937f9c91c
commit 6c9a3dd60e

@ -89,6 +89,14 @@
<object id="14" x="12.5" y="1" width="363.5" height="7"/>
</objectgroup>
<objectgroup id="7" name="DoorRects">
<object id="16" x="160" y="311.5" width="64" height="9">
<properties>
<property name="destinationDoor" type="int" value="1"/>
<property name="destinationMap" type="int" value="1"/>
<property name="exit" type="int" value="0"/>
<property name="id" type="int" value="0"/>
</properties>
</object>
<object id="15" x="375.5" y="129" width="8" height="63.5">
<properties>
<property name="destinationDoor" type="int" value="0"/>
@ -97,14 +105,6 @@
<property name="id" type="int" value="1"/>
</properties>
</object>
<object id="16" x="160" y="311.5" width="64" height="9">
<properties>
<property name="destinationDoor" type="int" value="1"/>
<property name="destinationMap" type="int" value="1"/>
<property name="exit" type="int" value="0"/>
<property name="id" type="int" value="0"/>
</properties>
</object>
</objectgroup>
<objectgroup id="8" name="InteractionRects">
<object id="17" x="288" y="96" width="32" height="32">

@ -122,7 +122,7 @@ public class MapContainer {
doors = new Door[tempDoors.size()];
for(int i = 0; i < doors.length; i++) {
doors[i] = tempDoors.get(i);
if(i == inDoor) {
if(doors[i].id == inDoor) {
int facing = doors[i].exit;
System.out.println(i + " " + inDoor);
switch(facing) {

@ -159,12 +159,14 @@ public class Player extends Actor{
playerSprite.updateAnimation(delta);
super.act(delta); //To change body of generated methods, choose Tools | Templates.
/*
System.out.println("--");
System.out.println(quest.questText);
quest.updateQuest(getStage().getActors());
quest.print();
System.out.println(quest.finished);
System.out.println("--");
*/
}

@ -28,6 +28,7 @@ public class GameScreen extends AbstractScreen{
public void loadNewMap(int map, int doorId){
String filename = "tiledmapData/maps/map" + map + ".tmx";
this.map = new MapContainer(Main.CAMERA_WIDTH, Main.CAMERA_HEIGHT, this.map.getPlayer(), filename, doorId, map);
System.out.println("Doorid: " + doorId);
}
@Override
@ -37,14 +38,7 @@ public class GameScreen extends AbstractScreen{
@Override
public void render(float f) {
map.render(f);
/*
if(Gdx.input.isKeyJustPressed(Input.Keys.NUM_1)){
loadNewMap("map.tmx");
}
if(Gdx.input.isKeyJustPressed(Input.Keys.NUM_2)){
loadNewMap("map2.tmx");
}
*/
if(map.collidingDoor != null) {
loadNewMap(map.collidingDoor.destinationMap, map.collidingDoor.destinationDoor);
}

Loading…
Cancel
Save