Code Cleaning
This commit is contained in:
parent
4f2eeb5040
commit
88b0ba5d05
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,29 +733,14 @@ public class HappyBirdMain extends Application {
|
||||
*/
|
||||
birdPositionMovedBy = 0;
|
||||
scene.setOnKeyPressed(event -> {
|
||||
/*if (event.getCode() == KeyCode.S) {
|
||||
moveBirdDown();
|
||||
System.out.println(birdPositionMovedBy);
|
||||
}*/
|
||||
|
||||
|
||||
// FUNKTIONIERT
|
||||
// aktuelle birdPositionMovedBy rausfid
|
||||
|
||||
|
||||
/*if (event.getCode() == KeyCode.W) {
|
||||
moveBirdUp();
|
||||
}
|
||||
if (event.getCode() == KeyCode.S) {
|
||||
moveBirdDown();
|
||||
}*/
|
||||
|
||||
if (event.getCode() == KeyCode.W) {
|
||||
moveBirdUp();
|
||||
}
|
||||
else {
|
||||
if (event.getCode() == KeyCode.S) {
|
||||
moveBirdDown();
|
||||
}
|
||||
|
||||
if (event.getCode() == KeyCode.ESCAPE && !menuScreenRunning) {
|
||||
pauseButtonClick(this.gameRunning);
|
||||
this.gameRunning = !this.gameRunning;
|
||||
@ -1199,6 +1184,7 @@ public class HappyBirdMain extends Application {
|
||||
generateMenueScreen();
|
||||
}
|
||||
|
||||
// Aufstieg dauert immer länger
|
||||
private void moveBirdUp() {
|
||||
velocity = (float) -4.5;
|
||||
var pos = velocity += gravity;
|
||||
@ -1206,7 +1192,7 @@ public class HappyBirdMain extends Application {
|
||||
happyBird.setLayoutY(birdPositionMovedBy);
|
||||
}
|
||||
|
||||
// Soll Automatisch runter fallen
|
||||
// Fall geht schneller
|
||||
private void moveBirdDown() {
|
||||
var pos = velocity -= gravity;
|
||||
birdPositionMovedBy -= pos;
|
||||
|
Loading…
Reference in New Issue
Block a user