Aktuell
This commit is contained in:
		
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										1
									
								
								Happy_Bird/.idea/.name
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										1
									
								
								Happy_Bird/.idea/.name
									
									
									
										generated
									
									
									
								
							@@ -1 +0,0 @@
 | 
			
		||||
HappyBirdMain.java
 | 
			
		||||
							
								
								
									
										35
									
								
								Happy_Bird/HappyBirdDB.sql
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										35
									
								
								Happy_Bird/HappyBirdDB.sql
									
									
									
									
									
										Normal file
									
								
							@@ -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) */;
 | 
			
		||||
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							@@ -22,4 +22,5 @@ import java.io.IOException;
 | 
			
		||||
public class GameScreen extends HappyBirdMain
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -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) {
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										104
									
								
								Happy_Bird/src/main/java/com/example/happy_bird/Pipe.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										104
									
								
								Happy_Bird/src/main/java/com/example/happy_bird/Pipe.java
									
									
									
									
									
										Normal file
									
								
							@@ -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) {
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										103
									
								
								Happy_Bird/src/main/java/com/example/happy_bird/PipeTop.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										103
									
								
								Happy_Bird/src/main/java/com/example/happy_bird/PipeTop.java
									
									
									
									
									
										Normal file
									
								
							@@ -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;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -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;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user