added structure to assets

master
GammelJAN 5 years ago
parent 2bdf196687
commit 667028b41c

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 KiB

@ -0,0 +1,2 @@
Das hier ist ein Schild
interessant...#-1

@ -0,0 +1,2 @@
Hier wohnt Familie Müller
Hier riechts aber nach gutem Essen...#-1

@ -0,0 +1,2 @@
Moin, was geht?
Moin, alles was Beine hat hahahaha#-1

@ -0,0 +1,2 @@
Hier wohnt Familie Müller
gutes Essen gibts hier...#-1

@ -0,0 +1,9 @@
Hey! Ich koche hier!
kann ich was haben?#5
ok ciao#8
Nein! Raus aus meinem Haus!
okok#-1
Ja, tschüss.
hmmm...#-1

@ -0,0 +1,6 @@
Ich bin Jäger!
cool, hast du heute schon Beute gemacht?#5
tschüss#-1
Ne leider noch nicht. Bin ein schlechter Jäger
hahahah Noob#-1

Binary file not shown.

Before

Width:  |  Height:  |  Size: 108 KiB

Before

Width:  |  Height:  |  Size: 108 KiB

After

Width:  |  Height:  |  Size: 108 KiB

Before

Width:  |  Height:  |  Size: 1022 B

After

Width:  |  Height:  |  Size: 1022 B

Before

Width:  |  Height:  |  Size: 108 KiB

After

Width:  |  Height:  |  Size: 108 KiB

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Before

Width:  |  Height:  |  Size: 69 KiB

After

Width:  |  Height:  |  Size: 69 KiB

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 52 KiB

@ -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="30" height="40" tilewidth="32" tileheight="32" infinite="0" nextlayerid="10" nextobjectid="45">
<map version="1.4" tiledversion="1.4.3" orientation="orthogonal" renderorder="right-down" width="30" height="40" tilewidth="32" tileheight="32" infinite="0" nextlayerid="10" nextobjectid="46">
<tileset firstgid="1" source="terrain.tsx"/>
<tileset firstgid="2049" source="bazaar.tsx"/>
<tileset firstgid="2089" source="tileset.tsx"/>
@ -123,7 +123,7 @@
2767,2771,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2769,2736,
2799,2771,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2769,2736,
2799,2771,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2769,2736,
2799,2771,0,0,3547,3548,3548,3548,3548,3548,3549,3424,3426,0,0,0,0,0,0,0,0,0,0,0,2881,2882,0,0,2769,2736,
2799,2771,0,0,3547,3548,3548,3548,3548,3548,3549,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2769,2736,
2799,2771,0,0,3568,3569,3569,3569,3569,3569,3570,3445,3447,0,0,0,0,0,0,0,0,0,0,0,2913,2914,0,0,2769,2736,
2799,2771,0,0,3568,3569,3608,3372,3569,3609,3570,3445,3447,0,0,0,0,0,0,0,0,0,0,0,0,2940,0,0,2769,2736,
2799,2771,0,0,3568,3610,3569,3609,3371,3607,3570,3445,3447,0,0,0,0,0,0,2940,2840,2841,2842,2940,0,0,0,0,2769,2736,
@ -134,7 +134,7 @@
2799,2771,0,0,3589,3590,3590,3590,3590,3590,3590,3590,3591,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2769,2736,
2799,2771,0,0,0,0,4133,4134,4134,4135,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2769,2736,
2799,2771,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2769,2736,
2799,2800,2738,2738,2738,2738,2738,2738,2738,2738,2738,2738,2739,0,0,0,0,2737,2738,2738,2738,2738,2738,2738,2738,2738,2738,2738,2770,2736,
2799,2800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2770,2736,
2767,2768,2768,2768,2768,2768,2768,2768,2768,2768,2768,2768,2771,0,0,0,0,2769,2767,2768,2768,2768,2768,2768,2768,2768,2768,2768,2768,2768,
2799,2800,2800,2800,2800,2800,2800,2800,2800,2800,2800,2800,2771,0,0,0,0,2769,2799,2800,2800,2800,2800,2800,2800,2800,2800,2800,2800,2800
</data>
@ -167,7 +167,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,0,0,0,0,0,0,
0,0,0,0,0,0,4130,4132,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2744,2745,2746,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,3424,3426,0,0,0,0,0,0,0,2744,2745,2746,0,2881,2882,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2776,2777,2778,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2808,2809,2810,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
@ -178,7 +178,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,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,2738,2738,2738,2738,2738,2738,2738,2738,2738,2738,2739,0,0,0,0,2737,2738,2738,2738,2738,2738,2738,2738,2738,2738,2738,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,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>
@ -297,16 +297,24 @@
<property name="texture" value="sign.png"/>
</properties>
</object>
<object id="45" x="608" y="320" width="32" height="32">
<properties>
<property name="id" type="int" value="1"/>
<property name="texture" value="sign.png"/>
</properties>
</object>
</objectgroup>
<objectgroup id="9" name="NpcRects">
<object id="42" x="416" y="512" width="128" height="96">
<properties>
<property name="id" type="int" value="1"/>
<property name="id" type="int" value="0"/>
<property name="texture" value="sprite.png"/>
</properties>
</object>
<object id="43" x="416" y="640" width="128" height="96">
<properties>
<property name="id" type="int" value="2"/>
<property name="id" type="int" value="1"/>
<property name="texture" value="sprite.png"/>
</properties>
</object>
</objectgroup>

@ -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="12" height="9" tilewidth="32" tileheight="32" infinite="0" nextlayerid="10" nextobjectid="14">
<map version="1.4" tiledversion="1.4.3" orientation="orthogonal" renderorder="right-down" width="12" height="9" tilewidth="32" tileheight="32" infinite="0" nextlayerid="10" nextobjectid="15">
<tileset firstgid="1" source="worldborder.tsx"/>
<tileset firstgid="9" source="floor.tsx"/>
<tileset firstgid="21" source="furniture.tsx"/>
@ -91,5 +91,12 @@
</object>
</objectgroup>
<objectgroup id="8" name="InteractionObjects"/>
<objectgroup id="9" name="NpcRects"/>
<objectgroup id="9" name="NpcRects">
<object id="14" x="192" y="64" width="96" height="96">
<properties>
<property name="id" type="int" value="0"/>
<property name="texture" value="sprite.png"/>
</properties>
</object>
</objectgroup>
</map>

@ -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="12" height="9" tilewidth="32" tileheight="32" infinite="0" nextlayerid="10" nextobjectid="14">
<map version="1.4" tiledversion="1.4.3" orientation="orthogonal" renderorder="right-down" width="12" height="9" tilewidth="32" tileheight="32" infinite="0" nextlayerid="10" nextobjectid="17">
<tileset firstgid="1" source="worldborder.tsx"/>
<tileset firstgid="9" source="terrain.tsx"/>
<tileset firstgid="2057" source="furniture.tsx"/>
@ -91,5 +91,12 @@
</object>
</objectgroup>
<objectgroup id="8" name="InteractionObjects"/>
<objectgroup id="9" name="NpcRects"/>
<objectgroup id="9" name="NpcRects">
<object id="14" x="32" y="64" width="96" height="32">
<properties>
<property name="id" type="int" value="0"/>
<property name="texture" value="sprite.png"/>
</properties>
</object>
</objectgroup>
</map>

@ -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="20" height="25" tilewidth="32" tileheight="32" infinite="0" nextlayerid="10" nextobjectid="8">
<map version="1.4" tiledversion="1.4.3" orientation="orthogonal" renderorder="right-down" width="20" height="25" tilewidth="32" tileheight="32" infinite="0" nextlayerid="10" nextobjectid="10">
<tileset firstgid="1" source="nice2.tsx"/>
<tileset firstgid="484" source="tree.tsx"/>
<layer id="1" name="under0" width="20" height="25">
@ -164,6 +164,20 @@
</properties>
</object>
</objectgroup>
<objectgroup id="8" name="InteractionRects"/>
<objectgroup id="9" name="NpcRects"/>
<objectgroup id="8" name="InteractionRects">
<object id="8" x="192" y="64" width="32" height="32">
<properties>
<property name="id" type="int" value="0"/>
<property name="texture" value="sign.png"/>
</properties>
</object>
</objectgroup>
<objectgroup id="9" name="NpcRects">
<object id="9" x="320" y="384" width="224" height="192">
<properties>
<property name="id" type="int" value="0"/>
<property name="texture" value="sprite.png"/>
</properties>
</object>
</objectgroup>
</map>

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Before

Width:  |  Height:  |  Size: 393 KiB

After

Width:  |  Height:  |  Size: 393 KiB

Before

Width:  |  Height:  |  Size: 168 KiB

After

Width:  |  Height:  |  Size: 168 KiB

Before

Width:  |  Height:  |  Size: 179 KiB

After

Width:  |  Height:  |  Size: 179 KiB

Before

Width:  |  Height:  |  Size: 59 KiB

After

Width:  |  Height:  |  Size: 59 KiB

Before

Width:  |  Height:  |  Size: 1003 B

After

Width:  |  Height:  |  Size: 1003 B

@ -17,10 +17,12 @@ public class InteractionObject extends Actor{
int id;
public InteractionObject(Rectangle collisionRect, float xPos, float yPos, int id, String texture){
String dialoguePath;
public InteractionObject(Rectangle collisionRect, float xPos, float yPos,int mapId, int id, String texture){
setName("interactive");
this.id = id;
Texture t = new Texture(Gdx.files.internal(texture));
Texture t = new Texture(Gdx.files.internal("textureData/sprites/"+texture));
currentlyTalking = false;
@ -28,7 +30,8 @@ public class InteractionObject extends Actor{
animatedSprite.setRow(0);
this.collisionRect = collisionRect;
parser = new DialogueParser("npcs/1/dialogue/test.txt");
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);
@ -59,8 +62,7 @@ public class InteractionObject extends Actor{
if(newDialogue == null) {
currentlyTalking = false;
parser = new DialogueParser("npcs/1/dialogue/test.txt");
System.out.println("asdfasdf");
parser = new DialogueParser(dialoguePath);
}
else {
((Textbox)a).update(newDialogue);

@ -30,7 +30,11 @@ import com.badlogic.gdx.utils.viewport.FitViewport;
* exit
* id
* Layer 7: InteractionObjects
* id
* texture
* Layer 8: NpcRects
* id
* texture
*
* @author Jan
*/
@ -49,7 +53,7 @@ public class MapContainer {
final int[] layersAbovePlayer = {3, 4};
// TODO: Value which shows from which door the player is coming?
public MapContainer(float CAMERA_WIDTH, float CAMERA_HEIGHT, Player p, String mapString, int inDoor) {
public MapContainer(float CAMERA_WIDTH, float CAMERA_HEIGHT, Player p, String mapString, int inDoor, int mapId) {
// CREATION OF STAGE
camera = new OrthographicCamera();
camera.setToOrtho(false, CAMERA_WIDTH, CAMERA_HEIGHT);
@ -92,8 +96,9 @@ public class MapContainer {
MapProperties props = object.getProperties();
int id = props.get("id", Integer.class);
String texture = props.get("texture", String.class);
stage.addActor(new MovingNpc(rect, rect.getX() + (float)(Math.random()*rect.getWidth()), rect.getY()+(float)(Math.random()*rect.getHeight()), id));
stage.addActor(new MovingNpc(rect, rect.getX() + (float)(Math.random()*(rect.getWidth()-64)), rect.getY()+(float)(Math.random()*(rect.getHeight()-64)), id, mapId, texture));
}
// adding the InteractionObjects
@ -104,7 +109,7 @@ 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(), id, texture));
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));
}

@ -36,11 +36,12 @@ public class MovingNpc extends Actor{
Vector2 POI;
int id;
String dialoguePath;
public MovingNpc(Rectangle area, float xPos, float yPos, int id){
public MovingNpc(Rectangle area, float xPos, float yPos, int id, int mapId, String texture){
setName("npc");
this.id = id;
Texture t = new Texture(Gdx.files.internal("npcs/"+id+"/sprite.png"));
Texture t = new Texture(Gdx.files.internal("textureData/sprites/"+texture));
currentlyTalking = false;
@ -53,7 +54,8 @@ public class MovingNpc extends Actor{
movementX = 0;
movementY = 0;
parser = new DialogueParser("npcs/"+id+"/dialogue/test.txt");
dialoguePath = "mapData/map"+mapId+"/npcs/"+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);
@ -86,12 +88,10 @@ public class MovingNpc extends Actor{
if(newDialogue == null) {
currentlyTalking = false;
parser = new DialogueParser("npcs/"+id+"/dialogue/test.txt");
System.out.println("asdfasdf");
parser = new DialogueParser(dialoguePath);
}
else {
((Textbox)a).update(newDialogue);
System.out.println("update nicencie");
}
}
}

@ -34,7 +34,7 @@ public class Player extends Actor{
public Player(int xPos, int yPos){
setName("player");
t = new Texture(Gdx.files.internal("player.png"));
t = new Texture(Gdx.files.internal("textureData/sprites/player.png"));
playerSprite = new AnimatedSprite(t, 64, 64, true);
playerSprite.setRow(0);
collisionRect = new Rectangle(xPos + 16, yPos, 32, 16);
@ -90,7 +90,6 @@ public class Player extends Actor{
movementY = 0;
}
else if(a instanceof InteractionObject) {
System.out.println("kfdjfkdjfladjflajdfjadlfj");
Main.gamestate = 1;
((InteractionObject)a).startDialogue(getX()+32, getY()+32);
movementX = 0;

@ -41,7 +41,7 @@ public class Textbox extends Actor{
float textHeight;
public Textbox(String toPrint, String[] ans, float xPos, float yPos) {
FreeTypeFontGenerator generator = new FreeTypeFontGenerator(Gdx.files.internal("font.ttf"));
FreeTypeFontGenerator generator = new FreeTypeFontGenerator(Gdx.files.internal("fontData/font.ttf"));
FreeTypeFontGenerator.FreeTypeFontParameter parameter = new FreeTypeFontGenerator.FreeTypeFontParameter();
parameter.size = 21;
font = generator.generateFont(parameter);
@ -68,7 +68,7 @@ public class Textbox extends Actor{
public Textbox(Textbox t, float xPos, float yPos){
font = new BitmapFont();
FreeTypeFontGenerator generator = new FreeTypeFontGenerator(Gdx.files.internal("font.ttf"));
FreeTypeFontGenerator generator = new FreeTypeFontGenerator(Gdx.files.internal("fontData/font.ttf"));
FreeTypeFontGenerator.FreeTypeFontParameter parameter = new FreeTypeFontGenerator.FreeTypeFontParameter();
parameter.size = 21;
font = generator.generateFont(parameter);

@ -22,12 +22,12 @@ 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), "map2.tmx", 0);
map = new MapContainer(CAMERA_WIDTH, CAMERA_HEIGHT, new Player(200, 200), "tiledmapData/map2.tmx", 0, 2);
}
public void loadNewMap(int map, int doorId){
String filename = "map" + map + ".tmx";
this.map = new MapContainer(Main.CAMERA_WIDTH, Main.CAMERA_HEIGHT, this.map.getPlayer(), filename, doorId);
String filename = "tiledmapData/map" + map + ".tmx";
this.map = new MapContainer(Main.CAMERA_WIDTH, Main.CAMERA_HEIGHT, this.map.getPlayer(), filename, doorId, map);
}
@Override

Loading…
Cancel
Save