Skip to content

Commit

Permalink
change some comments, increase dropping-time in auto-drop-mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Kappmeyer committed Sep 11, 2023
1 parent 01835e6 commit 8443a93
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 15 deletions.
7 changes: 0 additions & 7 deletions src/gameengine/GameBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,6 @@ public abstract class GameBase {
public void start(String title, int width, int height) {
window = new Window(title, width, height);

//Adding inputManagers to window
// window.addKeyListener(new KeyboardInputManager());
// MouseInputManager mouseInputManager = new MouseInputManager(window);
// window.addMouseListener(mouseInputManager);
// window.addMouseMotionListener(mouseInputManager);
// window.addMouseWheelListener(mouseInputManager);

long StartOfInit = System.currentTimeMillis();
init(); //Calling method init() in the sub-class
long StartOfGame = System.currentTimeMillis();
Expand Down
4 changes: 2 additions & 2 deletions src/gamelogic/Game.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class Game {

// used for auto drop mode
private double timeSinceLastDrop;
private final double dropTime = 0.0;
private final double dropTime = 0.39;

private final int numRows;
private final int numColumns;
Expand Down Expand Up @@ -79,7 +79,7 @@ private void drawInfoText(Graphics graphics) {
graphics.setColor(Color.BLACK);
graphics.drawString(numRows + "x" + numColumns + "-Grid", 10, 15);

graphics.drawString("Turns played: " + movesPlayed, 10, TEXT_Y1);
graphics.drawString("Moves played: " + movesPlayed, 10, TEXT_Y1);

graphics.setColor(Color.RED);
graphics.drawString("Red score: " + redScore, 150, TEXT_Y1);
Expand Down
8 changes: 2 additions & 6 deletions src/visuals/Coin.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ public class Coin {

private static final int NO_ANIMATION = -1;
private static final int DROP_ANIMATION = 0;
// private static final int BLINK_ANIMATION = 1;
private static final int RESET_FALL_ANIMATION = 2;

private int animationState;
Expand All @@ -34,6 +33,7 @@ public class Coin {
private static final double STOP_ANIMATION_SPEED = 150;
private double speed;

// blink animation after a player won
private static final double BLINK_SWITCH_TIME = 0.125f;
private static double aktBlinkTime;
private static boolean swapBlink;
Expand Down Expand Up @@ -114,10 +114,6 @@ private void move(double tslf) {
speed += GRAVITY * tslf;
}

/**
* This function sets the {@link #coinstate} of the coin and calls the function {@link #calcColor()}
* @param player The current turn so if player one or player two drop this coin
*/
public void setState(int player) {
coinstate = player;
switch (coinstate) {
Expand Down Expand Up @@ -155,7 +151,7 @@ public static void updateBlink(double tslf) {
}

/**
* This function starts the reset-animation. Fall because all the coins start to fall down.
* This function starts the reset-animation.
*/
public void startResetAnimation() {
animationState = RESET_FALL_ANIMATION;
Expand Down

0 comments on commit 8443a93

Please sign in to comment.