- a back-end system of a web flash game about an astronaut trying to collect some doughnuts floating in space while some lava rocks are also floating.
- Collision with doughnuts 🍩 will add 5 points to his life, while collision with a lava rock 🔥 will take 20 points from his life.
- The astronaut should try to collect as much doughnuts 🍩 as possible as the score depends the most on the maximum number of collected food all over the played games.
- He also should also take care of his life; as the score depends on it in case equality of the previous aspect ⚡.
-
The Game is developed using Spring Boot Framework 🍃
-
Design Patterns Applied:
- Flyweight Design pattern .. for movables
- Singleton Design Pattern ... when dealing with resources and factories
- Bridge Design Pattern ... for moving the missles
- Factory Method Design Pattern ... for producing the missles
- Facade Design Pattern ... for dealing with Gson Library
-
Techs used And Principles followed:
- Java Threads and Synchronization .. to control movables
- DB connection and JPA .. to save users, and their rankings
- WebSocket and Http protocols .. during the game loop
- sending movables position, and astronaut life
- receiving astronaut position, browser window dimensions, JWT token
- Spring Security using JWT
- Resttemplate .. to save the game
- Gson Serialization and Deserialization
- Dependency Inversion
- Newton's law for curve Interpolation .. used to make the path of the movables
Note: I know it is not a good design decision to use threads at the backend, but this project is just a practice on the pre-mentioned techs