blob: 6dff04a67a5d4eeffb95cad6cc2e9b2e5b8d7fd1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
public class WorldScene extends Scene {
private Actor actors[];
private Map map;
private int tileSize;
public WorldScene(Dimension gridSize, int tileSize) {
this.tileSize = tileSize;
map = new Map(gridSize);
}
@Override
public void render(Graphics g) {
Graphics2D g2d = (Graphics2D) g;
for (Tile tile : this.map.grid) {
g2d.setColor(Color.GREEN);
g2d.fillRect(
this.tileSize * tile.x,
this.tileSize * tile.y,
this.tileSize, this.tileSize
);
}
}
}
|