tiledMap edited

master
GammelJAN 5 years ago
parent 335e74f825
commit 0cdbfa693a

@ -1,2 +1,2 @@
Das hier ist ein Schild
interessant...#-1
Hier gehts noch nirgends hin
Das will ich sehen#-1

@ -0,0 +1,2 @@
Hier gehts noch nirgends hin
Das will ich sehen#-1

@ -1,21 +1,16 @@
Ich bin der zweite
gut#5
schlecht#9
Hey ich verstecke mich hier!
Ich werd nichts sagen#5
Das wert ich verpetzen#9
Das freut mich
wie gehts dir#20
wie gehts dir#15
tschüss#-1
Das tut mir leid. Wieso denn?
Spaß mir gehts gut#5
tschüss#-1
Halts Maul#14
Ey es gibt gleich Stress hier
cool, bin ich dabei#17
cool, bin ich dabei#12
KAMPF
LOS#-1
Ich will Krieg
KRIEG!#17
KRIEG!#12

@ -0,0 +1,2 @@
Im Regal sind viele Kochbücher
...#-1

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.4" tiledversion="1.4.3" orientation="orthogonal" renderorder="right-down" width="40" height="50" tilewidth="32" tileheight="32" infinite="0" nextlayerid="10" nextobjectid="84">
<map version="1.4" tiledversion="1.4.3" orientation="orthogonal" renderorder="right-down" width="40" height="50" tilewidth="32" tileheight="32" infinite="0" nextlayerid="10" nextobjectid="103">
<tileset firstgid="1" source="../tilesets/terrain.tsx"/>
<tileset firstgid="2049" source="../tilesets/village.tsx"/>
<tileset firstgid="3849" source="../tilesets/crops.tsx"/>
@ -170,7 +170,7 @@
3623,3623,3623,3623,3623,3623,3623,3623,3623,3623,3623,3623,3623,3623,3623,3623,3623,3623,3623,3623,3624,0,0,0,0,0,0,0,0,0,2067,2068,2309,0,0,0,0,0,0,0
</data>
</layer>
<layer id="4" name="above0" width="40" height="50" visible="0">
<layer id="4" name="above0" width="40" height="50">
<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,
@ -224,7 +224,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
</data>
</layer>
<layer id="5" name="above1" width="40" height="50" visible="0">
<layer id="5" name="above1" width="40" height="50">
<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,
@ -348,8 +348,77 @@
<object id="81" x="1024" y="992" width="32" height="32"/>
<object id="82" x="1056" y="1024" width="32" height="32"/>
<object id="83" x="1056" y="1056" width="32" height="544"/>
<object id="84" x="128" y="896" width="32" height="32"/>
<object id="85" x="32" y="640" width="64" height="32"/>
<object id="86" x="96" y="672" width="64" height="32"/>
<object id="96" x="832" y="256" width="128" height="32"/>
</objectgroup>
<objectgroup id="7" name="DoorRects">
<object id="88" x="150.875" y="191.75" width="52.625" height="43.625">
<properties>
<property name="destinationDoor" type="int" value="0"/>
<property name="destinationMap" type="int" value="3"/>
<property name="exit" type="int" value="2"/>
<property name="id" type="int" value="0"/>
</properties>
</object>
<object id="89" x="655" y="191.625" width="64.5" height="31.375">
<properties>
<property name="destinationDoor" type="int" value="0"/>
<property name="destinationMap" type="int" value="2"/>
<property name="exit" type="int" value="2"/>
<property name="id" type="int" value="1"/>
</properties>
</object>
<object id="90" x="0" y="1056" width="21.5" height="288">
<properties>
<property name="destinationDoor" type="int" value="0"/>
<property name="destinationMap" type="int" value="4"/>
<property name="exit" type="int" value="3"/>
<property name="id" type="int" value="2"/>
</properties>
</object>
<object id="91" x="672" y="1586.5" width="300.5" height="13.5">
<properties>
<property name="destinationDoor" type="int" value="0"/>
<property name="destinationMap" type="int" value="5"/>
<property name="exit" type="int" value="0"/>
<property name="id" type="int" value="3"/>
</properties>
</object>
</objectgroup>
<objectgroup id="8" name="InteractionRects">
<object id="92" x="608" y="960" width="32" height="32">
<properties>
<property name="id" type="int" value="1"/>
<property name="texture" value="sign.png"/>
</properties>
</object>
<object id="93" x="128" y="1024" width="32" height="32">
<properties>
<property name="id" type="int" value="0"/>
<property name="texture" value="sign.png"/>
</properties>
</object>
<object id="95" x="672" y="1472" width="32" height="32">
<properties>
<property name="id" type="int" value="2"/>
<property name="texture" value="sign.png"/>
</properties>
</object>
</objectgroup>
<objectgroup id="9" name="NpcRects">
<object id="98" x="896" y="288" width="64" height="64">
<properties>
<property name="id" type="int" value="0"/>
<property name="texture" value="sprite.png"/>
</properties>
</object>
<object id="102" x="544" y="128" width="32" height="32">
<properties>
<property name="id" type="int" value="1"/>
<property name="texture" value="sprite.png"/>
</properties>
</object>
</objectgroup>
<objectgroup id="7" name="DoorRects"/>
<objectgroup id="8" name="InteractionRects"/>
<objectgroup id="9" name="NpcRects"/>
</map>

@ -0,0 +1,125 @@
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.4" tiledversion="1.4.3" orientation="orthogonal" renderorder="right-down" width="12" height="10" tilewidth="32" tileheight="32" infinite="0" nextlayerid="10" nextobjectid="20">
<tileset firstgid="1" source="../tilesets/village.tsx"/>
<tileset firstgid="1801" source="../tilesets/worldborder.tsx"/>
<tileset firstgid="1809" source="../tilesets/furniture.tsx"/>
<layer id="1" name="under0" width="12" height="10">
<data encoding="csv">
1803,1801,1801,1801,1801,1801,1801,1801,1801,983,0,1804,
983,983,983,983,983,983,983,983,983,983,983,983,
983,983,983,983,983,983,983,983,983,983,983,983,
983,983,983,983,983,983,983,983,983,983,983,983,
983,983,983,983,983,983,983,983,983,983,983,983,
983,983,983,983,983,983,983,983,983,983,983,983,
983,983,983,983,983,983,983,983,983,983,983,983,
983,983,983,983,983,983,983,983,983,983,983,983,
983,983,983,983,983,983,983,983,983,983,983,983,
983,983,983,983,983,983,983,983,983,983,983,983
</data>
</layer>
<layer id="3" name="under1" width="12" height="10">
<data encoding="csv">
0,1830,1831,1832,1833,1834,0,0,0,0,0,0,
0,1862,1863,1864,1865,1866,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
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="under2" width="12" height="10">
<data encoding="csv">
0,2501,0,0,0,0,0,2531,2532,0,0,0,
0,0,0,0,0,0,0,2563,2564,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,1996,1996,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,2021,2022,2023,0,0,0,0,0,0,0,
0,0,2053,2054,2055,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,2691,2692,2693,0,
0,0,0,0,0,0,0,0,2723,2724,2725,0,
0,0,0,0,0,0,0,0,0,0,0,0
</data>
</layer>
<layer id="5" name="above0" width="12" height="10">
<data encoding="csv">
0,0,0,0,0,0,0,0,0,1801,1801,0,
1805,0,0,0,0,0,0,0,0,1837,1869,1802,
1805,0,0,0,0,0,0,0,0,1964,1964,1802,
1805,0,0,0,0,0,0,0,0,0,0,1802,
1805,0,1989,2317,1991,0,0,0,0,0,0,0,
1805,0,0,0,0,0,0,0,0,0,0,0,
1805,0,0,0,0,0,0,0,2659,2660,2661,1802,
1805,0,0,0,0,0,0,0,0,0,0,1802,
1805,0,0,0,0,0,0,0,0,0,0,1802,
1807,1806,1806,1806,1806,0,0,1806,1806,1806,1806,1808
</data>
</layer>
<layer id="6" name="above1" width="12" height="10" visible="0">
<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,1990,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
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>
<objectgroup id="2" name="CollisionRects">
<object id="1" x="64" y="160" width="96" height="64"/>
<object id="3" x="96.5" y="140.5" width="31" height="18"/>
<object id="4" x="293" y="257" width="24" height="16"/>
<object id="5" x="276" y="224.5" width="58" height="31"/>
<object id="6" x="288.5" y="97.5" width="62" height="26"/>
<object id="7" x="224" y="0" width="64" height="64"/>
<object id="8" x="32" y="19.5" width="160" height="32"/>
<object id="9" x="0" y="0" width="12.5" height="320"/>
<object id="10" x="12.5" y="312" width="147.5" height="8.5"/>
<object id="11" x="224" y="311" width="160" height="9"/>
<object id="12" x="371.5" y="193" width="12.5" height="118"/>
<object id="13" x="376" y="0.5" width="8" height="127.5"/>
<object id="14" x="12.5" y="1" width="363.5" height="7"/>
</objectgroup>
<objectgroup id="7" name="DoorRects">
<object id="15" x="375.5" y="129" width="8" height="63.5">
<properties>
<property name="destinationDoor" type="int" value="0"/>
<property name="destinationMap" type="int" value="6"/>
<property name="exit" type="int" value="1"/>
<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">
<properties>
<property name="id" type="int" value="0"/>
<property name="texture" value="-"/>
</properties>
</object>
</objectgroup>
<objectgroup id="9" name="NpcRects">
<object id="19" x="32" y="64" width="160" height="64">
<properties>
<property name="id" type="int" value="0"/>
<property name="texture" value="sprite.png"/>
</properties>
</object>
</objectgroup>
</map>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1003 B

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<tileset version="1.4" tiledversion="1.4.3" name="worldborder" tilewidth="32" tileheight="32" tilecount="8" columns="4">
<image source="../pngs/worldBorder.png" width="128" height="64"/>
</tileset>

@ -38,6 +38,22 @@ public class InteractionObject extends Actor{
setBounds(xPos, yPos, animatedSprite.getSprite().getWidth(), animatedSprite.getSprite().getHeight());
}
public InteractionObject(Rectangle collisionRect, float xPos, float yPos,int mapId, int id){
setName("interactive");
this.id = id;
currentlyTalking = false;
this.collisionRect = collisionRect;
dialoguePath = "mapData/map"+mapId+"/interactionObjects/"+id+"/dialogue.txt";
parser = new DialogueParser(dialoguePath);
Dialogue nextDialogue = parser.firstDialogue();
this.t = new Textbox(nextDialogue.question, nextDialogue.ans, getX()+getWidth()/2, getY()+getHeight()/2);
setBounds(xPos, yPos, collisionRect.getWidth(), collisionRect.getHeight());
}
public void startDialogue(float xPos, float yPos) {
currentlyTalking = true;
getStage().addActor(new Textbox(t, xPos, yPos));
@ -45,7 +61,9 @@ public class InteractionObject extends Actor{
@Override
protected void positionChanged() {
animatedSprite.setSpritePosition((int)getX(), (int)getY());
if(animatedSprite != null)animatedSprite.setSpritePosition((int)getX(), (int)getY());
collisionRect = new Rectangle(getX() + 16, getY(), 32, 48);
super.positionChanged();
}
@ -74,13 +92,13 @@ public class InteractionObject extends Actor{
}
}
animatedSprite.updateAnimation(delta);
if(animatedSprite != null)animatedSprite.updateAnimation(delta);
}
@Override
public void draw(Batch batch, float parentAlpha) {
animatedSprite.draw(batch);
if(animatedSprite != null)animatedSprite.draw(batch);
super.draw(batch, parentAlpha); //To change body of generated methods, choose Tools | Templates.
}

@ -109,7 +109,13 @@ public class MapContainer {
int id = props.get("id", Integer.class);
String texture = props.get("texture", String.class);
stage.addActor(new InteractionObject(rect, rect.getX(), rect.getY(), mapId, id, texture));
if(texture.equals("-")){
stage.addActor(new InteractionObject(rect, rect.getX(), rect.getY(), mapId, id));
}
else{
stage.addActor(new InteractionObject(rect, rect.getX(), rect.getY(), mapId, id, texture));
}
stage.addActor(new MapCollisionObject((int) rect.x, (int) rect.y, (int) rect.width, (int) rect.height));
}

@ -22,11 +22,11 @@ public class GameScreen extends AbstractScreen{
super(game, CAMERA_WIDTH, CAMERA_HEIGHT);
//setTextbox(new Textbox("How are you doing my friend How are you doing my friend How are you doing my friend How are you doing my friend", "good", "bad"));
map = new MapContainer(CAMERA_WIDTH, CAMERA_HEIGHT, new Player(200, 200), "tiledmapData/map2.tmx", 0, 2);
map = new MapContainer(CAMERA_WIDTH, CAMERA_HEIGHT, new Player(200, 200), "tiledmapData/maps/map1.tmx", 2, 1);
}
public void loadNewMap(int map, int doorId){
String filename = "tiledmapData/map" + map + ".tmx";
String filename = "tiledmapData/maps/map" + map + ".tmx";
this.map = new MapContainer(Main.CAMERA_WIDTH, Main.CAMERA_HEIGHT, this.map.getPlayer(), filename, doorId, map);
}

Loading…
Cancel
Save