Drawer

Video Game Combat

I created a class structure for a player and enemy in a video game combat system. I implemented methods such as attack() and take_damage(), along with a randomized hit chance mechanic so attacks could occasionally miss. I also added print statements to provide gameplay feedback to the user during combat interactions.

I first focused on establishing a closed-loop combat system before refactoring the code using inheritance and abstraction. I introduced a parent Character class and made both Player and Enemy subclasses, moving shared functionality such as is_alive(), random_hit(), and reduce_health() into the parent class to reduce redundancy and improve code organization.Video Game Combat - image 1 - student project

Video Game Combat - image 2 - student project

Video Game Combat - image 3 - student project