Name: Riski Ilyas
NRP : 5025211189
Reference: https://www.youtube.com/watch?v=bI6e6qjJ8JQ&t=1532s
This project is a simple GUI game called Snake Game. This game has 10 levels that needs to be completed and each level has different diffculties and obstacles. There is also Casual Mode to play the game with no obstacles. There is also a Highscore that records your top score in each Casual Game. Besides the gameplay, it also has Settings with multiple options such as Changing Player Name, Turn On/Off Music, Turn On/Off SFX, & Reset Game. All the settings data will be stored in an external file so that the game still remember the data even when the Game has Closed.
- Casting/Conversion (Casting GameMusic)
- Constructor (Constructors for each screen)
- Overloading (Overloading at screenRouter to route to gamescreen)
Snake-Game/src/main/java/screens/ScreenRouter.java
Lines 35 to 42 in df0c463
- Encapsulation (Observable encapsulation on DataStore)
Snake-Game/src/main/java/utils/DataStore.java
Lines 18 to 22 in df0c463
Snake-Game/src/main/java/utils/DataStore.java
Lines 64 to 66 in df0c463
Snake-Game/src/main/java/utils/DataStore.java
Lines 73 to 75 in df0c463
Snake-Game/src/main/java/utils/DataStore.java
Lines 82 to 84 in df0c463
Snake-Game/src/main/java/utils/DataStore.java
Lines 91 to 93 in df0c463
- Inheritance (Inheritance on Buttons)
- Polymorphism (Level polymorphism on GameScreen)
Snake-Game/src/main/java/screens/GameScreen.java
Lines 226 to 240 in df0c463
- ArrayList (Arraylist for Linsteners on Observable)
- Exception Handling (Exception Handling on DataStore)
Snake-Game/src/main/java/utils/DataStore.java
Lines 29 to 44 in df0c463
- GUI (Java Swing)
Snake-Game/src/main/java/GameFrame.java
Lines 6 to 22 in df0c463
- Interface (Interface for callback on Observable)
Snake-Game/src/main/java/utils/Observable.java
Lines 30 to 32 in df0c463
- Abstract Class (Abstract class for Screen and Level)
Snake-Game/src/main/java/screens/Screen.java
Lines 7 to 19 in df0c463
- Generics (Pair Class)
Snake-Game/src/main/java/utils/Pair.java
Lines 3 to 20 in df0c463
- Collection (Hashmap on SounManager)
- Input Output (I/O for the dataStore)
Snake-Game/src/main/java/utils/DataStore.java
Lines 29 to 62 in df0c463