Code Cleaning
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.
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 6.5 KiB |
Binary file not shown.
@@ -733,32 +733,17 @@ public class HappyBirdMain extends Application {
|
|||||||
*/
|
*/
|
||||||
birdPositionMovedBy = 0;
|
birdPositionMovedBy = 0;
|
||||||
scene.setOnKeyPressed(event -> {
|
scene.setOnKeyPressed(event -> {
|
||||||
/*if (event.getCode() == KeyCode.S) {
|
|
||||||
moveBirdDown();
|
|
||||||
System.out.println(birdPositionMovedBy);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
|
if (event.getCode() == KeyCode.W) {
|
||||||
// FUNKTIONIERT
|
|
||||||
// aktuelle birdPositionMovedBy rausfid
|
|
||||||
|
|
||||||
|
|
||||||
/*if (event.getCode() == KeyCode.W) {
|
|
||||||
moveBirdUp();
|
moveBirdUp();
|
||||||
}
|
}
|
||||||
if (event.getCode() == KeyCode.S) {
|
if (event.getCode() == KeyCode.S) {
|
||||||
moveBirdDown();
|
moveBirdDown();
|
||||||
}*/
|
}
|
||||||
|
|
||||||
if (event.getCode() == KeyCode.W) {
|
if (event.getCode() == KeyCode.ESCAPE && !menuScreenRunning) {
|
||||||
moveBirdUp();
|
pauseButtonClick(this.gameRunning);
|
||||||
}
|
this.gameRunning = !this.gameRunning;
|
||||||
else {
|
|
||||||
moveBirdDown();
|
|
||||||
}
|
|
||||||
if (event.getCode() == KeyCode.ESCAPE && !menuScreenRunning) {
|
|
||||||
pauseButtonClick(this.gameRunning);
|
|
||||||
this.gameRunning = !this.gameRunning;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -1199,6 +1184,7 @@ public class HappyBirdMain extends Application {
|
|||||||
generateMenueScreen();
|
generateMenueScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Aufstieg dauert immer länger
|
||||||
private void moveBirdUp() {
|
private void moveBirdUp() {
|
||||||
velocity = (float) -4.5;
|
velocity = (float) -4.5;
|
||||||
var pos = velocity += gravity;
|
var pos = velocity += gravity;
|
||||||
@@ -1206,7 +1192,7 @@ public class HappyBirdMain extends Application {
|
|||||||
happyBird.setLayoutY(birdPositionMovedBy);
|
happyBird.setLayoutY(birdPositionMovedBy);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Soll Automatisch runter fallen
|
// Fall geht schneller
|
||||||
private void moveBirdDown() {
|
private void moveBirdDown() {
|
||||||
var pos = velocity -= gravity;
|
var pos = velocity -= gravity;
|
||||||
birdPositionMovedBy -= pos;
|
birdPositionMovedBy -= pos;
|
||||||
|
Reference in New Issue
Block a user