UML Class Diagram - kyhnmette/Grandma-s-APPLE-PIE--Dungeon- GitHub Wiki
The diagram is spit up in 3 sections: Life forms, Items and Spawns.
Life forms are everything which inherent from the Life class: Our hero (Lars), our boss (tree) and our enemies (Apple). Our plan was to use just "HP" as the health variable for each character, but a bug happened so they all shared the same HP variable and that is why we are using “HeroHP” and “BossHP” as variables instead, though this ruins the concept of inheritance as we had intended “Life” should work.
Lars is our main hero which the player is able to control. We are using composition when Lars “has a” floating health bar over his head and can shot balls of fire which is his attack. Both is composition, because without Lars there would not be any "health bar" or "balls of fire" which can be shot off.
The tree is the main boss which spawns at level 4. The only way it can attack is with its roots which are a part of the tree (the use of composition again).
The apples are the enemies of the game which the player has to beat to proceed to the next level. Their color tells what “level” they are on where green is the weakest one, yellow is stronger and red is the strongest apple. All apples inhabitant from the “Apple” class.
Items are the objects that our hero is able to pick up. The items which is inheriting this class is “Hearts” which gives Lars HP and “AppleSeeds” which gives him points.
The last classes are all the spawn classes, used to spawn objects and handle the GUI of the game.
- SpawnBush - SpawnBushLVL4: Spawns all the enemies, items and bushes (walls) of the level.
- Level1Switch - Level3Switch: Creates the "portal" after defeating all the enemies in a scene there will load the next scene.
- spawnWall: Spawns the layout of the scene (walls, floor and background color).
- CamPos: Sets the position of the camera.
- GUIScript: Handles the intro and how to play screens before the game starts, and also states when the game is on.
- GUIinterface: Handles the small interface there is when the game is played + the win and lose screens when the player wins / looses.