-
Notifications
You must be signed in to change notification settings - Fork 1
Serialization Design
The game will be save in a customize .txt file named with username, using JAVA build in library- PrintWriter and BufferedReader. The game will load/save the file once the player envoke the correspond save/load button
The first line of file will consist of the amount of time left at the current level:
If the amount of time left is equal to 0. In another phrase the user saved at the end of a level. The file will simply save the game at the **next level ** with the exception that it is already the end of game. If the user save at the end of game. The file will only consist with a line of "###END###" to indicate the end of entire game.
The second line of file will consist of a number indicate the current level
The Third line of the file consist the current score of the level
The fourth line of file will consist the difficulty level of the game in String, such as {easy,medium,hard}
The fifth line consist a number indicate number of player
A string of ###user will come before every string line consist of player's information
The format for player's information comes in a string line with username; totalCoins; current score in the level;health; shipSkin; UpperLeftXPosition; UpperLeftPosition; width;height;deltaX; deltaY; and additional affects on the player separate by a colon. Additionally, information for additional affects will be separate by commas according to the additional affect type within the colons
The line after player's information consist the number of game Object
A string of ###gameobject will come before every string line consist of game object The format for game object comes in a string line with object type; specific Object Type; UpperLeftXPosition; UpperLeftYposition; deltaX; delatY;appearTime; and additional affects on the object, each separate by a colon. Additionally, information for additional affects will be separate by commas within the colons.
The file ends with ENDL#, indicate the end of a files
* 15
* 2
* 20
* easy
* 1
* ###user
* Jack;100;20;58;SHIP1;300;450;5;5;10;10;PowerUp,TemporaryInvincible,5,3,18
Explanation: TemporaryInvincible is a powerup that still can last for 5 seconds, and right now has lasted for 3 seconds, and it starts during the 18 seconds remaining of the game
* 3
* ###gameobject
* EnemyObject;BOUNCER;100;230;5;5;4;4;60
* ###gameobject
* Obstacle;Obstacle;100;250;5;5;0;0;60
* ###gameobject
* PowerUp;Freeze;20;50;5;5;0;0;60
* ENDL#
*
* 60
* 4
* 40
* easy
* 1
* ###user
* Andrew;200;25;30;SHIP1;300;450;5;5;10;10
* 0
* ENDL#
* ###END###
[Save/Load Methods] https://github.com/bjucps209/spring2021-team4/blob/main/Wave/src/model/Wave.java
[Unit Tests] https://github.com/bjucps209/spring2021-team4/blob/main/Wave/src/model/WaveTest.java
Peer Review: 2021/4/3 4:17 pm Reviewer: Conner Recommendation: Beware of change might occur later during the implementation stage, such as adding new variables.