|
|
|
@ -19,6 +19,8 @@ import com.badlogic.gdx.math.Rectangle;
|
|
|
|
import com.badlogic.gdx.physics.box2d.BodyDef;
|
|
|
|
import com.badlogic.gdx.physics.box2d.BodyDef;
|
|
|
|
import com.badlogic.gdx.scenes.scene2d.Actor;
|
|
|
|
import com.badlogic.gdx.scenes.scene2d.Actor;
|
|
|
|
import com.badlogic.gdx.scenes.scene2d.Group;
|
|
|
|
import com.badlogic.gdx.scenes.scene2d.Group;
|
|
|
|
|
|
|
|
import com.trs.main.Main;
|
|
|
|
|
|
|
|
import com.trs.main.MapCollisionObject;
|
|
|
|
import com.trs.main.Player;
|
|
|
|
import com.trs.main.Player;
|
|
|
|
import com.trs.main.Textbox;
|
|
|
|
import com.trs.main.Textbox;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
@ -29,8 +31,6 @@ import java.util.ArrayList;
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public class GameScreen extends AbstractScreen{
|
|
|
|
public class GameScreen extends AbstractScreen{
|
|
|
|
|
|
|
|
|
|
|
|
boolean textbox = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TmxMapLoader maploader;
|
|
|
|
TmxMapLoader maploader;
|
|
|
|
TiledMap map;
|
|
|
|
TiledMap map;
|
|
|
|
OrthogonalTiledMapRenderer renderer;
|
|
|
|
OrthogonalTiledMapRenderer renderer;
|
|
|
|
@ -50,16 +50,10 @@ public class GameScreen extends AbstractScreen{
|
|
|
|
|
|
|
|
|
|
|
|
for(MapObject object : map.getLayers().get(2).getObjects().getByType(RectangleMapObject.class)){
|
|
|
|
for(MapObject object : map.getLayers().get(2).getObjects().getByType(RectangleMapObject.class)){
|
|
|
|
Rectangle rect = ((RectangleMapObject) object).getRectangle();
|
|
|
|
Rectangle rect = ((RectangleMapObject) object).getRectangle();
|
|
|
|
stage.addActor(new com.trs.main.MapCollisionObject((int)rect.getX(), (int)rect.getY(), (int)rect.getWidth(), (int)rect.getHeight()));
|
|
|
|
stage.addActor(new MapCollisionObject((int)rect.getX(), (int)rect.getY(), (int)rect.getWidth(), (int)rect.getHeight()));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void setTextbox(Textbox t) {
|
|
|
|
|
|
|
|
stage.addActor(t);
|
|
|
|
|
|
|
|
textbox = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void show() {
|
|
|
|
public void show() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -69,21 +63,18 @@ public class GameScreen extends AbstractScreen{
|
|
|
|
|
|
|
|
|
|
|
|
renderer.render();
|
|
|
|
renderer.render();
|
|
|
|
|
|
|
|
|
|
|
|
if(!textbox){
|
|
|
|
stage.act(f);
|
|
|
|
stage.act(f);
|
|
|
|
stage.draw();
|
|
|
|
stage.draw();
|
|
|
|
|
|
|
|
}
|
|
|
|
if(Main.gamestate == 1) {
|
|
|
|
else{
|
|
|
|
|
|
|
|
Textbox t = null;
|
|
|
|
Textbox t = null;
|
|
|
|
for(Actor a : stage.getActors()){
|
|
|
|
for(Actor a : stage.getActors()){
|
|
|
|
if(a.getName().equals("textbox")){
|
|
|
|
if(a.getName().equals("textbox")){
|
|
|
|
a.act(f);
|
|
|
|
|
|
|
|
a.draw(stage.getBatch(), CAMERA_WIDTH);
|
|
|
|
|
|
|
|
t = (Textbox)a;
|
|
|
|
t = (Textbox)a;
|
|
|
|
if(t.getState() == 2){
|
|
|
|
if(t.getState() == 2){
|
|
|
|
a.remove();
|
|
|
|
a.remove();
|
|
|
|
|
|
|
|
Main.gamestate = 0;
|
|
|
|
t.getSelectedAsw(); // DO STUFF NICENICE
|
|
|
|
t.getSelectedAsw(); // DO STUFF NICENICE
|
|
|
|
textbox = false;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|