Browse Source

Merge remote-tracking branch 'origin/main'

# Conflicts:
#	target/classes/MenuPanel$AL.class
#	target/classes/MenuPanel.class
#	target/classes/Snake/Apple.class
main
Justin Senn 2 years ago
parent
commit
a046d9fe0f
  1. 124
      .idea/uiDesigner.xml
  2. 0
      build-project.sh
  3. 41
      src/main/java/MenuPanel.java
  4. 2
      src/main/java/PingPong/Ball.java
  5. 2
      src/main/java/PingPong/GameFrame.java
  6. 9
      src/main/java/PingPong/GamePanel.java
  7. 2
      src/main/java/PingPong/Paddle.java
  8. 2
      src/main/java/PingPong/Score.java
  9. BIN
      target/classes/MenuPanel$AL.class
  10. BIN
      target/classes/MenuPanel$GameFrame.class
  11. BIN
      target/classes/MenuPanel.class
  12. BIN
      target/classes/PingPong/GameFrame.class
  13. BIN
      target/classes/Snake/Apple.class

124
.idea/uiDesigner.xml

@ -0,0 +1,124 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Palette2">
<group name="Swing">
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
</item>
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
</item>
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.svg" removable="false" auto-create-binding="false" can-attach-label="true">
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
</item>
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
<initial-values>
<property name="text" value="Button" />
</initial-values>
</item>
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="RadioButton" />
</initial-values>
</item>
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="CheckBox" />
</initial-values>
</item>
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
<initial-values>
<property name="text" value="Label" />
</initial-values>
</item>
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
</item>
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
</item>
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
<preferred-size width="-1" height="20" />
</default-constraints>
</item>
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
</item>
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
</item>
</group>
</component>
</project>

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

41
src/main/java/MenuPanel.java

@ -1,9 +1,14 @@
import PingPong.GamePanel;
import javax.swing.*;
import java.awt.*;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
public class MenuPanel extends JPanel {
MenuPanel() {
this.addKeyListener(new MenuPanel.AL());
this.setBackground(Color.BLACK);
@ -11,27 +16,31 @@ public class MenuPanel extends JPanel {
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);
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 extends KeyAdapter {
public void keyPressed(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_ENTER) {
GameFrame gameFrame = new GameFrame();
if (e.getKeyCode() == KeyEvent.VK_1) {
new GameFrame();
}
}
}
}
private class GameFrame {
}
}

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

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

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

@ -1,3 +1,5 @@
package PingPong;
import javax.swing.*;
import java.awt.*;

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

@ -1,3 +1,5 @@
package PingPong;
import javax.swing.*;
import java.awt.*;
@ -7,5 +9,10 @@ public class GamePanel extends JPanel implements Runnable {
static final int BALL_DIAMETER = 26;
static final int PADDLE_WIDTH = 25;
static final int PADDLE_HEIGHT = 100;
static final Dimension SCREEN = new Dimension(FRAME_WIDTH, FRAME_HEIGHT);
public static final Dimension SCREEN = new Dimension(FRAME_WIDTH, FRAME_HEIGHT);
public void run() {
}
}

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

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

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

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

BIN
target/classes/MenuPanel$AL.class

BIN
target/classes/MenuPanel$GameFrame.class

BIN
target/classes/MenuPanel.class

BIN
target/classes/PingPong/GameFrame.class

BIN
target/classes/Snake/Apple.class

Loading…
Cancel
Save