added coordinates to characters
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 80 KiB |
@@ -96,12 +96,9 @@ public class MainGame extends ApplicationAdapter {
|
|||||||
TextureRegion[][] characters = TextureRegion.split(texture, 32, 32);
|
TextureRegion[][] characters = TextureRegion.split(texture, 32, 32);
|
||||||
this.testCharacter = new Hacker("harry",characters[1][0], new BodySwap("test"));
|
this.testCharacter = new Hacker("harry",characters[1][0], new BodySwap("test"));
|
||||||
GameCharacter character2 = new Hacker("test2",characters[2][0], new BodySwap("test"));
|
GameCharacter character2 = new Hacker("test2",characters[2][0], new BodySwap("test"));
|
||||||
// this.tree.insert(testCharacter);
|
|
||||||
// this.tree.insert(character2);
|
|
||||||
// this.tree.insert(new Agent(characters[2][0], new Implant("test")));
|
|
||||||
this.setSelectedCharacter(testCharacter);
|
this.setSelectedCharacter(testCharacter);
|
||||||
mapRenderer.getGameTiles()[0][1].visit(testCharacter);
|
mapRenderer.getGameTiles()[1][1].visit(testCharacter);
|
||||||
mapRenderer.getGameTiles()[0][2].visit(character2);
|
mapRenderer.getGameTiles()[1][2].visit(character2);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -36,6 +36,8 @@ public class GameTile extends Rectangle {
|
|||||||
public boolean visit(GameCharacter character) {
|
public boolean visit(GameCharacter character) {
|
||||||
if (this.character != null) return false;
|
if (this.character != null) return false;
|
||||||
this.character = character;
|
this.character = character;
|
||||||
|
this.character.setX(this.x);
|
||||||
|
this.character.setY(this.y);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -61,6 +63,7 @@ public class GameTile extends Rectangle {
|
|||||||
"symbol=" + symbol +
|
"symbol=" + symbol +
|
||||||
", x=" + x +
|
", x=" + x +
|
||||||
", y=" + y +
|
", y=" + y +
|
||||||
|
", character=" + this.character +
|
||||||
'}';
|
'}';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ public abstract class GameCharacter extends Actor implements Comparable<GameChar
|
|||||||
protected TextureRegion textureRegion;
|
protected TextureRegion textureRegion;
|
||||||
|
|
||||||
public GameCharacter(String name, Faction faction, TextureRegion textureRegion, Ability... abilities) {
|
public GameCharacter(String name, Faction faction, TextureRegion textureRegion, Ability... abilities) {
|
||||||
|
super();
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.faction = faction;
|
this.faction = faction;
|
||||||
this.abilities = new HashSet<>(Arrays.asList(abilities));
|
this.abilities = new HashSet<>(Arrays.asList(abilities));
|
||||||
@@ -77,6 +78,8 @@ public abstract class GameCharacter extends Actor implements Comparable<GameChar
|
|||||||
return "GameCharacter{" +
|
return "GameCharacter{" +
|
||||||
"name='" + name + '\'' +
|
"name='" + name + '\'' +
|
||||||
", faction=" + faction +
|
", faction=" + faction +
|
||||||
|
", x=" + super.getX() +
|
||||||
|
", y=" + super.getY() +
|
||||||
'}';
|
'}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user