From d483fab4a4e15c3b7651112663d73c99c7d20d8c Mon Sep 17 00:00:00 2001 From: GammelJAN Date: Tue, 26 Jan 2021 22:49:09 +0100 Subject: [PATCH] . --- .../textureData/sprites/questbubble.png | Bin 829 -> 980 bytes core/assets/tiledmapData/maps/map1.tmx | 8 ++++---- core/src/com/trs/main/Textbox.java | 2 +- .../com/trs/main/view/screens/GameScreen.java | 2 +- .../com/trs/main/worldobjects/MovingNpc.java | 18 +++++++++++++----- 5 files changed, 19 insertions(+), 11 deletions(-) diff --git a/core/assets/textureData/sprites/questbubble.png b/core/assets/textureData/sprites/questbubble.png index c0f73aa09b77509b36827a0f29e73b5ef270b7d2..c55d8ac7a197ece8a212efeeb8b65830fc212894 100644 GIT binary patch delta 506 zcmV3iBL{Q4GJ0x0000DNk~Le0001h0000W2nGNE0NNsOC9xsI0S6QY z7e+sqHi=I7t93rP`u*pnb`rAG(SrJ~?Z;AB;q_Nf$x`(1V93~Nv}eE>u@LR4>(Q3@?FP|1c+QP01N=3 z2CxwS1AiDwTziDlEZvOpBLQ#=fM5U!HNbzn2jlr42>=Nw(buJ$rZMVxb$+b0FRmZf zey=DBrLC`m=>p#`9|;h90`Q6Ho-|X(vh#j&yzQPi@MZZ(03?8&^nL02JxF(;?s!*$ zFT+OyAOY;0$L|I3ngH(yxLtk>R-LXh0eo3L5x~|1!e;H w0(>L@Y5%6 zE`TejhyVZp07*qoM6N<$g6Rc} Aw*UYD diff --git a/core/assets/tiledmapData/maps/map1.tmx b/core/assets/tiledmapData/maps/map1.tmx index 64c5cbd..d8f14a0 100644 --- a/core/assets/tiledmapData/maps/map1.tmx +++ b/core/assets/tiledmapData/maps/map1.tmx @@ -125,8 +125,8 @@ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3037,3038,3037,3038,3037,3038,3962,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,6300,6301,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3962,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,6316,6317,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3803,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,7032,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3962,0,0,0,3962,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2195,2196,0,0,0,0,2255,0,0,3803,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,7032,0,0,0,0,0,0,0,0,0,0,0,6451,6454,0,6487,0,0,3962,0,0,0,3962,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2195,2196,6467,6470,6520,6503,2255,0,0,3803,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2077,2078,2256,2137,0,0,2078,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2256,2138,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, @@ -179,8 +179,8 @@ 0,0,0,2935,2936,2937,2938,2939,2940,2941,2942,0,0,0,0,0,2580,2581,2582,2935,2936,2937,2938,2939,2223,2224,2224,2224,2224,2224,2225,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2640,2641,2642,0,0,0,0,0,2283,2284,2284,2284,2284,2284,2285,0,0,0,0,3743,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3743,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2076,2135,2075,2198,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6487,0,0,0,3743,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, diff --git a/core/src/com/trs/main/Textbox.java b/core/src/com/trs/main/Textbox.java index 33e0cb3..071aa06 100644 --- a/core/src/com/trs/main/Textbox.java +++ b/core/src/com/trs/main/Textbox.java @@ -181,7 +181,7 @@ public class Textbox extends Actor{ batch.begin(); - font.draw(batch, toPrint.substring(0, (int)printChar), getX()+2, getY()+getHeight()-3, getWidth(), alignment, true); + font.draw(batch, toPrint.substring(0, (int)printChar), getX()+6, getY()+getHeight()-3, getWidth()-8, alignment, true); if(state == 1){ for(int i = 0; i < ans.length; i++){ diff --git a/core/src/com/trs/main/view/screens/GameScreen.java b/core/src/com/trs/main/view/screens/GameScreen.java index 1717285..916538d 100644 --- a/core/src/com/trs/main/view/screens/GameScreen.java +++ b/core/src/com/trs/main/view/screens/GameScreen.java @@ -57,7 +57,7 @@ public class GameScreen extends AbstractScreen{ Player a = map.getPlayer(); map.getStage().getCamera().position.set((a.getX()+a.getWidth()/2), (a.getY()+a.getHeight()/2), 0); - map.getStage().getCamera().update(); + //map.getStage().getCamera().update(); } @Override diff --git a/core/src/com/trs/main/worldobjects/MovingNpc.java b/core/src/com/trs/main/worldobjects/MovingNpc.java index 0eedbac..63e7a97 100644 --- a/core/src/com/trs/main/worldobjects/MovingNpc.java +++ b/core/src/com/trs/main/worldobjects/MovingNpc.java @@ -51,7 +51,7 @@ public class MovingNpc extends Actor{ String dialoguePath; - Texture questBubble;//= new Texture("textureData/sprites/questbubble.png"); + private AnimatedSprite questBubble; public MovingNpc(Rectangle area, float xPos, float yPos, int id, int mapId, String texture){ setName("npc"); @@ -59,7 +59,8 @@ public class MovingNpc extends Actor{ this.mapId = mapId; Texture t = new Texture(Gdx.files.internal("textureData/sprites/"+texture)); - questBubble = new Texture("textureData/sprites/questbubble.png"); + questBubble = new AnimatedSprite(new Texture("textureData/sprites/questbubble.png"), 32, 32, false); + questBubble.setRow(0); currentlyTalking = false; specialDialogue = false; @@ -174,6 +175,7 @@ public class MovingNpc extends Actor{ movementY = movement.y; } + if(movementX == 0 && movementY == 0){ } @@ -181,23 +183,27 @@ public class MovingNpc extends Actor{ setY(getY()+movementY); if(collidingWithMapCollisionObject()){ setY(getY()-movementY); + POI = null; } } else if(movementY == 0 && movementX != 0){ setX(getX()+movementX); if(collidingWithMapCollisionObject()){ setX(getX()-movementX); + POI = null; } } else if(movementX != 0 && movementY != 0){ setX(getX()+ (movementX)); if(collidingWithMapCollisionObject()){ setX(getX() - (movementX)); + POI = null; } setY(getY() + (movementY)); if(collidingWithMapCollisionObject()){ setY(getY()- (movementY)); + POI = null; } } @@ -216,7 +222,7 @@ public class MovingNpc extends Actor{ } @Override - public void draw(Batch batch, float parentAlpha) { + public void draw(Batch batch, float delta) { animatedSprite.draw(batch); for(Actor a : getStage().getActors()){ @@ -224,7 +230,9 @@ public class MovingNpc extends Actor{ for(Quest quest : ((Player)a).getQuests()){ if(quest instanceof InformationQuest){ if(((InformationQuest)quest).hasSpecialDialogue(id, mapId)){ - batch.draw(questBubble, getX()-8, getY() + getHeight() - 16); + questBubble.setSpritePosition((int)(getX()-8), (int)(getY() + getHeight() - 16)); + questBubble.updateAnimation(0.01f); + questBubble.draw(batch); break; } } @@ -235,7 +243,7 @@ public class MovingNpc extends Actor{ - super.draw(batch, parentAlpha); //To change body of generated methods, choose Tools | Templates. + super.draw(batch, delta); //To change body of generated methods, choose Tools | Templates. } public boolean collidingWithMapCollisionObject(){