Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified Tetris/bin/tetris/GameOverPanel.class
Binary file not shown.
Binary file modified Tetris/bin/tetris/MenuPanel.class
Binary file not shown.
Binary file modified Tetris/bin/tetris/SettingsPanel.class
Binary file not shown.
Binary file modified Tetris/bin/tetris/TetrisPane.class
Binary file not shown.
14 changes: 7 additions & 7 deletions Tetris/src/tetris/GameOverPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ public class GameOverPanel extends JPanel {
private JButton restartButton;
private JButton menuButton;

private static final Color BACKGROUND_COLOR = new Color(25, 25, 35);
private static final Color TITLE_COLOR = new Color(255, 120, 120);
private static final Color LABEL_COLOR = new Color(240, 240, 240);
private static final Color VALUE_COLOR = new Color(255, 180, 100);
private static final Color BUTTON_COLOR = new Color(60, 120, 100);
private static final Color BUTTON_HOVER_COLOR = new Color(80, 150, 130);
private static final Color PANEL_COLOR = new Color(35, 35, 45);
private static final Color BACKGROUND_COLOR = new Color(245, 247, 250);
private static final Color TITLE_COLOR = new Color(255, 100, 130);
private static final Color LABEL_COLOR = new Color(80, 80, 100);
private static final Color VALUE_COLOR = new Color(100, 120, 255);
private static final Color BUTTON_COLOR = new Color(70, 130, 255);
private static final Color BUTTON_HOVER_COLOR = new Color(100, 160, 255);
private static final Color PANEL_COLOR = new Color(235, 238, 245);

private static final String FONT_NAME = "Microsoft YaHei";

Expand Down
14 changes: 7 additions & 7 deletions Tetris/src/tetris/MenuPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ public class MenuPanel extends JPanel {
private JButton settingsButton;
private JButton exitButton;

private static final Color BACKGROUND_COLOR = new Color(25, 25, 35);
private static final Color TITLE_COLOR = new Color(255, 180, 100);
private static final Color BUTTON_COLOR = new Color(60, 120, 100);
private static final Color BUTTON_HOVER_COLOR = new Color(80, 150, 130);
private static final Color BUTTON_TEXT_COLOR = new Color(240, 240, 240);
private static final Color BACKGROUND_COLOR = new Color(245, 247, 250);
private static final Color TITLE_COLOR = new Color(100, 120, 255);
private static final Color BUTTON_COLOR = new Color(70, 130, 255);
private static final Color BUTTON_HOVER_COLOR = new Color(100, 160, 255);
private static final Color BUTTON_TEXT_COLOR = Color.WHITE;

private static final String FONT_NAME = "Microsoft YaHei";

Expand Down Expand Up @@ -103,7 +103,7 @@ private void setupLayout() {
JPanel infoPanel = new JPanel();
infoPanel.setBackground(BACKGROUND_COLOR);
JLabel infoLabel = new JLabel(getControlsText());
infoLabel.setForeground(Color.LIGHT_GRAY);
infoLabel.setForeground(new Color(80, 80, 100));
infoLabel.setFont(new Font(FONT_NAME, Font.PLAIN, 12));
infoPanel.add(infoLabel);
add(infoPanel, BorderLayout.SOUTH);
Expand Down Expand Up @@ -158,7 +158,7 @@ private String getControlsText() {
protected void paintComponent(Graphics g) {
super.paintComponent(g);

g.setColor(new Color(80, 60, 40, 20));
g.setColor(new Color(150, 180, 255, 30));
for (int i = 0; i < 25; i++) {
int x = (int) (Math.random() * getWidth());
int y = (int) (Math.random() * getHeight());
Expand Down
12 changes: 6 additions & 6 deletions Tetris/src/tetris/SettingsPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ public class SettingsPanel extends JPanel {
private JButton backButton;
private JButton applyButton;

private static final Color BACKGROUND_COLOR = new Color(25, 25, 35);
private static final Color TITLE_COLOR = new Color(255, 180, 100);
private static final Color LABEL_COLOR = new Color(240, 240, 240);
private static final Color BUTTON_COLOR = new Color(60, 120, 100);
private static final Color BUTTON_HOVER_COLOR = new Color(80, 150, 130);
private static final Color PANEL_COLOR = new Color(35, 35, 45);
private static final Color BACKGROUND_COLOR = new Color(245, 247, 250);
private static final Color TITLE_COLOR = new Color(100, 120, 255);
private static final Color LABEL_COLOR = new Color(80, 80, 100);
private static final Color BUTTON_COLOR = new Color(70, 130, 255);
private static final Color BUTTON_HOVER_COLOR = new Color(100, 160, 255);
private static final Color PANEL_COLOR = new Color(235, 238, 245);

private static final String FONT_NAME = "Microsoft YaHei";

Expand Down
30 changes: 15 additions & 15 deletions Tetris/src/tetris/TetrisPane.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ public class TetrisPane extends JPanel {
private JLabel nextPieceLabel;
private JLabel controlsLabel;

private static final Color BACKGROUND_COLOR = new Color(20, 20, 30);
private static final Color GRID_COLOR = new Color(35, 35, 50);
private static final Color INFO_PANEL_COLOR = new Color(25, 25, 35);
private static final Color LABEL_COLOR = new Color(255, 180, 100);
private static final Color VALUE_COLOR = new Color(240, 240, 240);
private static final Color BACKGROUND_COLOR = new Color(230, 235, 245);
private static final Color GRID_COLOR = new Color(210, 220, 240);
private static final Color INFO_PANEL_COLOR = new Color(245, 247, 250);
private static final Color LABEL_COLOR = new Color(100, 120, 255);
private static final Color VALUE_COLOR = new Color(80, 80, 100);

private static final String FONT_NAME = "Microsoft YaHei";

Expand Down Expand Up @@ -126,7 +126,7 @@ private void initInfoPanel() {
JLabel[] controlLabels = createControlLabels();
for (JLabel label : controlLabels) {
label.setBounds(20, y, 140, 25);
label.setForeground(Color.LIGHT_GRAY);
label.setForeground(new Color(100, 100, 120));
infoPanel.add(label);
y += 25;
}
Expand All @@ -140,7 +140,7 @@ private void initInfoPanel() {
}

private JLabel createInfoLabel(String text, String value, int y) {
JLabel label = new JLabel("<html>" + text + "<br><font size='+1' color='white'>" + value + "</font></html>");
JLabel label = new JLabel("<html>" + text + "<br><font size='+1' color='#505070'>" + value + "</font></html>");
label.setBounds(20, y, 140, 50);
label.setForeground(LABEL_COLOR);
label.setFont(new Font(FONT_NAME, Font.BOLD, 14));
Expand Down Expand Up @@ -204,7 +204,7 @@ private void paintGameArea(Graphics g) {
int offsetX = 10;
int offsetY = 10;

g2d.setColor(new Color(60, 60, 80));
g2d.setColor(new Color(200, 210, 230));
g2d.fillRect(offsetX - 2, offsetY - 2, COLUMNS * cellSize + 4, ROWS * cellSize + 4);

g2d.setColor(GRID_COLOR);
Expand All @@ -219,7 +219,7 @@ private void paintGameArea(Graphics g) {
}
}

g2d.setColor(new Color(25, 25, 40));
g2d.setColor(new Color(220, 230, 245));
for (int i = 0; i <= ROWS; i++) {
g2d.drawLine(
offsetX,
Expand Down Expand Up @@ -254,10 +254,10 @@ private void paintGameArea(Graphics g) {
}

if (state.isPaused()) {
g2d.setColor(new Color(0, 0, 0, 150));
g2d.setColor(new Color(200, 200, 220, 180));
g2d.fillRect(offsetX, offsetY, COLUMNS * cellSize, ROWS * cellSize);

g2d.setColor(Color.WHITE);
g2d.setColor(new Color(60, 80, 150));
g2d.setFont(new Font(FONT_NAME, Font.BOLD, 36));
String pauseText = config.getLanguage() == GameConfig.LANGUAGE_CHINESE ? "暂停" : "PAUSED";
int textWidth = g2d.getFontMetrics().stringWidth(pauseText);
Expand Down Expand Up @@ -401,16 +401,16 @@ public void run() {

private void updateInfoLabels() {
if (scoreLabel != null) {
scoreLabel.setText("<html>" + getScoreText() + "<br><font size='+1' color='white'>" + state.getScore() + "</font></html>");
scoreLabel.setText("<html>" + getScoreText() + "<br><font size='+1' color='#505070'>" + state.getScore() + "</font></html>");
}
if (levelLabel != null) {
levelLabel.setText("<html>" + getLevelText() + "<br><font size='+1' color='white'>" + state.getLevel() + "</font></html>");
levelLabel.setText("<html>" + getLevelText() + "<br><font size='+1' color='#505070'>" + state.getLevel() + "</font></html>");
}
if (linesLabel != null) {
linesLabel.setText("<html>" + getLinesText() + "<br><font size='+1' color='white'>" + state.getLines() + "</font></html>");
linesLabel.setText("<html>" + getLinesText() + "<br><font size='+1' color='#505070'>" + state.getLines() + "</font></html>");
}
if (timeLabel != null) {
timeLabel.setText("<html>" + getTimeText() + "<br><font size='+1' color='white'>" + state.getFormattedTime() + "</font></html>");
timeLabel.setText("<html>" + getTimeText() + "<br><font size='+1' color='#505070'>" + state.getFormattedTime() + "</font></html>");
}
}

Expand Down