CS 290 Introduction to Game Development - Lab 10                                 

  1. In HenWay3 game, implement a feature to save the current game by pressing the GAME_A button (typically, number 1 on the emulator). Create a new method saveGame() in the canvas class and use persistent record store to save the current score and the number of lives. Use the following code in the update() method to trigger this feature:
    if((keyState & GAME_A_PRESSED) != 0) {
       System.err.println("GAME_A_PRESSED!!!");
       saveGame();
    }
  2. In HenWay3 game, implement a feature to load a previously stored game by pressing the GAME_B button (typically, number 3 on the emulator). Create a new method loadGame() in the canvas class and use persistent record store to retrieve the current score and the number of lives. Use the following code in the update() method to trigger this feature:
    if((keyState & GAME_B_PRESSED) != 0) {
       System.err.println("GAME_B_PRESSED!!!");
       loadGame();
    }