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;
|
||||
scene.setOnKeyPressed(event -> {
|
||||
/*if (event.getCode() == KeyCode.S) {
|
||||
moveBirdDown();
|
||||
System.out.println(birdPositionMovedBy);
|
||||
}*/
|
||||
|
||||
|
||||
// FUNKTIONIERT
|
||||
// aktuelle birdPositionMovedBy rausfid
|
||||
|
||||
|
||||
/*if (event.getCode() == KeyCode.W) {
|
||||
if (event.getCode() == KeyCode.W) {
|
||||
moveBirdUp();
|
||||
}
|
||||
if (event.getCode() == KeyCode.S) {
|
||||
moveBirdDown();
|
||||
}*/
|
||||
}
|
||||
|
||||
if (event.getCode() == KeyCode.W) {
|
||||
moveBirdUp();
|
||||
}
|
||||
else {
|
||||
moveBirdDown();
|
||||
}
|
||||
if (event.getCode() == KeyCode.ESCAPE && !menuScreenRunning) {
|
||||
pauseButtonClick(this.gameRunning);
|
||||
this.gameRunning = !this.gameRunning;
|
||||
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;
|
||||
|
Reference in New Issue
Block a user