Browse Source

update

main
fdai4616 2 years ago
parent
commit
6f10b5d2e6
  1. 0
      build-project.sh
  2. 22
      src/main/java/MenuPanel.java
  3. 2
      src/main/java/PingPong/Ball.java
  4. 4
      src/main/java/PingPong/GameFrame.java
  5. 2
      src/main/java/PingPong/GamePanel.java
  6. 2
      src/main/java/PingPong/Paddle.java
  7. 2
      src/main/java/PingPong/Score.java

0
src/main/java/build-project.sh → build-project.sh

22
src/main/java/MenuPanel.java

@ -1,5 +1,8 @@
import PingPong.GamePanel;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
import java.awt.event.KeyListener;
public class MenuPanel extends JPanel { public class MenuPanel extends JPanel {
@ -10,3 +13,22 @@ public class MenuPanel extends JPanel {
this.setFocusable(true); this.setFocusable(true);
this.setPreferredSize(GamePanel.SCREEN); this.setPreferredSize(GamePanel.SCREEN);
} }
protected void paintComponent(Graphics g) {
super.paintComponent(g);
draw(g);
}
public void draw(Graphics g) {
g.setColor(Color.WHITE);
g.setFont(new Font("Consolas", Font.BOLD, 70));
g.drawString("GAME MENU", 330, 100);
g.setFont(new Font("Consolas", Font.BOLD, 30));
g.drawString("Press 'ENTER' to start the game", 265, 200);
g.setFont(new Font("Consolas", Font.PLAIN, 10));
g.drawString("Created by Hells Gamers", 450, 450);
}
public class AL implements KeyListener {
}
}

2
src/main/java/Ball.java → src/main/java/PingPong/Ball.java

@ -1,2 +1,4 @@
package PingPong;
public class Ball { public class Ball {
} }

4
src/main/java/GameFrame.java → src/main/java/PingPong/GameFrame.java

@ -1,3 +1,5 @@
package PingPong;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
@ -17,3 +19,5 @@ public class GameFrame extends JFrame {
} }
} }
}

2
src/main/java/GamePanel.java → src/main/java/PingPong/GamePanel.java

@ -1,2 +1,4 @@
package PingPong;
public class GamePanel { public class GamePanel {
} }

2
src/main/java/Paddle.java → src/main/java/PingPong/Paddle.java

@ -1,2 +1,4 @@
package PingPong;
public class Paddle { public class Paddle {
} }

2
src/main/java/Score.java → src/main/java/PingPong/Score.java

@ -1,2 +1,4 @@
package PingPong;
public class Score { public class Score {
} }
Loading…
Cancel
Save