speechbubble added

master
GammelJAN 5 years ago
parent 7e6781fb55
commit bcf6734a07

Binary file not shown.

After

Width:  |  Height:  |  Size: 829 B

@ -8,13 +8,16 @@ package com.trs.main.worldobjects;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.graphics.g2d.Sprite;
import com.badlogic.gdx.math.Intersector;
import com.badlogic.gdx.math.Rectangle;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.scenes.scene2d.Actor;
import com.trs.main.Dialogue;
import com.trs.main.DialogueParser;
import com.trs.main.InformationQuest;
import com.trs.main.Main;
import com.trs.main.Quest;
import com.trs.main.StaticMath;
import com.trs.main.Textbox;
@ -48,12 +51,16 @@ public class MovingNpc extends Actor{
String dialoguePath;
Texture questBubble;//= new Texture("textureData/sprites/questbubble.png");
public MovingNpc(Rectangle area, float xPos, float yPos, int id, int mapId, String texture){
setName("npc");
this.id = id;
this.mapId = mapId;
Texture t = new Texture(Gdx.files.internal("textureData/sprites/"+texture));
questBubble = new Texture("textureData/sprites/questbubble.png");
currentlyTalking = false;
specialDialogue = false;
animatedSprite = new AnimatedSprite(t, 64, 64, true);
@ -211,6 +218,23 @@ public class MovingNpc extends Actor{
@Override
public void draw(Batch batch, float parentAlpha) {
animatedSprite.draw(batch);
for(Actor a : getStage().getActors()){
if(a instanceof Player){
for(Quest quest : ((Player)a).getQuests()){
if(quest instanceof InformationQuest){
if(((InformationQuest)quest).hasSpecialDialogue(id, mapId)){
batch.draw(questBubble, getX()-8, getY() + getHeight() - 16);
break;
}
}
}
break;
}
}
super.draw(batch, parentAlpha); //To change body of generated methods, choose Tools | Templates.
}
@ -240,4 +264,5 @@ public class MovingNpc extends Actor{
return t;
}
}

Loading…
Cancel
Save