Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Code a boxing game using Python that has the following game logic and requirements: The game should put you the Player against an opponent being
Code a boxing game using Python that has the following game logic and requirements:
The game should put you the Player against an opponent being the Al There should be boxing character animation for the Al and the Player. The game should allow both the and Player to dodge to the right and dodge to the left as well as block and punch. The keys for left dodging should be the left arrow or the letter on the keyboard. And for the right dodging the keys should be the right arrow or the letter on the keyboard. For punching it should be a left click or the letter W on the keyboard. And for a block it should be a right click and hold or a click and hold on the space bar. Once the space bar or right click hold is released the blocking should stop. The game will have both the Al and Player fight one round and both the and Player will start with health which should be displayed throughout the fight. Once either the Player or Al reaches the game should say whether you the Player won or lost. The game should not work in a way where the player and take turns. The should be made to make random actions between the left and right dodges and blocking and punching. Every landed punch should take health away from the Player or Al depending on who was punched. The block will have a health bar of that also takes health when a punch lands from the opponent. And it should regenerate health to the block every seconds. If the block reaches then the or player should take damage for each punch landed if hit before any block hp is regenerated. There should also be a stamina bar for both the Al and Player. Only dodges and punches will deplete the stamina bar, both dodges and punches should deplete from the stamina bar which will have a maximum of stamina and will regenerate by every seconds. If the Player or ever runs out of stamina then there should be a second delay before the stamina starts to regenerate only allowing the Player or Al to block until some stamina is regenerated. Now for the punches it should alternate between each hand for both the player and in a pattern. If a punch is thrown first with the right hand then the next punch will always be thrown by the left hand and then the next punch will be the opposite in a constant pattern. There should also be an opportunity to perfect dodge which is performed when dodging in the same direction a punch is coming from at the same time it is thrown. That means dodging to the left when the opponent throws a right punch at the same time the throw it or dodging to the right when the opponent throws a left punch at the same time. The perfect dodge should freeze the Al or Player for seconds if their punch was perfect dodged allowing for the Al or Player to land unavoidable punches in that seconds time. And once the seconds are over the game should unfreeze either the Al or Player that was frozen and continue as normal until either the Player or Al's health bar reaches and the game displays whether the Player won or lost. Whoever loses whether it be the Players or AI the losers character animation should be laying down and knocked out. And the winners character animation being either the Player or Al should be having both arms raised.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started