Add tip to return from settings
parent
fcf21cd48d
commit
f86c6260c7
|
@ -46,6 +46,8 @@ public class GameFrame extends JFrame{
|
||||||
System.out.println(e);
|
System.out.println(e);
|
||||||
}
|
}
|
||||||
game.startThread();
|
game.startThread();
|
||||||
|
// save game after load to prevent lag spikes during the game
|
||||||
|
FileManager.writeObjectToFile("local\\temp_state.dat", game);
|
||||||
/*
|
/*
|
||||||
try {
|
try {
|
||||||
// read previously saved controls
|
// read previously saved controls
|
||||||
|
|
|
@ -26,10 +26,11 @@ public class SettingPanel extends MenuPanel {
|
||||||
public static final int GAME_HEIGHT = 630;
|
public static final int GAME_HEIGHT = 630;
|
||||||
|
|
||||||
public TextBox title;
|
public TextBox title;
|
||||||
public TextBox up, down, left, right;
|
public TextBox up, down, left, right, tip;
|
||||||
public ArrayList<TextBox> textBoxArray = new ArrayList<TextBox>();
|
public ArrayList<TextBox> textBoxArray = new ArrayList<TextBox>();
|
||||||
public Font standardFont = new Font(Font.MONOSPACED, Font.BOLD, 60);
|
public Font standardFont = new Font(Font.MONOSPACED, Font.BOLD, 60);
|
||||||
public Font smallFont = new Font(Font.MONOSPACED, Font.PLAIN, 40);
|
public Font smallFont = new Font(Font.MONOSPACED, Font.PLAIN, 40);
|
||||||
|
public Font smallerFont = new Font(Font.MONOSPACED, Font.ITALIC, 24);
|
||||||
public int playerFrame, enemyFrame;
|
public int playerFrame, enemyFrame;
|
||||||
public boolean waitForKey, notFirstWait;
|
public boolean waitForKey, notFirstWait;
|
||||||
public int lastKeyCode = -1;
|
public int lastKeyCode = -1;
|
||||||
|
@ -44,9 +45,10 @@ public class SettingPanel extends MenuPanel {
|
||||||
down = new TextBox(350, 600, 50, GAME_WIDTH, smallFont, "Down", Integer.toString(KeyEvent.VK_S));
|
down = new TextBox(350, 600, 50, GAME_WIDTH, smallFont, "Down", Integer.toString(KeyEvent.VK_S));
|
||||||
left = new TextBox(400, 600, 50, GAME_WIDTH, smallFont, "Left", Integer.toString(KeyEvent.VK_A));
|
left = new TextBox(400, 600, 50, GAME_WIDTH, smallFont, "Left", Integer.toString(KeyEvent.VK_A));
|
||||||
right = new TextBox(450, 600, 50, GAME_WIDTH, smallFont, "Right", Integer.toString(KeyEvent.VK_D));
|
right = new TextBox(450, 600, 50, GAME_WIDTH, smallFont, "Right", Integer.toString(KeyEvent.VK_D));
|
||||||
|
tip = new TextBox(500, 600, 50, GAME_WIDTH, smallerFont, "TIP: Press ESC to return to the main menu", null);
|
||||||
textBoxArray.add(up);
|
textBoxArray.add(up);
|
||||||
textBoxArray.add(down);
|
|
||||||
textBoxArray.add(left);
|
textBoxArray.add(left);
|
||||||
|
textBoxArray.add(down);
|
||||||
textBoxArray.add(right);
|
textBoxArray.add(right);
|
||||||
|
|
||||||
pauseMenu = new PauseMenu(GAME_HEIGHT/2, 0, 400, 400, GAME_WIDTH, smallFont, "Enter your key", true);
|
pauseMenu = new PauseMenu(GAME_HEIGHT/2, 0, 400, 400, GAME_WIDTH, smallFont, "Enter your key", true);
|
||||||
|
@ -68,6 +70,7 @@ public class SettingPanel extends MenuPanel {
|
||||||
t.text = oldText;
|
t.text = oldText;
|
||||||
}
|
}
|
||||||
oldText = textBoxArray.get(currentBox).text;
|
oldText = textBoxArray.get(currentBox).text;
|
||||||
|
tip.draw(g, new Color(0, 0, 0, 0), Color.lightGray);
|
||||||
// TODO: clean up
|
// TODO: clean up
|
||||||
middlewareIndex = GameFrame.game.middlewareArray.indexOf(new Middleware(Integer.parseInt(textBoxArray.get(currentBox).id), -1));
|
middlewareIndex = GameFrame.game.middlewareArray.indexOf(new Middleware(Integer.parseInt(textBoxArray.get(currentBox).id), -1));
|
||||||
// -2 was chosen as oldCode instead of -1 to prevent conflicts
|
// -2 was chosen as oldCode instead of -1 to prevent conflicts
|
||||||
|
|
Loading…
Reference in New Issue