Add boss portrait, reduce frequency of saves
parent
75257a29fe
commit
b796df4759
Binary file not shown.
After Width: | Height: | Size: 739 B |
|
@ -42,7 +42,7 @@ public class GamePanel extends JPanel implements Runnable, KeyListener, Serializ
|
||||||
public int playerFrame, enemyFrame;
|
public int playerFrame, enemyFrame;
|
||||||
// keeps track of how many ticks has elapsed since last frame change
|
// keeps track of how many ticks has elapsed since last frame change
|
||||||
public int playerFrameCounter = 0;
|
public int playerFrameCounter = 0;
|
||||||
public int enemyFrameCounter = 0;
|
public int timeSinceLastSave = 0;
|
||||||
public boolean isPaused, isDialogue, waitForDialogue, mouseAlreadyTranslated;
|
public boolean isPaused, isDialogue, waitForDialogue, mouseAlreadyTranslated;
|
||||||
public PauseMenu pauseMenu;
|
public PauseMenu pauseMenu;
|
||||||
public DialogueMenu dialogueMenu;
|
public DialogueMenu dialogueMenu;
|
||||||
|
@ -388,7 +388,10 @@ public class GamePanel extends JPanel implements Runnable, KeyListener, Serializ
|
||||||
playerFrameCounter -= 5;
|
playerFrameCounter -= 5;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// a new save is made every tick
|
// a new save is made every 100 ticks
|
||||||
|
timeSinceLastSave++;
|
||||||
|
if (timeSinceLastSave >= 100) {
|
||||||
|
timeSinceLastSave -= 100;
|
||||||
bombCount = LevelManager.bombs;
|
bombCount = LevelManager.bombs;
|
||||||
try {
|
try {
|
||||||
// atomic save to prevent EOF errors
|
// atomic save to prevent EOF errors
|
||||||
|
@ -397,6 +400,7 @@ public class GamePanel extends JPanel implements Runnable, KeyListener, Serializ
|
||||||
} catch (IOException | ConcurrentModificationException e) {
|
} catch (IOException | ConcurrentModificationException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
repaint();
|
repaint();
|
||||||
delta--;
|
delta--;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue