HOME BIO UML DIAGRAM CODE IMPLEMENTATION
SPRING FINAL PROJECT

BIOGRAPHY

Philip

Philip Yuan


Philip Yuan is a junior at Aragon High School. Philip enjoys many extracirricular activities, especially in volunteering, being Order of the Arrow (Scouting's national homor society) Representative and 5 year member of Boy Scout Troop 47 as well as president of the LEOS service club. Philip has also run all three years at Aragon with the Cross Country and Track and Field Distance teams, and plans to continue in his senior year. Though Philip originally thought coding and computer science was very tedious and boring, over his years at Aragon he has begun to develop more interest, self-studying HTML, CSS, Javascript, and Visual Basic Script in his tenth grade year, using the node.js framework to create his very own Discord bot with several built-in APIs, and signing up to take Aragon's AP Computer Science class. Philip is currently studying Java and Python in class and on his own, and plans to continue pursuing his interests by majoring in Computer Science in college. Philip hopes have a career in game design and programming in the future. Philip lives at home with his parents and his sister, Amelia. In his free time, Philip enjoys browsing reddit, watching youtube videos, working on various coding projects, and napping.

UML DIAGRAM

This is the UML Diagram for the project.
Click on the image to view it alone.


// #19 - UML Diagram

UML

CODE LINKS

PROJECT SUMMARY

This program is intended to simulate a group of video game characters. At the top of the hierarchy is the GameCharacter class, as all the video game characters are GameCharacters. Because all video game characters must have a position and a direction relative to that position, the interface Position is implemented in GameCharacter. Then there are two subclasses of GameCharacter (a is-a relationship) - Mario and Enemy. Enemy is simply a default character with only position and direction, but it has a more complex String output when its getDirection() method is called, so it is used to demonstrate polymorphism. Mario has additional methods that GameChracter doesn't have, with an inventory and the ability to attack. This inventory is made of InventoryItem objects; that is, Mario has-a InventoryItem. MarioDriver demonstrates all the methods of the above classes and interfaces.

GameCharacter is the superclass for this project. It contains what all characters must have, a position and a name.

Mario is a subclass of GameCharacter; it is-a GameCharacter. It contains additional items a default GameCharacter does not have, such as an inventory full of items and the ability to attack.

InventoryItem shares a has-a relationship with Mario; Mario has-a InventoryItem. An ArrayList of these is used in Mario to define the inventory.

Enemy is a subclass of GameCharacter; it is-a GameCharacter. It represents an enemy, who is just a GameCharacter with an overriden getDirection() method. In the driver, polymorphism is used with this class.

Position is an interface implemented in GameCharacter. It shows that a GameCharacter must have a position and direction.

MarioDriver is the driver for the whole program. Run this to test the methods, with some results in the implementation section.

IMPLEMENTATION