-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGamePanel.java
More file actions
32 lines (26 loc) · 879 Bytes
/
GamePanel.java
File metadata and controls
32 lines (26 loc) · 879 Bytes
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
package main;
import javax.swing.*;
import java.awt.*;
public class GamePanel extends JPanel implements Runnable {
//SCREEN SETTINGS
final int originalTileSize = 16; //16x16 tile
final int scale = 3;
final int tileSize = originalTileSize * scale; //48x48 tile
final int maxScreenCol = 16;
final int getMaxScreenRow = 12;
final int screenWdth = tileSize * maxScreenCol; // 768 pixels
final int screenHeight = tileSize * getMaxScreenRow; // 576 pixels
Thread gameThread;
public GamePanel(){
this.setPreferredSize(new Dimension(screenWdth, screenHeight));
this.setBackground(Color.black);
this.setDoubleBuffered(true);
}
public void startGameThread(){
gameThread = new Thread(this);
gameThread.start();
}
@Override
public void run() {
}
}