diff options
author | mafaldo <mafaldo@heavyhammer.home> | 2018-02-10 11:14:23 +0100 |
---|---|---|
committer | mafaldo <mafaldo@heavyhammer.home> | 2018-02-10 11:14:23 +0100 |
commit | ffd2ec134c38ec782d7d29c9658ca35cad2b91d9 (patch) | |
tree | 165319f42bd1bea7c5de45935c1405d7e7a1b3ce /src/Tile.java | |
download | Subconscious-old-ffd2ec134c38ec782d7d29c9658ca35cad2b91d9.tar.gz Subconscious-old-ffd2ec134c38ec782d7d29c9658ca35cad2b91d9.zip |
First commit
Diffstat (limited to 'src/Tile.java')
-rw-r--r-- | src/Tile.java | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/Tile.java b/src/Tile.java new file mode 100644 index 0000000..8624f08 --- /dev/null +++ b/src/Tile.java @@ -0,0 +1,22 @@ +public class Tile { + + public int x; + public int y; + public int len; + public TileType tileType = TileType.GRASS; + public EntityType entityType = EntityType.NULL; + public boolean selected = false; + public boolean attack = false; + public int width; + + public Tile (int row, int col, int window, int width) { + this.width = width; + this.calc(row, col, window); + } + + public void calc (int row, int col, int window) { + this.len = (int) (window/(double)this.width); + this.x = col*len; + this.y = row*len; + } +} |