values are written back after the fight

master
GammelJAN 5 years ago
parent b837528a03
commit 4ac604ee87

@ -2,8 +2,8 @@ package com.trs.main;
public class Enemy extends FightObject{
public Enemy(float x, float y, AnimatedSprite sprite, Stats stats, int id, boolean isPlayer) {
super(x, y, sprite, stats, id, isPlayer);
public Enemy(float x, float y, AnimatedSprite sprite, Stats stats, int id) {
super(x, y, sprite, stats, id);
}
}

@ -6,15 +6,13 @@ public abstract class FightObject {
protected int id;
protected float x;
protected float y;
protected boolean isPlayer;
public FightObject(float x, float y, AnimatedSprite sprite, Stats stats, int id, boolean isPlayer) {
public FightObject(float x, float y, AnimatedSprite sprite, Stats stats, int id) {
this.sprite = sprite;
this.stats = stats;
this.id = id;
this.x = x;
this.y = y;
this.isPlayer = isPlayer;
}
void setX(float x) {

@ -2,8 +2,8 @@ package com.trs.main;
public class FightPlayer extends FightObject{
public FightPlayer(float x, float y, AnimatedSprite sprite, Stats stats, int id, boolean isPlayer) {
super(x, y, sprite, stats, id, isPlayer);
public FightPlayer(float x, float y, AnimatedSprite sprite, Stats stats, int id) {
super(x, y, sprite, stats, id);
}
}

@ -176,7 +176,7 @@ public class MapContainer {
// CREATING FightObject Array
// Temporarily only Player
FightObject[] fightObjects = {new FightPlayer(getPlayer().getX(),getPlayer().getY(),getPlayer().playerSprite, getPlayer().stats, 0, true)};
FightObject[] fightObjects = {new FightPlayer(getPlayer().getX(),getPlayer().getY(),getPlayer().playerSprite, getPlayer().stats, 0)};
fs = new FightScreen(stage.getBatch(), fightObjects, rects, getPlayer().getX()+32, getPlayer().getY()+32);
}
@ -190,8 +190,8 @@ public class MapContainer {
renderer.render(layersBelowPlayer);
if(Main.gamestate == 0) {
Actor[] old = stage.getActors().toArray();
if(Main.gamestate == 0 || Main.gamestate == 1) {
Actor[] old = stage.getActors().toArray();
stage.clear();
for(Actor a : sort(old)){
stage.addActor(a);
@ -216,10 +216,12 @@ public class MapContainer {
if(Main.gamestate == 2){
if(fs.state == 3){
for(FightObject object : fs.objects){
if(object.isPlayer){
if(object instanceof FightPlayer){
getPlayer().setX(object.x);
getPlayer().setY(object.y);
getPlayer().stats = object.stats;
}
else{
/*

@ -73,10 +73,10 @@ public class Player extends Actor{
// TEST QUESTS
for(Quest quest : quests){
quest.print();
System.out.println();
//quest.print();
//System.out.println();
}
System.out.println();
//System.out.println();
// QUEST HANDLING
for(Quest quest : quests){

Loading…
Cancel
Save