fixed score at end of tetris not working
This commit is contained in:
		| @@ -57,11 +57,11 @@ public class TetrisGame { | ||||
|     } | ||||
|  | ||||
|     public void pressedButton(Button button) { | ||||
|         if(lastPresses.getOrDefault(button, 0L) >= System.currentTimeMillis()-100) return; | ||||
|         if(this.lastPresses.getOrDefault(button, 0L) >= System.currentTimeMillis()-100) return; | ||||
|  | ||||
|         lastPresses.put(button, System.currentTimeMillis()); | ||||
|         if(button == Button.W) lastPresses.put(button, System.currentTimeMillis()+70); | ||||
|         if(button == Button.S) lastPresses.put(button, System.currentTimeMillis()-70); | ||||
|         this.lastPresses.put(button, System.currentTimeMillis()); | ||||
|         if(button == Button.W) this.lastPresses.put(button, System.currentTimeMillis()+70); | ||||
|         if(button == Button.S) this.lastPresses.put(button, System.currentTimeMillis()-70); | ||||
|  | ||||
|         switch (button) { | ||||
|             case A -> this.moveLeft(); | ||||
| @@ -74,6 +74,10 @@ public class TetrisGame { | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     public void releaseButton(Button button) { | ||||
|         this.lastPresses.put(button, 0L); | ||||
|     } | ||||
|  | ||||
|     public Pos getPlayerSpawnPosition() { | ||||
|         return this.playfield.getPlayerSpawnPosition(); | ||||
|     } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user