From f8eb877a38d45f46745af294fc9a0fe9dacb1cae Mon Sep 17 00:00:00 2001 From: 3009594 Date: Thu, 5 Sep 2024 17:42:42 +0200 Subject: [PATCH] Pong Ohne ComputerGegner --- .../MouseMotionListenerBeispiel.java | 5 +- .../src/GUIAnwendungen/Jframe.java | 3 + .../src/GUIAnwendungen/Rectangle.pdf | Bin 0 -> 41340 bytes Programmierung2/src/Übungen/PongGame.java | 265 +++++++++++++----- .../src/Übungen/Ponggame/Ball.java | 124 ++++++++ .../src/Übungen/Ponggame/GameWindwo.java | 74 +++++ .../src/Übungen/Ponggame/Panel.java | 19 ++ .../src/Übungen/Ponggame/PongGame.java | 19 ++ .../src/Übungen/Ponggame/Spieler.java | 130 +++++++++ Programmierung2/src/Übungen/Test.java | 22 ++ 10 files changed, 587 insertions(+), 74 deletions(-) create mode 100644 Programmierung2/src/GUIAnwendungen/Rectangle.pdf create mode 100644 Programmierung2/src/Übungen/Ponggame/Ball.java create mode 100644 Programmierung2/src/Übungen/Ponggame/GameWindwo.java create mode 100644 Programmierung2/src/Übungen/Ponggame/Panel.java create mode 100644 Programmierung2/src/Übungen/Ponggame/PongGame.java create mode 100644 Programmierung2/src/Übungen/Ponggame/Spieler.java create mode 100644 Programmierung2/src/Übungen/Test.java diff --git a/Programmierung2/src/GUIAnwendungen/EventsButton/MouseMotionListenerBeispiel.java b/Programmierung2/src/GUIAnwendungen/EventsButton/MouseMotionListenerBeispiel.java index 70bc2f4..346ae94 100644 --- a/Programmierung2/src/GUIAnwendungen/EventsButton/MouseMotionListenerBeispiel.java +++ b/Programmierung2/src/GUIAnwendungen/EventsButton/MouseMotionListenerBeispiel.java @@ -19,17 +19,18 @@ public class MouseMotionListenerBeispiel { @Override public void mouseDragged(MouseEvent e) { - mousePosition.setText(" Mouse Position: (" + e.getX() + ", " + e.getY() + ")"); + } @Override public void mouseMoved(MouseEvent e) { + mousePosition.setText(" Mouse Position: (" + e.getX() + ", " + e.getY() + ")"); } }); - frame.setSize(300, 250); // هنا قمنا بتحديد حجم النافذة. عرضها 300 و طولها 250 + frame.setSize(700, 700); // هنا قمنا بتحديد حجم النافذة. عرضها 300 و طولها 250 frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); // هنا جعلنا زر الخروج من النافذة يغلق البرنامج frame.setLayout(new FlowLayout()); // لترتيب الأشياء التي أضفناها فيها FlowLayout هنا جعلنا النافذة تستخدم الـ frame.setVisible(true); // هنا جعلنا النافذة مرئية diff --git a/Programmierung2/src/GUIAnwendungen/Jframe.java b/Programmierung2/src/GUIAnwendungen/Jframe.java index 16ef458..073f4ce 100644 --- a/Programmierung2/src/GUIAnwendungen/Jframe.java +++ b/Programmierung2/src/GUIAnwendungen/Jframe.java @@ -1,6 +1,7 @@ package GUIAnwendungen; import java.awt.Color; +import java.awt.Dimension; import javax.swing.JFrame; @@ -40,3 +41,5 @@ public class Jframe { } } + + diff --git a/Programmierung2/src/GUIAnwendungen/Rectangle.pdf b/Programmierung2/src/GUIAnwendungen/Rectangle.pdf new file mode 100644 index 0000000000000000000000000000000000000000..222b89bd27d3054dbd29778d649cf3e57696f8b7 GIT binary patch literal 41340 zcmagF1CV7=kS$tfm+h)9+qP|+w`{w*)MeYYZQHhOoBg_H=Fj{W|NVG3V#m&%J2Q8j zb64Jz_ryw41rae?MmlyF(t*N(&VlBE92h1-20}X{OBfy=dKrMNnX@?|^Iwe;y_kiy zGr*Bv%-YZyAObM9GXe1N!8kcP0t{_n+%v1Rq+@Vd5xZw<%)@X(^g2GREgI*iA0vVK zh>S?!kwSv35fMp^nxI}^RFbxC9Np{!)H>46LUi@p&MRh)O10Ge2(Iz7v;DmO9H*R| zKMuUzniWy0Qimp4>A>}=&Yg34>hkj9`@XloySMHtyS0q?W%qzQJuh_l#f)?iOz$)& zwfFEhc>sNSyg%8u<7L(uqXm>@tg5uQEp4f)W0!Ay6wJdUDynfFsVX4(-EMqcy$l?= zx+j@>JgpprAk1*6vWFxe&tfBvnjllif-FFTVG_#i<%y|}3eZf??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4ibHLuga{5^?a1I8sjulYVGj+^o`OL}= zb4#b;v9htB(E~Q%)lZ1+Agr*1F$m8BM{^MCAOJFF>R4dI62i04v%G?UVD9#GI|%bx zJ%B)AC*~2_0bbxt9miRoLfFsB4Z?O-zHBV8Fz|FAY|OATR|s|NXZ4DW9k%6z&<^~Y zc5G+m#>RS3!*GpV1vh*cI;<(%EAF0)I?|p3@@+<;Zz?$-I;!YWU{li z4}zT4Nnj*9BR3HH8NPr)zp)wS-;4`@Y9R6jaEY)NMxDkP7-kUp0_I?b1xTmcaj=}V zK@R8{UV)*^zxHcop#i+S%>s4?Pu{>m2N*(`V1YV0JbVGpEWm;Vawwq0umcRDf { + window.addKeyListener(new KeyListener() { + @Override + public void keyTyped(KeyEvent e) { + } + + @Override + public void keyPressed(KeyEvent e) { + + if (e.getKeyCode() == KeyEvent.VK_D) { + bewegungRect2 = 1; + if (xPositionRect2 >= widthWindow - 95) + bewegungRect2 = 0; + + else + xPositionRect2 += bewegungRect2; + + rect2.setBounds(xPositionRect2, yPositionRect2, rect2Width, rect2Height); + // Fordere das Panel auf, sich neu zu zeichnen + rect2.repaint(); + } + + if (e.getKeyCode() == KeyEvent.VK_A) { + bewegungRect2 = 1; + if (bewegungRect2 <= 0) + bewegungRect = 0; + else + xPositionRect2 -= bewegungRect2; + + } + rect2.setBounds(xPositionRect2, yPositionRect2, rect2Width, rect2Height); + // Fordere das Panel auf, sich neu zu zeichnen + rect2.repaint(); + + } + + @Override + public void keyReleased(KeyEvent e) { + + } + }); + + }); + timerRect2.start(); + kreis = new JPanel() { + @Override + public void paintComponent(Graphics g) { + super.paintComponent(g); + g.setColor(Color.white); + g.drawOval(0, 0, kreisWidth, kreisHeight); + + } + }; + kreis.setBounds(xPositioKreis, yPositionKreis, kreisWidth, kreisHeight); + + + Timer timerKreis = new Timer(daleyKreis, e -> { + // Erstelle Rechteck für Ball und Rechteck + Rectangle ballBounds = new Rectangle(xPositioKreis, yPositionKreis, kreisWidth, kreisHeight); + Rectangle rectBounds = new Rectangle(xPositionRect1, yPositionRect1, rectWidth, rectHeight); + Rectangle rectBounds2 = new Rectangle(xPositionRect2, yPositionRect2, rect2Width, rect2Height); + + // Wenn der Kreis die Oberkante erreicht, kehrt er die Richtung um + if (ballBounds.intersects(rectBounds2)) + bewegungKreisY = -bewegungKreisY; + +// if (yPositionKreis >= window.getHeight() - kreisHeight) +// bewegungKreisY = -bewegungKreisY; +// + + + // Überprüfe Kollision zwischen Ball und Rechteck + if (ballBounds.intersects(rectBounds)) { + bewegungKreisY = -bewegungKreisY; + } + + + if (xPositioKreis <= 0) + bewegungKreisX = -bewegungKreisX; + + if (xPositioKreis >= window.getWidth() - kreisWidth) + bewegungKreisX = -bewegungKreisX; + + yPositionKreis -= bewegungKreisY; + xPositioKreis += bewegungKreisX; + + kreis.setBounds(xPositioKreis, yPositionKreis, kreisWidth, kreisHeight); + kreis.repaint(); + + }); + timerKreis.start(); - JPanel rect1 = new JPanel() { + rect1 = new JPanel() { @Override public void paintComponent(Graphics g) { super.paintComponent(g); // Sicherstellen, dass das Panel korrekt gezeichnet wird g.setColor(Color.white); - g.fillRect(0, 0, 10, 90); + g.fillRect(0, 0, rectWidth, rectHeight); } }; - rect1.setBounds(xRect1, yRect1, 10, 90); + rect1.setBounds(xPositionRect1, yPositionRect1, rectWidth, rectHeight); - - - Timer timer = new Timer(710, e -> { - window.addKeyListener(new KeyListener() { - @Override - public void keyTyped(KeyEvent e) { - - } + Timer timerRect = new Timer(daleyRect, e -> { + window.addKeyListener(new KeyListener() { + @Override + public void keyTyped(KeyEvent e) { - @Override - public void keyPressed(KeyEvent e) { - if (e.getKeyCode() ==KeyEvent.VK_DOWN) { - // Bewege das Rechteck - yRect1 += bewegung ; - - // Aktualisiere dann die Position des Panels - rect1.setBounds(xRect1, yRect1, 10, 90); - // Fordere das Panel auf, sich neu zu zeichnen - rect1.repaint(); - } - - } + } - @Override - public void keyReleased(KeyEvent e) { - - } - }); - - - }); + @Override + public void keyPressed(KeyEvent e) { - // Starte den Timer - timer.start(); - - - - // Setze den Fokus auf das Fenster, um die KeyListener zu aktivieren + if (e.getKeyCode() == KeyEvent.VK_RIGHT) { + bewegungRect = 1; + if (xPositionRect1 >= widthWindow - 95) + bewegungRect = 0; + + else + xPositionRect1 += bewegungRect; + + rect1.setBounds(xPositionRect1, yPositionRect1, rectWidth, rectHeight); + // Fordere das Panel auf, sich neu zu zeichnen + rect1.repaint(); + } + + if (e.getKeyCode() == KeyEvent.VK_LEFT) { + bewegungRect = 1; + if (xPositionRect1 <= 0) + bewegungRect = 0; + else + xPositionRect1 -= bewegungRect; + + } + rect1.setBounds(xPositionRect1, yPositionRect1, rectWidth, rectHeight); + // Fordere das Panel auf, sich neu zu zeichnen + rect1.repaint(); + + } + + @Override + public void keyReleased(KeyEvent e) { + + } + }); + + }); + + timerRect.start(); + window.setFocusable(true); window.requestFocusInWindow(); - - - - - - - - - - - - - - - - - - - - JPanel rect2 = new JPanel() { - @Override - public void paintComponent(Graphics g) { - super.paintComponent(g); - g.setColor(Color.white); - g.fillRect(0, 0, 10, 90); - } - }; - rect2.setBounds(650, 10, 10, 90); - window.add(rect1); window.add(rect2); + window.add(kreis); /* * JFrame besteht aus mehreren Schichten: Eine davon ist das ContentPane, welches der Bereich ist, in den die meisten Komponenten wie JPanel, JButton, etc. diff --git a/Programmierung2/src/Übungen/Ponggame/Ball.java b/Programmierung2/src/Übungen/Ponggame/Ball.java new file mode 100644 index 0000000..e199e0c --- /dev/null +++ b/Programmierung2/src/Übungen/Ponggame/Ball.java @@ -0,0 +1,124 @@ +package Übungen.Ponggame; +import java.util.Random; +import javax.swing.*; +import java.awt.*; + +import java.util.Random; + +public class Ball extends JPanel implements Runnable { + // Ball Eigenschaften + final int width = 15; + final int height = 15; + int yPosition; + int xPosition; + Rectangle ball; + + Spieler spieler1 = new Spieler(7, 700 / 2, 1); + Spieler spieler2 = new Spieler(700 - 40, 700 / 2, 2); + + // Score Labels + JLabel scoreSpieler1 = new JLabel ("Score: " + spieler1.getScore()); + JLabel scoreSpieler2 = new JLabel ("Score: " + spieler2.getScore()); + + int delay = 4; + double ybewegung; + double xbewegung; + + Random rand = new Random(); + + public Ball() { + this.xPosition = 700 / 2; + this.yPosition = 700 / 2; + ball = new Rectangle(xPosition, yPosition, width, height); + this.setOpaque(true); + + // Zufällige Richtung für den Start des Balls + xbewegung = (rand.nextBoolean() ? 1 : -1) * (1 + rand.nextDouble()); + ybewegung = (rand.nextBoolean() ? 1 : -1) * (1 + rand.nextDouble()); + } + + @Override + protected void paintComponent(Graphics g) { + super.paintComponent(g); + g.setColor(Color.red); + g.fillRect(ball.x, ball.y, ball.width, ball.height); + } + + public void move() { + if (ball.y <= 0 || ball.y >= 650) + ybewegung = -ybewegung; + + + + + ball.y += ybewegung; + ball.x += xbewegung; + setBounds(ball.x, ball.y, ball.width, ball.height); + repaint(); + + checkKollision(); + } + + public void setxbewegung(double xbewegung) { + this.xbewegung = xbewegung; + } + + public void setybewegung(double ybewegung) { + this.ybewegung = ybewegung; + } + + public void checkKollision() { + if (ball.intersects(spieler1.schläger)) { + xbewegung = Math.abs(xbewegung) * (1 + rand.nextDouble() * 0.1); + ybewegung = ybewegung + (rand.nextDouble() - 0.5) * 0.5; + } + + if (ball.intersects(spieler2.schläger)) { + xbewegung = -Math.abs(xbewegung) * (1 + rand.nextDouble() * 0.1); + ybewegung = ybewegung + (rand.nextDouble() - 0.5) * 0.5; + } + + if (ball.x <= 0) { + spieler2.setScore(spieler2.getScore() + 1); + System.out.println("Spieler 2 Score: " + spieler2.getScore()); + resetBall(); + } + + if (ball.x >= 680) { + spieler1.setScore(spieler1.getScore() + 1); + System.out.println("Spieler 1 Score: " + spieler1.getScore()); + resetBall(); + } + updateScores(); + } + + public void resetBall() { + ball.x = 700 / 2; + ball.y = 700 / 2; + + // Neue zufällige Bewegungsrichtung + xbewegung = (rand.nextBoolean() ? 1 : -1) * (1 + rand.nextDouble()); + ybewegung = (rand.nextBoolean() ? 1 : -1) * (1 + rand.nextDouble()); + + setBounds(ball.x, ball.y, ball.width, ball.height); + repaint(); + } + + // Methode zum Aktualisieren der Score-Labels + public void updateScores() { + scoreSpieler1.setText("Score: " + spieler1.getScore()); + scoreSpieler2.setText("Score: " + spieler2.getScore()); + } + + @Override + public void run() { + try { + while (true) { + move(); + Thread.sleep(delay); + } + } catch (Exception e) { + System.err.println(e.getMessage()); + } + } +} diff --git a/Programmierung2/src/Übungen/Ponggame/GameWindwo.java b/Programmierung2/src/Übungen/Ponggame/GameWindwo.java new file mode 100644 index 0000000..b42c167 --- /dev/null +++ b/Programmierung2/src/Übungen/Ponggame/GameWindwo.java @@ -0,0 +1,74 @@ +package Übungen.Ponggame; +import javax.swing.*; +import java.awt.*; +import java.awt.event.KeyEvent; +import java.awt.event.KeyListener; + +public class GameWindwo extends JFrame { + // Fenster Eigenschaften + static final int WINDOW_WIDTH = 700; + static final int WINDOW_HEIGHT = 700; + Dimension screenSize = new Dimension(WINDOW_WIDTH, WINDOW_HEIGHT); + + // Fenseter Elemente + Panel blackScreen = new Panel(); + Ball ball = new Ball(); + + public GameWindwo() { + + this.setTitle("PongGame"); + this.setSize(screenSize); + this.setResizable(false); + this.setVisible(true); + this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + this.setLocationRelativeTo(null); + this.setLayout(null); + this.getContentPane().setBackground(Color.BLACK); + + ball.setBounds(700 / 2, 700 / 2, 10, 10); + + ball.spieler1.setBounds(7, WINDOW_HEIGHT / 2, 8, 60); + ball.scoreSpieler1.setForeground(Color.white); + ball.scoreSpieler1.setBounds(10, 10, 100, 10); + + ball.spieler2.setBounds(WINDOW_WIDTH - 40, WINDOW_HEIGHT / 2, 8, 60); + ball.scoreSpieler2.setForeground(Color.white); + ball.scoreSpieler2.setBounds(WINDOW_WIDTH - 100, 10, 100, 10); + + this.add(ball); + this.add(ball.spieler1); + this.add(ball.scoreSpieler1); + this.add(ball.spieler2); + this.add(ball.scoreSpieler2); + + this.add(blackScreen); + getInputs(); + } + + public void getInputs() { + addKeyListener(new KeyListener() { + + @Override + public void keyTyped(KeyEvent e) { + // TODO Auto-generated method stub + + } + + @Override + public void keyPressed(KeyEvent e) { + ball.spieler1.KeyPressed(e); + ball.spieler2.KeyPressed(e); + + } + + @Override + public void keyReleased(KeyEvent e) { + ball.spieler1.keyReleased(e); + ball.spieler2.keyReleased(e); + + } + + }); + } + +} \ No newline at end of file diff --git a/Programmierung2/src/Übungen/Ponggame/Panel.java b/Programmierung2/src/Übungen/Ponggame/Panel.java new file mode 100644 index 0000000..0a68730 --- /dev/null +++ b/Programmierung2/src/Übungen/Ponggame/Panel.java @@ -0,0 +1,19 @@ +package Übungen.Ponggame; + +import java.awt.Color; + +import javax.swing.JPanel; + +public class Panel extends JPanel { + private static final int WINDOW_WIDTH = 700; + private static final int WINDOW_HEIGHT = 700; + + Panel(){ + + this.setSize(WINDOW_WIDTH, WINDOW_HEIGHT); + this.setBackground(Color.black); + } + + + +} diff --git a/Programmierung2/src/Übungen/Ponggame/PongGame.java b/Programmierung2/src/Übungen/Ponggame/PongGame.java new file mode 100644 index 0000000..2555d15 --- /dev/null +++ b/Programmierung2/src/Übungen/Ponggame/PongGame.java @@ -0,0 +1,19 @@ + +package Übungen.Ponggame; + + +public class PongGame { + + public static void main(String[] args) { + GameWindwo g1 = new GameWindwo(); + Thread ball = new Thread(g1.ball); + ball.start(); + Thread spieler1 = new Thread(g1.ball.spieler1); + spieler1.start(); + + Thread spieler2 = new Thread(g1.ball.spieler2); + spieler2.start(); + + } + +} diff --git a/Programmierung2/src/Übungen/Ponggame/Spieler.java b/Programmierung2/src/Übungen/Ponggame/Spieler.java new file mode 100644 index 0000000..e3c7dca --- /dev/null +++ b/Programmierung2/src/Übungen/Ponggame/Spieler.java @@ -0,0 +1,130 @@ +package Übungen.Ponggame; + +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.Rectangle; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.KeyEvent; +import java.awt.event.KeyListener; + +import javax.swing.JPanel; +import javax.swing.Timer; + +public class Spieler extends JPanel implements Runnable{ + + int id; + final int width = 8; + final int height = 60; + int yPosition; + int xPosition; + int score; + int ybewegung; + + int dealy = 2; + Rectangle schläger; + + public Spieler(int x, int y, int id) { + this.xPosition = x; + this.yPosition = y; + this.id = id; + this.score = 0; + schläger = new Rectangle(x, y, width, height); + } + + + @Override + protected void paintComponent(Graphics g) { + super.paintComponent(g); + g.setColor(Color.white); + g.fillRect(schläger.x, schläger.y, schläger.width, schläger.height); + + } + + public void move() { + schläger.y += ybewegung; + if (schläger.y <= 0) + schläger.y = 0; + + if (schläger.y >= 600) + schläger.y = 600; + + + setBounds(schläger.x, schläger.y, schläger.width, schläger.height); + repaint(); + } + + public void setYbewegung(int ybewegung) { + this.ybewegung = ybewegung; + } + + public void KeyPressed(KeyEvent e) { + switch (id) { + case 1: + if (e.getKeyCode() == KeyEvent.VK_W) + setYbewegung(-1); + + if (e.getKeyCode() == KeyEvent.VK_S) + setYbewegung(1); + + break; + case 2: + + if (e.getKeyCode() == KeyEvent.VK_UP) + setYbewegung(-1); + + if (e.getKeyCode() == KeyEvent.VK_DOWN) + setYbewegung(1); + + break; + } + + } + + public void keyReleased(KeyEvent e) { + switch (id) { + case 1: + if (e.getKeyCode() == KeyEvent.VK_W ||e.getKeyCode() == KeyEvent.VK_S) + setYbewegung(0); + break; + + case 2: + + if (e.getKeyCode() == KeyEvent.VK_UP || e.getKeyCode() == KeyEvent.VK_DOWN) + setYbewegung(0); + break; + } + + } + + + + public int getScore() { + return score; + } + + + public void setScore(int score) { + this.score = score; + } + + + @Override + public void run() { + try { + while (true) { + move(); + Thread.sleep(dealy); + } + } catch (Exception e) { + System.err.println(e.getMessage()); + } + } + + + + +} + + \ No newline at end of file diff --git a/Programmierung2/src/Übungen/Test.java b/Programmierung2/src/Übungen/Test.java new file mode 100644 index 0000000..ecc3473 --- /dev/null +++ b/Programmierung2/src/Übungen/Test.java @@ -0,0 +1,22 @@ +package Übungen; + +import java.awt.Rectangle; + +import javax.swing.JFrame; + +public class Test { + + public static void main(String[] args) { + // Erstelle ein Fenster + JFrame frame = new JFrame(); + Rectangle r1 = new Rectangle(10,10,100,20); + + frame.setVisible(true); + frame.setSize(420, 500); + frame.setTitle("Mein erstes Fenster"); + frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + frame.setResizable(false); + + } + +}