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 removed Mines/bin/mines/Field.class
Binary file not shown.
Binary file removed Mines/bin/mines/MinesFields$GameRunScript.class
Binary file not shown.
Binary file removed Mines/bin/mines/MinesFields.class
Binary file not shown.
Binary file removed Mines/bin/mines/MinesFrame$1.class
Binary file not shown.
Binary file removed Mines/bin/mines/MinesFrame$Restart.class
Binary file not shown.
Binary file removed Mines/bin/mines/MinesFrame.class
Binary file not shown.
Binary file removed Mines/bin/mines/StartFrame$1.class
Binary file not shown.
Binary file removed Mines/bin/mines/StartFrame$2.class
Binary file not shown.
Binary file removed Mines/bin/mines/StartFrame$3.class
Binary file not shown.
Binary file removed Mines/bin/mines/StartFrame$4.class
Binary file not shown.
Binary file removed Mines/bin/mines/StartFrame$5.class
Binary file not shown.
Binary file removed Mines/bin/mines/StartFrame.class
Binary file not shown.
Binary file modified Tetris/bin/tetris/GameOverPanel$1.class
Binary file not shown.
Binary file modified Tetris/bin/tetris/GameOverPanel$2.class
Binary file not shown.
Binary file modified Tetris/bin/tetris/GameOverPanel$3.class
Binary file not shown.
Binary file modified Tetris/bin/tetris/GameOverPanel.class
Binary file not shown.
Binary file modified Tetris/bin/tetris/MenuPanel$1.class
Binary file not shown.
Binary file modified Tetris/bin/tetris/MenuPanel$2.class
Binary file not shown.
Binary file modified Tetris/bin/tetris/MenuPanel$3.class
Binary file not shown.
Binary file modified Tetris/bin/tetris/MenuPanel$4.class
Binary file not shown.
Binary file modified Tetris/bin/tetris/MenuPanel.class
Binary file not shown.
Binary file modified Tetris/bin/tetris/SettingsPanel$1.class
Binary file not shown.
Binary file modified Tetris/bin/tetris/SettingsPanel$2.class
Binary file not shown.
Binary file modified Tetris/bin/tetris/SettingsPanel$3.class
Binary file not shown.
Binary file modified Tetris/bin/tetris/SettingsPanel$4.class
Binary file not shown.
Binary file modified Tetris/bin/tetris/SettingsPanel$5.class
Binary file not shown.
Binary file modified Tetris/bin/tetris/SettingsPanel$6.class
Binary file not shown.
Binary file modified Tetris/bin/tetris/SettingsPanel.class
Binary file not shown.
Binary file modified Tetris/bin/tetris/TetrisPane$1.class
Binary file not shown.
Binary file modified Tetris/bin/tetris/TetrisPane$2.class
Binary file not shown.
Binary file modified Tetris/bin/tetris/TetrisPane$DropExecution.class
Binary file not shown.
Binary file modified Tetris/bin/tetris/TetrisPane$IShaped.class
Binary file not shown.
Binary file modified Tetris/bin/tetris/TetrisPane$JShaped.class
Binary file not shown.
Binary file modified Tetris/bin/tetris/TetrisPane$KeyControl.class
Binary file not shown.
Binary file modified Tetris/bin/tetris/TetrisPane$LShaped.class
Binary file not shown.
Binary file modified Tetris/bin/tetris/TetrisPane$OShaped.class
Binary file not shown.
Binary file modified Tetris/bin/tetris/TetrisPane$SShaped.class
Binary file not shown.
Binary file modified Tetris/bin/tetris/TetrisPane$TShaped.class
Binary file not shown.
Binary file modified Tetris/bin/tetris/TetrisPane$ZShaped.class
Binary file not shown.
Binary file modified Tetris/bin/tetris/TetrisPane.class
Binary file not shown.
28 changes: 15 additions & 13 deletions Tetris/src/tetris/GameOverPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,15 @@ public class GameOverPanel extends JPanel {
private JButton restartButton;
private JButton menuButton;

private static final Color BACKGROUND_COLOR = new Color(30, 30, 50);
private static final Color TITLE_COLOR = new Color(255, 100, 100);
private static final Color LABEL_COLOR = Color.WHITE;
private static final Color VALUE_COLOR = new Color(100, 200, 255);
private static final Color BUTTON_COLOR = new Color(70, 130, 180);
private static final Color BUTTON_HOVER_COLOR = new Color(100, 160, 210);
private static final Color PANEL_COLOR = new Color(40, 40, 70);
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 String FONT_NAME = "Microsoft YaHei";

public GameOverPanel() {
gameManager = GameManager.getInstance();
Expand All @@ -52,24 +54,24 @@ public GameOverPanel() {

private void initComponents() {
titleLabel = new JLabel(getGameOverText());
titleLabel.setFont(new Font("Arial", Font.BOLD, 48));
titleLabel.setFont(new Font(FONT_NAME, Font.BOLD, 48));
titleLabel.setForeground(TITLE_COLOR);
titleLabel.setHorizontalAlignment(SwingConstants.CENTER);

scoreLabel = new JLabel(getScoreText() + ": 0");
scoreLabel.setFont(new Font("Arial", Font.PLAIN, 20));
scoreLabel.setFont(new Font(FONT_NAME, Font.PLAIN, 20));
scoreLabel.setForeground(LABEL_COLOR);

levelLabel = new JLabel(getLevelText() + ": 1");
levelLabel.setFont(new Font("Arial", Font.PLAIN, 20));
levelLabel.setFont(new Font(FONT_NAME, Font.PLAIN, 20));
levelLabel.setForeground(LABEL_COLOR);

linesLabel = new JLabel(getLinesText() + ": 0");
linesLabel.setFont(new Font("Arial", Font.PLAIN, 20));
linesLabel.setFont(new Font(FONT_NAME, Font.PLAIN, 20));
linesLabel.setForeground(LABEL_COLOR);

timeLabel = new JLabel(getTimeText() + ": 00:00");
timeLabel.setFont(new Font("Arial", Font.PLAIN, 20));
timeLabel.setFont(new Font(FONT_NAME, Font.PLAIN, 20));
timeLabel.setForeground(LABEL_COLOR);

restartButton = createStyledButton(getRestartText());
Expand Down Expand Up @@ -135,7 +137,7 @@ private void setupLayout() {

private JButton createStyledButton(String text) {
JButton button = new JButton(text);
button.setFont(new Font("Arial", Font.BOLD, 18));
button.setFont(new Font(FONT_NAME, Font.BOLD, 18));
button.setForeground(Color.WHITE);
button.setBackground(BUTTON_COLOR);
button.setFocusPainted(false);
Expand Down
24 changes: 13 additions & 11 deletions Tetris/src/tetris/MenuPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,13 @@ public class MenuPanel extends JPanel {
private JButton settingsButton;
private JButton exitButton;

private static final Color BACKGROUND_COLOR = new Color(30, 30, 50);
private static final Color TITLE_COLOR = new Color(100, 200, 255);
private static final Color BUTTON_COLOR = new Color(70, 130, 180);
private static final Color BUTTON_HOVER_COLOR = new Color(100, 160, 210);
private static final Color BUTTON_TEXT_COLOR = Color.WHITE;
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 String FONT_NAME = "Microsoft YaHei";

public MenuPanel() {
gameManager = GameManager.getInstance();
Expand All @@ -44,7 +46,7 @@ public MenuPanel() {

private void initComponents() {
titleLabel = new JLabel("TETRIS");
titleLabel.setFont(new Font("Arial", Font.BOLD, 72));
titleLabel.setFont(new Font(FONT_NAME, Font.BOLD, 72));
titleLabel.setForeground(TITLE_COLOR);
titleLabel.setHorizontalAlignment(JLabel.CENTER);

Expand Down Expand Up @@ -102,14 +104,14 @@ private void setupLayout() {
infoPanel.setBackground(BACKGROUND_COLOR);
JLabel infoLabel = new JLabel(getControlsText());
infoLabel.setForeground(Color.LIGHT_GRAY);
infoLabel.setFont(new Font("Arial", Font.PLAIN, 12));
infoLabel.setFont(new Font(FONT_NAME, Font.PLAIN, 12));
infoPanel.add(infoLabel);
add(infoPanel, BorderLayout.SOUTH);
}

private JButton createStyledButton(String text) {
JButton button = new JButton(text);
button.setFont(new Font("Arial", Font.BOLD, 18));
button.setFont(new Font(FONT_NAME, Font.BOLD, 18));
button.setForeground(BUTTON_TEXT_COLOR);
button.setBackground(BUTTON_COLOR);
button.setFocusPainted(false);
Expand Down Expand Up @@ -156,11 +158,11 @@ private String getControlsText() {
protected void paintComponent(Graphics g) {
super.paintComponent(g);

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

private static final Color BACKGROUND_COLOR = new Color(30, 30, 50);
private static final Color TITLE_COLOR = new Color(100, 200, 255);
private static final Color LABEL_COLOR = Color.WHITE;
private static final Color BUTTON_COLOR = new Color(70, 130, 180);
private static final Color BUTTON_HOVER_COLOR = new Color(100, 160, 210);
private static final Color PANEL_COLOR = new Color(40, 40, 70);
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 String FONT_NAME = "Microsoft YaHei";

private int tempDifficulty;
private int tempResolution;
Expand All @@ -63,18 +65,18 @@ public SettingsPanel() {

private void initComponents() {
titleLabel = new JLabel(getSettingsTitleText());
titleLabel.setFont(new Font("Arial", Font.BOLD, 36));
titleLabel.setFont(new Font(FONT_NAME, Font.BOLD, 36));
titleLabel.setForeground(TITLE_COLOR);
titleLabel.setHorizontalAlignment(JLabel.CENTER);

difficultyLabel = new JLabel(getDifficultyText() + ":");
difficultyLabel.setFont(new Font("Arial", Font.PLAIN, 16));
difficultyLabel.setFont(new Font(FONT_NAME, Font.PLAIN, 16));
difficultyLabel.setForeground(LABEL_COLOR);

String[] difficultyOptions = getDifficultyOptions();
difficultyCombo = new JComboBox<>(difficultyOptions);
difficultyCombo.setSelectedIndex(tempDifficulty);
difficultyCombo.setFont(new Font("Arial", Font.PLAIN, 14));
difficultyCombo.setFont(new Font(FONT_NAME, Font.PLAIN, 14));
difficultyCombo.setPreferredSize(new Dimension(150, 30));
difficultyCombo.addActionListener(new ActionListener() {
@Override
Expand All @@ -84,13 +86,13 @@ public void actionPerformed(ActionEvent e) {
});

resolutionLabel = new JLabel(getResolutionText() + ":");
resolutionLabel.setFont(new Font("Arial", Font.PLAIN, 16));
resolutionLabel.setFont(new Font(FONT_NAME, Font.PLAIN, 16));
resolutionLabel.setForeground(LABEL_COLOR);

String[] resolutionOptions = getResolutionOptions();
resolutionCombo = new JComboBox<>(resolutionOptions);
resolutionCombo.setSelectedIndex(tempResolution);
resolutionCombo.setFont(new Font("Arial", Font.PLAIN, 14));
resolutionCombo.setFont(new Font(FONT_NAME, Font.PLAIN, 14));
resolutionCombo.setPreferredSize(new Dimension(150, 30));
resolutionCombo.addActionListener(new ActionListener() {
@Override
Expand All @@ -100,13 +102,13 @@ public void actionPerformed(ActionEvent e) {
});

languageLabel = new JLabel(getLanguageText() + ":");
languageLabel.setFont(new Font("Arial", Font.PLAIN, 16));
languageLabel.setFont(new Font(FONT_NAME, Font.PLAIN, 16));
languageLabel.setForeground(LABEL_COLOR);

String[] languageOptions = getLanguageOptions();
languageCombo = new JComboBox<>(languageOptions);
languageCombo.setSelectedIndex(tempLanguage);
languageCombo.setFont(new Font("Arial", Font.PLAIN, 14));
languageCombo.setFont(new Font(FONT_NAME, Font.PLAIN, 14));
languageCombo.setPreferredSize(new Dimension(150, 30));
languageCombo.addActionListener(new ActionListener() {
@Override
Expand Down Expand Up @@ -187,7 +189,7 @@ private void setupLayout() {

private JButton createStyledButton(String text) {
JButton button = new JButton(text);
button.setFont(new Font("Arial", Font.BOLD, 16));
button.setFont(new Font(FONT_NAME, Font.BOLD, 16));
button.setForeground(Color.WHITE);
button.setBackground(BUTTON_COLOR);
button.setFocusPainted(false);
Expand Down
22 changes: 12 additions & 10 deletions Tetris/src/tetris/TetrisPane.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,13 @@ public class TetrisPane extends JPanel {
private JLabel nextPieceLabel;
private JLabel controlsLabel;

private static final Color BACKGROUND_COLOR = new Color(20, 20, 40);
private static final Color GRID_COLOR = new Color(40, 40, 70);
private static final Color INFO_PANEL_COLOR = new Color(30, 30, 60);
private static final Color LABEL_COLOR = new Color(100, 200, 255);
private static final Color VALUE_COLOR = Color.WHITE;
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 String FONT_NAME = "Microsoft YaHei";

/**
* 构造函数
Expand Down Expand Up @@ -118,7 +120,7 @@ private void initInfoPanel() {
y += labelHeight + gap + 100;

controlsLabel = createInfoLabel(getControlsTitleText(), "", y);
controlsLabel.setFont(new Font("Arial", Font.BOLD, 14));
controlsLabel.setFont(new Font(FONT_NAME, Font.BOLD, 14));
y += labelHeight;

JLabel[] controlLabels = createControlLabels();
Expand All @@ -141,7 +143,7 @@ private JLabel createInfoLabel(String text, String value, int y) {
JLabel label = new JLabel("<html>" + text + "<br><font size='+1' color='white'>" + value + "</font></html>");
label.setBounds(20, y, 140, 50);
label.setForeground(LABEL_COLOR);
label.setFont(new Font("Arial", Font.BOLD, 14));
label.setFont(new Font(FONT_NAME, Font.BOLD, 14));
label.setVerticalAlignment(SwingConstants.CENTER);
return label;
}
Expand Down Expand Up @@ -202,7 +204,7 @@ private void paintGameArea(Graphics g) {
int offsetX = 10;
int offsetY = 10;

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

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

g2d.setColor(new Color(30, 30, 50));
g2d.setColor(new Color(25, 25, 40));
for (int i = 0; i <= ROWS; i++) {
g2d.drawLine(
offsetX,
Expand Down Expand Up @@ -256,7 +258,7 @@ private void paintGameArea(Graphics g) {
g2d.fillRect(offsetX, offsetY, COLUMNS * cellSize, ROWS * cellSize);

g2d.setColor(Color.WHITE);
g2d.setFont(new Font("Arial", Font.BOLD, 36));
g2d.setFont(new Font(FONT_NAME, Font.BOLD, 36));
String pauseText = config.getLanguage() == GameConfig.LANGUAGE_CHINESE ? "暂停" : "PAUSED";
int textWidth = g2d.getFontMetrics().stringWidth(pauseText);
g2d.drawString(
Expand Down
Binary file removed Worm/bin/worm/Cell.class
Binary file not shown.
Binary file removed Worm/bin/worm/Worm.class
Binary file not shown.
Binary file removed Worm/bin/worm/WormFrame.class
Binary file not shown.
Binary file removed Worm/bin/worm/WormStage$KeyControl.class
Binary file not shown.
Binary file removed Worm/bin/worm/WormStage$Move.class
Binary file not shown.
Binary file removed Worm/bin/worm/WormStage.class
Binary file not shown.