diff --git a/Happy_Bird/.gradle/7.1.1/executionHistory/executionHistory.bin b/Happy_Bird/.gradle/7.1.1/executionHistory/executionHistory.bin index f31c309..5048a08 100644 Binary files a/Happy_Bird/.gradle/7.1.1/executionHistory/executionHistory.bin and b/Happy_Bird/.gradle/7.1.1/executionHistory/executionHistory.bin differ diff --git a/Happy_Bird/.gradle/7.1.1/executionHistory/executionHistory.lock b/Happy_Bird/.gradle/7.1.1/executionHistory/executionHistory.lock index 7955ccc..6323f97 100644 Binary files a/Happy_Bird/.gradle/7.1.1/executionHistory/executionHistory.lock and b/Happy_Bird/.gradle/7.1.1/executionHistory/executionHistory.lock differ diff --git a/Happy_Bird/.gradle/7.1.1/fileHashes/fileHashes.bin b/Happy_Bird/.gradle/7.1.1/fileHashes/fileHashes.bin index bcad67a..3654ce6 100644 Binary files a/Happy_Bird/.gradle/7.1.1/fileHashes/fileHashes.bin and b/Happy_Bird/.gradle/7.1.1/fileHashes/fileHashes.bin differ diff --git a/Happy_Bird/.gradle/7.1.1/fileHashes/fileHashes.lock b/Happy_Bird/.gradle/7.1.1/fileHashes/fileHashes.lock index 2c10736..eb2abef 100644 Binary files a/Happy_Bird/.gradle/7.1.1/fileHashes/fileHashes.lock and b/Happy_Bird/.gradle/7.1.1/fileHashes/fileHashes.lock differ diff --git a/Happy_Bird/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/Happy_Bird/.gradle/buildOutputCleanup/buildOutputCleanup.lock index 6adcc95..125eef8 100644 Binary files a/Happy_Bird/.gradle/buildOutputCleanup/buildOutputCleanup.lock and b/Happy_Bird/.gradle/buildOutputCleanup/buildOutputCleanup.lock differ diff --git a/Happy_Bird/.gradle/buildOutputCleanup/outputFiles.bin b/Happy_Bird/.gradle/buildOutputCleanup/outputFiles.bin index e24dad9..a1d4ec7 100644 Binary files a/Happy_Bird/.gradle/buildOutputCleanup/outputFiles.bin and b/Happy_Bird/.gradle/buildOutputCleanup/outputFiles.bin differ diff --git a/Happy_Bird/.idea/.name b/Happy_Bird/.idea/.name deleted file mode 100644 index dd712e9..0000000 --- a/Happy_Bird/.idea/.name +++ /dev/null @@ -1 +0,0 @@ -HappyBirdMain.java \ No newline at end of file diff --git a/Happy_Bird/HappyBirdDB.sql b/Happy_Bird/HappyBirdDB.sql new file mode 100644 index 0000000..8326382 --- /dev/null +++ b/Happy_Bird/HappyBirdDB.sql @@ -0,0 +1,35 @@ +-- -------------------------------------------------------- +-- Host: 127.0.0.1 +-- Server Version: 10.6.5-MariaDB - mariadb.org binary distribution +-- Server Betriebssystem: Win64 +-- HeidiSQL Version: 11.3.0.6295 +-- -------------------------------------------------------- + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET NAMES utf8 */; +/*!50503 SET NAMES utf8mb4 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + + +-- Exportiere Datenbank Struktur für happybird +CREATE DATABASE IF NOT EXISTS `happybird` /*!40100 DEFAULT CHARACTER SET utf8mb3 */; +USE `happybird`; + +-- Exportiere Struktur von Tabelle happybird.happybirddb +CREATE TABLE IF NOT EXISTS `happybirddb` ( + `spielid` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(40) DEFAULT NULL, + `punkte` int(11) DEFAULT NULL, + `highscore` tinyint(1) DEFAULT NULL, + `kuerzel` varchar(10) DEFAULT NULL, + PRIMARY KEY (`spielid`) +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb3; + +-- Daten Export vom Benutzer nicht ausgewählt + +/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */; +/*!40014 SET FOREIGN_KEY_CHECKS=IFNULL(@OLD_FOREIGN_KEY_CHECKS, 1) */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40111 SET SQL_NOTES=IFNULL(@OLD_SQL_NOTES, 1) */; diff --git a/Happy_Bird/build/classes/java/main/com/example/happy_bird/HappyBirdMain.class b/Happy_Bird/build/classes/java/main/com/example/happy_bird/HappyBirdMain.class index 3911c55..9845c3a 100644 Binary files a/Happy_Bird/build/classes/java/main/com/example/happy_bird/HappyBirdMain.class and b/Happy_Bird/build/classes/java/main/com/example/happy_bird/HappyBirdMain.class differ diff --git a/Happy_Bird/build/libs/Happy_Bird-1.0-SNAPSHOT.jar b/Happy_Bird/build/libs/Happy_Bird-1.0-SNAPSHOT.jar index 2d81b4b..205e063 100644 Binary files a/Happy_Bird/build/libs/Happy_Bird-1.0-SNAPSHOT.jar and b/Happy_Bird/build/libs/Happy_Bird-1.0-SNAPSHOT.jar differ diff --git a/Happy_Bird/build/tmp/compileJava/previous-compilation-data.bin b/Happy_Bird/build/tmp/compileJava/previous-compilation-data.bin index db80939..d12dcb6 100644 Binary files a/Happy_Bird/build/tmp/compileJava/previous-compilation-data.bin and b/Happy_Bird/build/tmp/compileJava/previous-compilation-data.bin differ diff --git a/Happy_Bird/src/main/java/com/example/happy_bird/GameScreen.java b/Happy_Bird/src/main/java/com/example/happy_bird/GameScreen.java index 5bf395f..7d8ea08 100644 --- a/Happy_Bird/src/main/java/com/example/happy_bird/GameScreen.java +++ b/Happy_Bird/src/main/java/com/example/happy_bird/GameScreen.java @@ -22,4 +22,5 @@ import java.io.IOException; public class GameScreen extends HappyBirdMain { + } diff --git a/Happy_Bird/src/main/java/com/example/happy_bird/HappyBirdMain.java b/Happy_Bird/src/main/java/com/example/happy_bird/HappyBirdMain.java index 29811c0..46d7273 100644 --- a/Happy_Bird/src/main/java/com/example/happy_bird/HappyBirdMain.java +++ b/Happy_Bird/src/main/java/com/example/happy_bird/HappyBirdMain.java @@ -130,6 +130,9 @@ public class HappyBirdMain extends Application { labelsFormating(labels, pane); headlineFormating(headlineLabels, pane); + /*Überschrift umbenennen, falls aus anderem Screen*/ + headline.setText("HAPPY BIRD"); + /*alle labels an ihre Stelle:*/ int yPositionLabels = 225; for (Label label : labels) { diff --git a/Happy_Bird/src/main/java/com/example/happy_bird/Pipe.java b/Happy_Bird/src/main/java/com/example/happy_bird/Pipe.java new file mode 100644 index 0000000..b85698a --- /dev/null +++ b/Happy_Bird/src/main/java/com/example/happy_bird/Pipe.java @@ -0,0 +1,104 @@ +package com.example.happy_bird; + +import java.awt.*; +import java.awt.image.BufferedImage; +import java.awt.image.ImageObserver; + +public class Pipe extends SpielObjekt { + + private java.awt.Image lowerPipe; + // private java.awt.Image lowerPipe = new java.awt.Image("file:src/main/resources/com/example/happy_bird/pics/PipeUnten.png", 86, 300, false, false); + private int xWert = 0, yWert = 0; + + public Pipe(int xWert, int yWert) { + super(xWert, yWert); + lowerPipe = Toolkit.getDefaultToolkit().getImage(this.getClass().getResource("com/example/happy_bird/")); + //scale lowerPipe(initialWidth, initialHeight) + } + + public void scaleTopPipe(int width, int height) { + lowerPipe = lowerPipe.getScaledInstance(width, height, Image.SCALE_SMOOTH); + } + + public Image getPipe() { + return getPipe(); + } + + /** + * Method um die Breite des BottomPipe-Objekts zu erhalten + * @return int + */ + public int getWidth(int width) { + return lowerPipe.getWidth(null); + } + /** + * Methode um die Höhe des BottomPipe-Objekts zu erhalten + * @return int + */ + public int getHeight(int height) { + return lowerPipe.getHeight(null); + } + + /** + * Methode zum Festlegen der x-Position des BottomPipe-Objekts + * @param x + */ + public void setX(int x) { + xWert = x; + } + + /** + * Methode zum Abrufen der x-Position des BottomPipe-Objekts + * @return int + */ + public int getX() { + return xWert; + } + + /** + * Methode zum Festlegen der y-Position des BottomPipe-Objekts + * @param y + */ + public void setY(int y) { + yWert = y; + } + + /** + * Methode zum Abrufen der y-Position des BottomPipe-Objekts + * @return int + */ + public int getY() { + return yWert; + } + + /** + * Methode zum Erfassen eines Rechtecks, das das Bild des BottomPipe umreißt + * @return Rechteck, das die Position des BottomPipe auf dem Bildschirm umreißt + */ + public Rectangle getRectangle() { + return (new Rectangle(xWert, yWert, lowerPipe.getWidth(null), lowerPipe.getHeight(null))); + } + + /** + * Methode zum Erfassen eines BufferedImage, das das Bildobjekt der TopPipe darstellt + * @return TopPipe's BufferedImage-Objekt + */ + public BufferedImage getBI() { + BufferedImage bi = new BufferedImage(lowerPipe.getWidth(null), lowerPipe.getHeight(null), BufferedImage.TYPE_INT_ARGB); + Graphics g = bi.getGraphics(); + g.drawImage(lowerPipe, 0, 0, null); + g.dispose(); + return bi; + } + + + @Override + public void tick() { + + } + + @Override + public void render(Graphics2D g, ImageObserver obs) { + + } +} diff --git a/Happy_Bird/src/main/java/com/example/happy_bird/PipeTop.java b/Happy_Bird/src/main/java/com/example/happy_bird/PipeTop.java new file mode 100644 index 0000000..4f086d4 --- /dev/null +++ b/Happy_Bird/src/main/java/com/example/happy_bird/PipeTop.java @@ -0,0 +1,103 @@ +package com.example.happy_bird; + +import java.awt.Graphics; +import java.awt.Rectangle; +import java.awt.Toolkit; +import java.awt.Image; +import java.awt.image.BufferedImage; + +public class PipeTop { + //global variables + private Image topPipe; + private int xLoc = 0, yLoc = 0; + + public PipeTop(int initialWidth, int initialHeight) { + topPipe = Toolkit.getDefaultToolkit().getImage(this.getClass().getResource("resources/tube_top.png")); + scaleTopPipe(initialWidth, initialHeight); + } + + /** + * Methode zum Skalieren des topPipe-Sprites in die gewünschten Dimensionen + * @param width Die gewünschte Breite der topPipe + * @param height Die gewünschte Höhe der topPipe + */ + public void scaleTopPipe(int width, int height) { + topPipe = topPipe.getScaledInstance(width, height, Image.SCALE_SMOOTH); + } + + /** + * Getter-Methode für das TopPipe-Objekt. + * @return-Image + */ + public Image getPipe() { + return topPipe; + } + + /** + * Methode zum Abrufen der Breite des TopPipe-Objekts + * @return int + */ + public int getWidth() { + return topPipe.getWidth(null); + } + + /** + * Methode, um die Höhe des TopPipe-Objekts zu erhalten + * @return int + */ + public int getHeight() { + return topPipe.getHeight(null); + } + + /** + * Methode zum Festlegen der x-Position des TopPipe-Objekts + * @param x + */ + public void setX(int x) { + xLoc = x; + } + + /** + * Methode zum Abrufen der x-Position des TopPipe-Objekts + * @return int + */ + public int getX() { + return xLoc; + } + + /** + * Methode zum Festlegen der y-Position des TopPipe-Objekts + * @param y + */ + public void setY(int y) { + yLoc = y; + } + + /** + * Methode zum Abrufen der y-Position des TopPipe-Objekts + * @return int + */ + public int getY() { + return yLoc; + } + + /** + * Methode zum Erfassen eines Rechtecks, das das Bild der TopPipe umreißt + * @return Rechteck, das die Position der TopPipe auf dem Bildschirm umreißt + */ + public Rectangle getRectangle() { + return (new Rectangle(xLoc, yLoc, topPipe.getWidth(null), topPipe.getHeight(null))); + } + + /** + * Methode zum Erfassen eines BufferedImage, das das Bildobjekt der TopPipe darstellt + * @return BufferedImage-Objekt von TopPipe + */ + public BufferedImage getBI() { + BufferedImage bi = new BufferedImage(topPipe.getWidth(null), topPipe.getHeight(null), BufferedImage.TYPE_INT_ARGB); + Graphics g = bi.getGraphics(); + g.drawImage(topPipe, 0, 0, null); + g.dispose(); + return bi; + } +} \ No newline at end of file diff --git a/Happy_Bird/src/main/java/com/example/happy_bird/TopClass.java b/Happy_Bird/src/main/java/com/example/happy_bird/TopClass.java new file mode 100644 index 0000000..8060490 --- /dev/null +++ b/Happy_Bird/src/main/java/com/example/happy_bird/TopClass.java @@ -0,0 +1,10 @@ +package com.example.happy_bird; + +public class TopClass { + + private static final int PIPE_GAP = 0; + private static final int PIPE_WIDTH = 0; + + + +}