Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

using java 09:03 el Challenge (yet fun, hopefully) Activity: Gotta catch em You will now make a simple Pokmon game, similar to the one your

using java
image text in transcribed
image text in transcribed
image text in transcribed
09:03 el Challenge (yet fun, hopefully) Activity: Gotta catch em You will now make a simple Pokmon game, similar to the one your TA showed you at the beginning of Lab. There are many parts that you must include in this game 1. Before starting anything, allow the player to pick his or her starter Pokmon from a given saved in a string for use throughout the game list. You Pokmon name 2. Once complete, the player is shown a menu in which they can choose to (I) Search for Pokmon, (2) Use a potion, or (3) Quit the game. You must use a loop, so that once they choose and complete to this menu once again. The player can keep choosing menu items until they decide to quit (or if their Pokmon faints) one menu option, they are taken back Here are some brief descriptions of the menu items 1. Search for Pokmon: Have a random number generator to determine whether or not the player's search was successful. Generate a number from I to 10. If the number falls below 6, the search was successful. Otherwise, the player failed to find a Pokmon. Display message accordingly. 2. Use a potion: The player has a total of 10 potions. Each potions heals the starter Pokmon by 20 HP, and decrements the player's total amount of potions remaining 3. Quit: Display a goodbye message and end the game. Whenever a player successfully finds a Pokmon, there are a few things you must instantiate for that new Pokmon: 1. Have their starting HP be a randomly generated amount from 50 to 100, 2. Have the Pokmon type itself be random. Hint:You can do this with a random number generator and a switch case statement, to save different Pokmon names into a string. Have at least three different types. The player will also be given another menu with new options. They may either (1) Fight the enemy Pokmon, (2) Use a Pokeball, (3) Use a Potion, or (4) Flee. These options are now described below . Fight the enemy Pokmon: Each Pokmon will take turms to do damage to the other one. Have the damage amount be a randomly generated number (you may choose a range that seems reasonable to you), and subtract that amount from the receiving Pokmon's HP 2. Use a Pokeball: The player throws a Pokeball at the enemy Pokmon. They either succeed or fail to catch it. The success rate is determined by the following algorithm: double successRate enemy TotalHP If a random number from I to 10 is less than the success Rate, the player caught the Pokmon. Otherwise, they failed to catch it. 3. Use a Potion: Like before, each potion heals the main Pokmon by 20 HP, and each use decrements the potion counter by on 4. Flee: The pl to the main 09:03 1 instructure-uploads.s3.amazonaws.com decrements the player's total amount of potions remaining one 3. Quit: Display a goodbye message and end the game. Whenever a player successfully finds a Pokmon, there are a few things you must instantiate for that new Pokmon: 1. Have their starting HP be a randomly generated amount from 50 to 100. 2. Have the Pokmon type itself be random. Hint: You can do this with a random number generator and a switch case statement, to save different Pokmon names into a string. Have at least three different types. The player will also be given another menu with new options. They may either (1) Fight the enemy Pokmon, (2) Use a Pokeball, (3) Use a Potion, or (4) Flee. These options are now described below: 1. Fight the enemy Pokmon: Each Pokmon will take turns to do damage to the other one. Have the damage amount be a randomly generated number (you may choose a range that seems reasonable to you), and subtract that amount from the receiving Pokmon's HP 2. Use a Pokeball: The player throws a Pokeball at the enemy Pokmon. They either succeed or fail to catch it. The success rate is determined by the following algorithm: double successRate -enemyTotalHP enemyCurrentHP: If a random number from 1 to 10 is less than the successRate, the player caught the Pokmon. Otherwise, they failed to catch it. 3. Use a Potion: Like before, each potion heals the main Pokmon by 20 HP, and each use decrements the potion counter by one. 4. Flee: The player flees the battle and returns to the main menu. There are a few extra things to note: 1. If the enemy Pokmon faints, you can no longer fight it and the player returns to the main menu. 2. If the player's Pokmon faints, the game ends and you can no longer search for Pokmon (or use a potion. 3. The player's Pokmon starts at 100 HP, and cannot use potions to go over this starting amount. If you need to see the example program again, ask your TA. They may show you the running program, however, they cannot just give you the code. If you do need additional assistance, do not hesitate to ask! It may also be helpful to make a list of variables you believe you will need, as well as writing out the pseudocode beforehand. This will help keep your code more organized once you actually begin the program. Pokmon Activity Organizer Planning out a program and organizing its structure ahead of time can help make the coding process much easier. Below is a beginning framework to this Lab's Challenge Activity. We've started off by eiving you some Main Method th iables and main blocks-now try filling in the resal Variables String pokemon nt potions 10 int yourHP 100 Main Menu Option 1: Search for Pokmon Option 2: Use a Potion Option 3: Quit

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions