Compare commits
99 Commits
74d6b58f94
...
master
Author | SHA1 | Date | |
---|---|---|---|
d707be3e4c | |||
88b0ba5d05 | |||
4f2eeb5040 | |||
a60eb17230 | |||
0f2352e003 | |||
e21b4c0f2d | |||
d835ec3460 | |||
635aef047a | |||
f2f88c404d | |||
8f5a4e6a74 | |||
fcb650ffef | |||
79db8a088a | |||
b37993d9a2 | |||
1f0fedeaac | |||
43ba9226e2 | |||
3610c3fb7a | |||
98bcfec0fd | |||
af010b5bd8 | |||
b5daf848c4 | |||
46bf46f92c | |||
5894de5567 | |||
680a80d210 | |||
1cd92601e1 | |||
241bd0f85b | |||
e818be6c17 | |||
8efcc29244 | |||
49e63e3d3b | |||
e2457886c8 | |||
a348fb03a5 | |||
380d469010 | |||
775085a1ab | |||
e494439b1c | |||
c55f6866b8 | |||
0b45380f15 | |||
ac3b2908f3 | |||
a9f80b6f6e | |||
057d3c3b50 | |||
ac4ab16654 | |||
1f544960ac | |||
7f359cb01f | |||
4f9de09893 | |||
e2e726adfb | |||
db77cf584c | |||
03dcf9e8a3 | |||
770e6916b5 | |||
bdd1c68ab9 | |||
c6bf25bb6f | |||
6c7c27bc3f | |||
edf4ca2595 | |||
a8a66beb54 | |||
8507e0f681 | |||
be13801a60 | |||
d4ba26f435 | |||
b06d323aeb | |||
76eb6214d1 | |||
a0d5a48778 | |||
6b51bb9275 | |||
5e57dfa022 | |||
9c028dd79e | |||
d51c97c989 | |||
a4a576eb08 | |||
6712042c42 | |||
3f7137b449 | |||
0f64db5855 | |||
082839ae86 | |||
75916d8876 | |||
e54e1948b4 | |||
70c8716a5f | |||
5378876ff9 | |||
2670617bfb | |||
6626bcc35b | |||
9838ddd582 | |||
e25465873b | |||
dff4261c28 | |||
6697cdef8e | |||
95f72fe4e8 | |||
337285ea29 | |||
c828169573 | |||
a420b83875 | |||
8f8f5a5f96 | |||
5596d4eb5f | |||
8e8eb3a3e3 | |||
882baf19af | |||
5db5b6bb19 | |||
090da1392b | |||
7ad6f414df | |||
2897dfd341 | |||
da0e493461 | |||
8097494350 | |||
c070a72d91 | |||
007413e2d1 | |||
a043c824f1 | |||
8c31edf7e1 | |||
a2aafe8b88 | |||
d2aa9fe6f4 | |||
8aabc3f235 | |||
4e7b664325 | |||
4fac1b1511 | |||
8a0f115c71 |
87
.gitignore
vendored
@@ -1,5 +1,82 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
/.gradle
|
||||
/build
|
||||
# Mobile Tools for Java (J2ME)
|
||||
.mtj.tmp/
|
||||
|
||||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
||||
hs_err_pid*
|
||||
|
||||
### JetBrains template
|
||||
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio
|
||||
|
||||
|
||||
*.iml
|
||||
|
||||
## Directory-based project format:
|
||||
.idea/
|
||||
# if you remove the above rule, at least ignore the following:
|
||||
|
||||
|
||||
# User-specific stuff:
|
||||
# .idea/workspace.xml
|
||||
# .idea/tasks.xml
|
||||
# .idea/dictionaries
|
||||
|
||||
|
||||
# Sensitive or high-churn files:
|
||||
# .idea/dataSources.ids
|
||||
# .idea/dataSources.xml
|
||||
# .idea/sqlDataSources.xml
|
||||
# .idea/dynamic.xml
|
||||
# .idea/uiDesigner.xml
|
||||
|
||||
# Gradle:
|
||||
# .idea/gradle.xml
|
||||
# .idea/libraries
|
||||
|
||||
|
||||
# Mongo Explorer plugin:
|
||||
# .idea/mongoSettings.xml
|
||||
|
||||
## File-based project format:
|
||||
*.ipr
|
||||
*.iws
|
||||
|
||||
## Plugin-specific files:
|
||||
|
||||
# IntelliJ
|
||||
/out/
|
||||
|
||||
# mpeltonen/sbt-idea plugin
|
||||
.idea_modules/
|
||||
|
||||
# JIRA plugin
|
||||
atlassian-ide-plugin.xml
|
||||
|
||||
# Crashlytics plugin (for Android Studio and IntelliJ)
|
||||
com_crashlytics_export_strings.xml
|
||||
crashlytics.properties
|
||||
crashlytics-build.properties
|
||||
|
||||
|
||||
# Created by .ignore support plugin (hsz.mobi)
|
||||
|
||||
|
||||
# Compiled class file
|
||||
*.class
|
||||
|
||||
# Log file
|
||||
*.log
|
||||
|
||||
|
||||
# Package Files #
|
||||
*.jar
|
||||
*.war
|
||||
*.nar
|
||||
*.ear
|
||||
*.zip
|
||||
*.tar.gz
|
||||
*.rar
|
||||
|
||||
Happy_Bird/.gradle/
|
||||
Happy_Bird/app/build/
|
||||
Happy_Bird/data/build/
|
||||
Happy_Bird/.gradle/buildOutputCleanup/
|
3
.idea/.gitignore
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
9
.idea/HappyBird.iml
generated
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
4
.idea/misc.xml
generated
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="15" project-jdk-type="JavaSDK" />
|
||||
</project>
|
8
.idea/modules.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/HappyBird.iml" filepath="$PROJECT_DIR$/.idea/HappyBird.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
6
.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
1
Happy_Bird/.idea/.name
generated
@@ -1 +0,0 @@
|
||||
HappyBird.java
|
5
Happy_Bird/.idea/compiler.xml
generated
@@ -3,4 +3,9 @@
|
||||
<component name="CompilerConfiguration">
|
||||
<bytecodeTargetLevel target="15" />
|
||||
</component>
|
||||
<component name="JavacSettings">
|
||||
<option name="ADDITIONAL_OPTIONS_OVERRIDE">
|
||||
<module name="Happy_Bird.main" options="--add-exports java.base/jdk.internal.module=com.example.happy_bird" />
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
5
Happy_Bird/.idea/jarRepositories.xml
generated
@@ -16,5 +16,10 @@
|
||||
<option name="name" value="MavenRepo" />
|
||||
<option name="url" value="https://repo.maven.apache.org/maven2/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="BintrayJCenter" />
|
||||
<option name="name" value="BintrayJCenter" />
|
||||
<option name="url" value="https://jcenter.bintray.com/" />
|
||||
</remote-repository>
|
||||
</component>
|
||||
</project>
|
10
Happy_Bird/.idea/runConfigurations.xml
generated
@@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RunConfigurationProducerService">
|
||||
<option name="ignoredProducers">
|
||||
<set>
|
||||
<option value="com.android.tools.idea.compose.preview.runconfiguration.ComposePreviewRunConfigurationProducer" />
|
||||
</set>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
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) */;
|
@@ -9,6 +9,7 @@ version '1.0-SNAPSHOT'
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
jcenter()
|
||||
}
|
||||
|
||||
ext {
|
||||
@@ -36,6 +37,7 @@ dependencies {
|
||||
|
||||
testImplementation("org.junit.jupiter:junit-jupiter-api:${junitVersion}")
|
||||
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${junitVersion}")
|
||||
implementation 'org.mariadb.jdbc:mariadb-java-client:2.1.2'
|
||||
}
|
||||
|
||||
test {
|
||||
|
@@ -1,14 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.scene.control.TextField?>
|
||||
<?import javafx.scene.control.Button?>
|
||||
<?import javafx.scene.image.*?>
|
||||
<?import javafx.scene.layout.*?>
|
||||
|
||||
<VBox prefHeight="578.0" prefWidth="700.0" xmlns="http://javafx.com/javafx/11.0.2" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.example.happy_bird.HappyBird">
|
||||
<StackPane prefHeight="800.0" prefWidth="700.0" xmlns="http://javafx.com/javafx/11.0.2" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.example.happy_bird.HappyBird" back >
|
||||
|
||||
<ImageView>
|
||||
<image>
|
||||
<Image url="@screen.png" />
|
||||
<Image url="@pics/Background.png"></Image>
|
||||
</image>
|
||||
</ImageView>
|
||||
|
||||
</VBox>
|
||||
</StackPane>
|
||||
|
Before Width: | Height: | Size: 114 KiB After Width: | Height: | Size: 114 KiB |
After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 54 KiB |
After Width: | Height: | Size: 5.5 KiB |
After Width: | Height: | Size: 4.9 KiB |
After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 4.6 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 96 KiB |
After Width: | Height: | Size: 65 KiB |
@@ -0,0 +1,239 @@
|
||||
package com.example.happy_bird;
|
||||
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.Slider;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.image.Image;
|
||||
import javafx.scene.layout.*;
|
||||
import javafx.scene.text.TextAlignment;
|
||||
|
||||
public class FormatingClass {
|
||||
/***
|
||||
* leerer Konstruktor
|
||||
*/
|
||||
public FormatingClass() { }
|
||||
|
||||
/*** Alteköster
|
||||
* Formatiert alle Buttons und fügt sie der Pane hinzu
|
||||
* @param buttons ButtonArray mit allen Arrays
|
||||
* @param pane Pane, auf der die Buttons angezeigt werden
|
||||
*/
|
||||
public void buttonsFormating(Button[] buttons, Pane pane) {
|
||||
for (Button button : buttons) {
|
||||
button.setPrefSize(200, 50);
|
||||
|
||||
button.setStyle("-fx-background-color: #e86000; " +
|
||||
"-fx-text-fill: #FFFFFF; " +
|
||||
"-fx-font-size: 20px; " +
|
||||
"-fx-border-width: 5px;" +
|
||||
"-fx-border-color: #FFFFFF;" +
|
||||
"-fx-font-weight: bold;" +
|
||||
"-fx-border-radius: 15px;" +
|
||||
"-fx-background-radius: 20px;");
|
||||
|
||||
pane.getChildren().add(button);
|
||||
}
|
||||
}
|
||||
|
||||
/*** Alteköster
|
||||
* Formatiert alle kleinen Labels (keine Überschrift) und fügt sie der Pane hinzu
|
||||
* @param labels LabelArray mit allen Labels
|
||||
* @param pane Pane, auf der die Labels angezeigt werden
|
||||
*/
|
||||
public void labelsFormating(Label[] labels, Pane pane) {
|
||||
for (Label label : labels) {
|
||||
label.setPrefSize(250, 50);
|
||||
|
||||
label.setStyle("-fx-background-color: #DED894; " +
|
||||
"-fx-text-fill: #000000; " +
|
||||
"-fx-font-size: 20px; " +
|
||||
"-fx-border-width: 5px;" +
|
||||
"-fx-border-color: #543847;" +
|
||||
"-fx-font-weight: bold;" +
|
||||
"-fx-alignment: center;" +
|
||||
"-fx-background-radius: 20px;" +
|
||||
"-fx-border-radius: 15px;");
|
||||
|
||||
pane.getChildren().add(label);
|
||||
|
||||
label.setVisible(false);
|
||||
}
|
||||
}
|
||||
|
||||
/*** Alteköster
|
||||
* Formatiert alle Überschriften-Labels und fügt sie der Pane hinzu
|
||||
* @param labels LabelArray mit Überschriften-Labels
|
||||
* @param pane Pane, auf der die Labels angezeigt werden
|
||||
*/
|
||||
public void headlineFormating(Label[] labels, Pane pane) {
|
||||
for (Label label : labels) {
|
||||
label.setPrefSize(300, 75);
|
||||
label.setTextAlignment(TextAlignment.CENTER);
|
||||
|
||||
label.setStyle("-fx-background-color: #DED894; " +
|
||||
"-fx-text-fill: #000000; " +
|
||||
"-fx-font-size: 35px; " +
|
||||
"-fx-border-width: 5px;" +
|
||||
"-fx-border-color: #543847;" +
|
||||
"-fx-font-weight: bold;" +
|
||||
"-fx-alignment: center;" +
|
||||
"-fx-background-radius: 20px;" +
|
||||
"-fx-border-radius: 15px;");
|
||||
|
||||
pane.getChildren().add(label);
|
||||
}
|
||||
}
|
||||
|
||||
/*** Alteköster
|
||||
* Formatiert alle Textfelder und fügt sie der Pane hinzu
|
||||
* @param textfields TextFieldArray mit allen Textfeldern
|
||||
* @param pane Pane, auf der die Textfelder angezeigt werden
|
||||
*/
|
||||
public void textfieldsFormating(TextField[] textfields, Pane pane) {
|
||||
for (TextField field : textfields) {
|
||||
field.setPrefSize(250, 50);
|
||||
field.setStyle("-fx-font-size: 20px;" +
|
||||
"-fx-font-weight: bold;");
|
||||
|
||||
pane.getChildren().add(field);
|
||||
|
||||
field.setVisible(false);
|
||||
}
|
||||
}
|
||||
|
||||
/*** Alteköster
|
||||
* Formatiert den soundSlider und fügt ihn der Pane hinzu
|
||||
* @param slider SoundSlider
|
||||
* @param pane Pane, auf der der Slider angezeigt wird
|
||||
*/
|
||||
public void soundSliderFormating(Slider slider, Pane pane) {
|
||||
slider.setPrefSize(200, 5);
|
||||
slider.setLayoutX(300);
|
||||
slider.setLayoutY(295);
|
||||
|
||||
pane.getChildren().add(slider);
|
||||
|
||||
slider.setVisible(false);
|
||||
}
|
||||
|
||||
/*** Alteköster
|
||||
* Formatiert den PauseScreen
|
||||
*/
|
||||
public void pauseScreenFormating(Pane pause, Label pauseMenuLabel, Label soundLabelPause) {
|
||||
/*pause-Pane formatieren*/
|
||||
pause.setPrefSize(400, 400);
|
||||
pause.setLayoutX(200);
|
||||
pause.setLayoutY(150);
|
||||
pause.setStyle("-fx-background-color: #DED894; " +
|
||||
"-fx-border-width: 5px;" +
|
||||
"-fx-border-color: #543847;" +
|
||||
"-fx-border-radius: 15px;" +
|
||||
"-fx-background-radius: 20px;");
|
||||
|
||||
/*pauseMenuLabel formatieren*/
|
||||
pauseMenuLabel.setPrefSize(300,50);
|
||||
pauseMenuLabel.setLayoutX(50);
|
||||
pauseMenuLabel.setLayoutY(10);
|
||||
pauseMenuLabel.setStyle("-fx-background-color: #DED894; " +
|
||||
"-fx-text-fill: #000000; " +
|
||||
"-fx-font-size: 35px; " +
|
||||
"-fx-font-weight: bold;" +
|
||||
"-fx-alignment: center;");
|
||||
|
||||
/*soundLabelPause formatieren*/
|
||||
soundLabelPause.setPrefSize(100, 50);
|
||||
soundLabelPause.setLayoutX(150);
|
||||
soundLabelPause.setLayoutY(100);
|
||||
soundLabelPause.setStyle("-fx-background-color: #DED894; " +
|
||||
"-fx-text-fill: #000000; " +
|
||||
"-fx-font-size: 20px; " +
|
||||
"-fx-font-weight: bold;" +
|
||||
"-fx-alignment: center;");
|
||||
}
|
||||
|
||||
/*** Pape
|
||||
* formatiert den End-Screen
|
||||
*/
|
||||
public void endScreenFormating(Pane endScreen, Label endScreenHeadline, Label currentScoreEndscreenLabel) {
|
||||
/*Endscreen-Pane formatieren*/
|
||||
endScreen.setPrefSize(400, 500);
|
||||
endScreen.setLayoutX(200);
|
||||
endScreen.setLayoutY(100);
|
||||
endScreen.setStyle("-fx-background-color: #DED894; " +
|
||||
"-fx-border-width: 5px;" +
|
||||
"-fx-border-color: #543847;" +
|
||||
"-fx-border-radius: 15px;" +
|
||||
"-fx-background-radius: 20px;");
|
||||
|
||||
endScreenHeadline.setPrefSize(300,50);
|
||||
endScreenHeadline.setLayoutX(50);
|
||||
endScreenHeadline.setLayoutY(10);
|
||||
endScreenHeadline.setStyle("-fx-background-color: #DED894; " +
|
||||
"-fx-text-fill: #000000; " +
|
||||
"-fx-font-size: 35px; " +
|
||||
"-fx-font-weight: bold;" +
|
||||
"-fx-alignment: center;");
|
||||
|
||||
currentScoreEndscreenLabel.setPrefSize(300,50);
|
||||
currentScoreEndscreenLabel.setLayoutX(50);
|
||||
currentScoreEndscreenLabel.setLayoutY(100);
|
||||
currentScoreEndscreenLabel.setStyle("-fx-background-color: #DED894; " +
|
||||
"-fx-text-fill: #000000; " +
|
||||
"-fx-font-size: 35px; " +
|
||||
"-fx-font-weight: bold;" +
|
||||
"-fx-alignment: center;");
|
||||
}
|
||||
|
||||
/*** Alteköster
|
||||
* Erstellt ein neues BackgroundImage aus einer Source für ein .png
|
||||
* @param img Source eines .png
|
||||
* @return backgroundImage
|
||||
*/
|
||||
public BackgroundImage backgroundFormating(String img) {
|
||||
/*Bild für Hintergrund erstellen:*/
|
||||
Image image = new Image(img);
|
||||
|
||||
/*Hintergrund erstellen:*/
|
||||
BackgroundImage backgroundImage = new BackgroundImage(
|
||||
image,
|
||||
BackgroundRepeat.NO_REPEAT,
|
||||
BackgroundRepeat.NO_REPEAT,
|
||||
BackgroundPosition.DEFAULT,
|
||||
BackgroundSize.DEFAULT
|
||||
);
|
||||
|
||||
return backgroundImage;
|
||||
}
|
||||
|
||||
/*** Alteköster
|
||||
* Formatiert die Buttons, mit denen man das Hintergrundbild ändern kann
|
||||
* @param backgroundButtons Array der Buttons
|
||||
* @param pane Pane, auf der die Buttons angezeigt werden sollen
|
||||
*/
|
||||
public void backgroundButtonsFormating(Button[] backgroundButtons, Pane pane) {
|
||||
int xPosition = 150;
|
||||
|
||||
for(int i=0; i<backgroundButtons.length; i++) {
|
||||
backgroundButtons[i].setPrefSize(200, 175);
|
||||
backgroundButtons[i].setLayoutY(400);
|
||||
backgroundButtons[i].setLayoutX(xPosition);
|
||||
xPosition += 300;
|
||||
|
||||
/*Source als String*/
|
||||
String img = "file:src/main/resources/com/example/happy_bird/pics/Background"+i+"button.png";
|
||||
|
||||
/*Hintergrund zu Pane hinzufügen:*/
|
||||
Background background = new Background(backgroundFormating(img));
|
||||
|
||||
backgroundButtons[i].setBackground(background);
|
||||
|
||||
backgroundButtons[i].setStyle("-fx-border-width: 7px;" +
|
||||
"-fx-border-insets: -7;" +
|
||||
"-fx-border-color: #FFFFFF;" +
|
||||
"-fx-border-radius: 15px;");
|
||||
|
||||
pane.getChildren().add(backgroundButtons[i]);
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,5 +0,0 @@
|
||||
package com.example.happy_bird;
|
||||
|
||||
public class HappyBird {
|
||||
|
||||
}
|
@@ -1,23 +0,0 @@
|
||||
package com.example.happy_bird;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class HelloApplication extends Application {
|
||||
@Override
|
||||
public void start(Stage stage) throws IOException {
|
||||
FXMLLoader fxmlLoader = new FXMLLoader(HelloApplication.class.getResource("hello-view.fxml"));
|
||||
Scene scene = new Scene(fxmlLoader.load(), 320, 240);
|
||||
stage.setTitle("Hello!");
|
||||
stage.setScene(scene);
|
||||
stage.show();
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
launch();
|
||||
}
|
||||
}
|
@@ -1,14 +0,0 @@
|
||||
package com.example.happy_bird;
|
||||
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.control.Label;
|
||||
|
||||
public class HelloController {
|
||||
@FXML
|
||||
private Label welcomeText;
|
||||
|
||||
@FXML
|
||||
protected void onHelloButtonClick() {
|
||||
welcomeText.setText("Welcome to JavaFX Application!");
|
||||
}
|
||||
}
|
48
Happy_Bird/src/main/java/com/example/happy_bird/MariaDB.java
Normal file
@@ -0,0 +1,48 @@
|
||||
package com.example.happy_bird;
|
||||
|
||||
/** Pape */
|
||||
import java.sql.*;
|
||||
public class MariaDB
|
||||
{
|
||||
public String username;
|
||||
public String pw;
|
||||
public String url;
|
||||
public String driver;
|
||||
Connection con;
|
||||
Statement st;
|
||||
|
||||
public MariaDB()
|
||||
{
|
||||
|
||||
username="root";
|
||||
pw="HappyBird1";
|
||||
url="jdbc:mariadb://localhost:3306/happybird";
|
||||
driver="org.mariadb.jdbc.Driver";
|
||||
try {
|
||||
Class.forName(driver);
|
||||
con=DriverManager.getConnection(url, username, pw);
|
||||
st=con.createStatement();
|
||||
System.out.println("Connection is successful");
|
||||
} catch (Exception e) {
|
||||
System.out.println("Fehler in der Verbindung");
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
try
|
||||
{
|
||||
con = DriverManager.getConnection("jdbc:mariadb://localhost:3306/happybird?user=root&password=HappyBird1");
|
||||
st= (Statement) con.createStatement();
|
||||
driver="org.mariadb.jdbc.Driver";
|
||||
System.out.println("Connection is successful");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
System.out.println("Fehler in der Verbindung");
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
*/
|
||||
}
|
||||
}
|
@@ -1,6 +1,8 @@
|
||||
module com.example.happy_bird {
|
||||
requires javafx.controls;
|
||||
requires javafx.fxml;
|
||||
requires java.desktop;
|
||||
requires java.sql;
|
||||
|
||||
|
||||
opens com.example.happy_bird to javafx.fxml;
|
||||
|
@@ -1,14 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.scene.control.TextField?>
|
||||
<?import javafx.scene.control.Button?>
|
||||
<?import javafx.scene.image.*?>
|
||||
<?import javafx.scene.layout.*?>
|
||||
|
||||
<VBox prefHeight="578.0" prefWidth="700.0" xmlns="http://javafx.com/javafx/11.0.2" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.example.happy_bird.HappyBird">
|
||||
<StackPane prefHeight="800.0" prefWidth="700.0" xmlns="http://javafx.com/javafx/11.0.2" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.example.happy_bird.HappyBird" back >
|
||||
|
||||
<ImageView>
|
||||
<image>
|
||||
<Image url="@screen.png" />
|
||||
<Image url="@pics/Background.png"></Image>
|
||||
</image>
|
||||
</ImageView>
|
||||
|
||||
</VBox>
|
||||
</StackPane>
|
||||
|
@@ -1,16 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.geometry.Insets?>
|
||||
<?import javafx.scene.control.Label?>
|
||||
<?import javafx.scene.layout.VBox?>
|
||||
|
||||
<?import javafx.scene.control.Button?>
|
||||
<VBox alignment="CENTER" spacing="20.0" xmlns:fx="http://javafx.com/fxml"
|
||||
fx:controller="com.example.happy_bird.HelloController">
|
||||
<padding>
|
||||
<Insets bottom="20.0" left="20.0" right="20.0" top="20.0"/>
|
||||
</padding>
|
||||
|
||||
<Label fx:id="welcomeText"/>
|
||||
<Button text="Hello!" onAction="#onHelloButtonClick"/>
|
||||
</VBox>
|
After Width: | Height: | Size: 114 KiB |
After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 54 KiB |
After Width: | Height: | Size: 5.5 KiB |
After Width: | Height: | Size: 4.9 KiB |
After Width: | Height: | Size: 4.6 KiB |
After Width: | Height: | Size: 65 KiB |
Before Width: | Height: | Size: 126 KiB |
14
SQL-Queries.txt
Normal file
@@ -0,0 +1,14 @@
|
||||
SQL-Abfragen:
|
||||
|
||||
Highscores:
|
||||
SELECT * FROM happybirddb ORDER BY punkte DESC LIMIT 5;
|
||||
Dann Ausgabe auf dem Bildschirm
|
||||
|
||||
Einfügen in die DB:
|
||||
INSERT INTO HappyBirdDB (name, kuerzel, punkte) VALUES ('playername', 'playerkuerzel', points);
|
||||
//playername, playerkuerzel, points sind Variablen
|
||||
|
||||
|
||||
Maximale Punkte des Spielers:
|
||||
SELECT MAX(punkte) FROM happybirddb WHERE kuerzel = 'playerkuerzel';
|
||||
|
82
gitignore
Normal file
@@ -0,0 +1,82 @@
|
||||
# Mobile Tools for Java (J2ME)
|
||||
.mtj.tmp/
|
||||
|
||||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
||||
hs_err_pid*
|
||||
|
||||
### JetBrains template
|
||||
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio
|
||||
|
||||
|
||||
*.iml
|
||||
|
||||
## Directory-based project format:
|
||||
.idea/
|
||||
# if you remove the above rule, at least ignore the following:
|
||||
|
||||
|
||||
# User-specific stuff:
|
||||
# .idea/workspace.xml
|
||||
# .idea/tasks.xml
|
||||
# .idea/dictionaries
|
||||
|
||||
|
||||
# Sensitive or high-churn files:
|
||||
# .idea/dataSources.ids
|
||||
# .idea/dataSources.xml
|
||||
# .idea/sqlDataSources.xml
|
||||
# .idea/dynamic.xml
|
||||
# .idea/uiDesigner.xml
|
||||
|
||||
# Gradle:
|
||||
# .idea/gradle.xml
|
||||
# .idea/libraries
|
||||
|
||||
|
||||
# Mongo Explorer plugin:
|
||||
# .idea/mongoSettings.xml
|
||||
|
||||
## File-based project format:
|
||||
*.ipr
|
||||
*.iws
|
||||
|
||||
## Plugin-specific files:
|
||||
|
||||
# IntelliJ
|
||||
/out/
|
||||
|
||||
# mpeltonen/sbt-idea plugin
|
||||
.idea_modules/
|
||||
|
||||
# JIRA plugin
|
||||
atlassian-ide-plugin.xml
|
||||
|
||||
# Crashlytics plugin (for Android Studio and IntelliJ)
|
||||
com_crashlytics_export_strings.xml
|
||||
crashlytics.properties
|
||||
crashlytics-build.properties
|
||||
|
||||
|
||||
# Created by .ignore support plugin (hsz.mobi)
|
||||
|
||||
|
||||
# Compiled class file
|
||||
*.class
|
||||
|
||||
# Log file
|
||||
*.log
|
||||
|
||||
|
||||
# Package Files #
|
||||
*.jar
|
||||
*.war
|
||||
*.nar
|
||||
*.ear
|
||||
*.zip
|
||||
*.tar.gz
|
||||
*.rar
|
||||
|
||||
Happy_Bird/.gradle/
|
||||
Happy_Bird/app/build/
|
||||
Happy_Bird/data/build/
|
||||
Happy_Bird/.gradle/buildOutputCleanup/
|