https://csprojects.cs.ndsu.nodak.edu/cscil60/2022 spring/svn'username/proj02 - Read through all instructions and look over the assignment and make a quick mental estimate of how much time you expect projo2 to take you to complete. You should record this initial estimate in the proj02 Questions document. - Fill out the Game Design form at the bottom of the Questions document. This will be checked by the grader for matching features in your game. - Create a functional implementation of your version of the Camel game based on the instructions below, optionally using the recommended APIs provided. - Commit your code to the SVN repository. - Complete the Blackboard portion of the assignment by answering the questions listed at the top of the proj02 Questions Word document. Grading: S Turning in the Blackboard Questions Using proper style, formatting, and identifiers for 25 15 Questions Style / Formatting your code Commenting Class Design project Implementation Game Design Form include Including good comments in your code Using a good object oriented approach for your 20 80 Points given for the italicized portions below Document describing the features you decided to 5 Total 150 Instructions:
2:39 AM Mon Mar 21 1941% C4 ...t-1-prod-fleet01-xythos.content.blackboardcdn.com Instructions: For this assignment you will be creating a Java program that allows users to play a video game based on the concept of Camel, a text-based game originally developed in 1979 using BASIC (http://www.atariarchives.org/morchasicg ... hp?page=24). In the game, the player is attempting to race to safety across the desert on a stolen camel with natives chasing them, a limited water supply, and a variety of conditions that can befall them on their trip. The API for the sample game described in this document has been included on Blackboard as a reference. You are allowed to base your solution on this sample game if you'd like, but you have the flexibility to create your own game following the same pattern as well. For example, you could create a game themed around escaping a zombie apocalypse or trying to become a Pokemon master. The specific attributes your game must have are listed in italics. Your game needs at least two different classes that represent important game entities. In the sample game, these are the camel and the rider. These should be implemented as actual classes in your program. Each class should have at least three resources. In the sample game, Rider has a hunger, energy, and thirst and Camel has hunger, energy, and thirst. It is not necessary for these resources to be similar and could be completely mutually exclusive. These resources should have a value range (in the sample game, 0 - 15 is used for each resource with 0 representing low values resulting in death and 15 being a maximum to prevent over stockpiling) and should be described to the player using text descriptions rather than given as raw numbers. For example, a hunger resource in the range 2 - 5 might be reported to the player as "hungry". The game should have a goal of some kind. In the sample game, the rider and camel need to make it 200 miles before the natives catch up to them. It is best if whatever you choose is a number that can increment upwards towards the goal. There should also be some way of losing based on the progress of this goal. In the sample game this happens if your pursuers catch up to you before reaching the goal. In your game this could be if your opponent manages to collect 500 pogs before your game entity does or if you fail to raise enough money save an orphanage within 20 days. You must include at least three different conditions that will change randomly (or on a cycled schedule, if that makes more sense) during each turn. In the example game, this includes the weather (which is determined randomly), location (which is also determined randomly), and time of day (which runs on a cycle - Morning, Afternoon, Evening, Night, then Morning again). You must include at least 6 menu options related to acquiring resources or progressing towards the goal during actual game play. Choosing one of these should modify your resources (some may go down while others are increased in response) or progress towards your goal in some way. All input must be type and value safe. During a turn in the sample game, the player chooses between resting, searching for food, searching for water, traveling carefully, traveling regularly, and riding hard. Searching for food or water spend rider resources to have a random chance at increasing resources for the rider and camel. The travel options spend resources for the camel to move the player closer to the goal. The options selected from the menu should have some random element as well as outcomes based on the three conditions that you have created. As an example, in the sample game trying to ride all out in extremely hot weather will seriously deplete the camel's resources and it is easier to find food when in the ruins location. You should include at least 20 adjustments to outcomes based on your three conditions. You should output some text to the user as these adjustments occur to help them understand why they are happening which will allow them to become better at the game as they play through it multiple times. You must be able to win or lose the game based on reaching your goal or running out of resources. In the example came you will UKINUTL00mesmo lose when you die (of
2:39 AM Mon Mar 21 O. 1942% E ...t-1-prod-fleet01-xythos.content.blackboardcdn.com You must be able to win or lose the game based on reaching your goal or running our of resources. In the example game, you win by making it 200 miles. You lose when you die (of starvation, thirst, or the natives catching up to you). Whenever the game is won or lost, it should output some information about what has happened to player and then ask the player if they would like to start a new game, which would start the entire process over again. At the start of your game, you must create a menu that allows the player to select the difficulty of the game that affects resource gathering and random events later in the game. You should also be able to customize your game entities with a name and starting resource level. Again, all input must be type and value safe. Other Game Ideas: It is not required that you use the same style of game suggested above. You may want to try implementing something else. Consider the following examples: • Rick and Morty theme - Rick and Morty entities trying to collect 3000 Flurbos • Star Wars theme Han Solo and the Millennium Falcon entities escaping the law • Pokemon theme - Ash and Pikachu game entities trying to capture all 150 pokemon • Computer theme - Hacker and Computer entities trying to steal secret documents • Oregon Trail theme - Pioneer and Cart entities trying to avoid dying of dysentery • Desert Bus theme – Driver and Bus entities trying not to die of boredom Where to Start: It is suggested that you start by designing your game by filling out the game design form with your particular game in mind. Even if you plan on following the sample game, it will be helpful to list the features the game will have. Once you have finished the form, start by creating your game entities as classes, including resources as instance variables. You can then implement the game logic in a main method. You may find it useful to create a separate Game and Main class, where the Main class simply creates an object of type Game and calls the start method. It is also useful to have a general plan for how resources will be acquired and spent based on the different options chosen by the player. You may want to create a rough outline of how much each action will cost and how much can be gained. It will likely be necessary for you to tune these values based on game play, but you may want to do some initial work to ensure that the values you have chosen make it both possible to win and lose the game. You may want to create a large number of private or public helper methods that solve smaller problems (e.y. check if the game is won, display a menu, perform a menu option, etc.) that you can call later instead of attempting to think of everything as one big problem. Look for areas where you are rewriting the same code multiple times as that usually indicates you should be creating a helper method to perform that functionality instead. One example of this helper method functionality (MenuHelper) has been included as an API document. Note that some methods in the various API documents are marked static and some are just (nonstatic) methods. Learning to use the debugger will also be a big help in this assignment as testing your code can be difficult and the debugger will allow you to step through your code at your own pace or modify variables during runtime so you can pin-point logic errors. You may want to use the debugger learning object on the SEP-CyLE website to help you get started with using the debugger. Comments:
1942% % 2:39 AM Mon Mar 21 © ...t-1-prod-fleet01-xythos.content blackboardcdn.com Because this program is likely to be quite large and involve complex logic, you should include comments to help document your code. You may want to consider including Javadoc code for your game entity classes to provide a greater amount of description about them and how their resources work. In general, you should try to have comments for blocks of code that have more than 5 or 6 lines of code in them. It isn't necessary to provide a detailed description of what ever line does, but you should indicate what purpose the following code serves. For example, a comment like "adjust outcomes for finding food based on time of day and location" is sufficient to indicate what the code is doing and to help you find that section of code quickly if you need to make changes to it in the future. Another good rule to follow is that when writing a method that if it starts to become exceptionally long, that you should split it into multiple smaller methods. If you give your methods good identificrs, this can reduce the need for extensive comments. Challenges: Although it is not required of you to do so, you may want to see if you can implement one or more of the following features: • Keep a record of a player's quickest trip across the desert while winning or losing • Keep a record of a player's longest trip across the desert while winning or losing. • Allow your Camel to die and force the player to continue walking • Give points after winning the game for resources still available • Add additional random events that can occur in certain situations that add additional options to the possible actions a player can take in the menu. • Add in some form of mini-game that the player occasionally must engage in such as being able to fight off the pursuers if they get too close to avoid losing the game. Page 8 of 8 CSCI 160 Spring 2022 proj02 Project Assignment 2 Instructions Sample Output: Welcome to Lasart Escape! Please select a difficulty: 21 Normal 31 Hard 41 Cha.lenging Please enter a selection 1 - 1:5 Na Vau! Please enter a selection 1 - 4: No Please enter a suluetion 1 - 1:2 what type of camel would you like to use: 1) Standard 21 Random 31 Cuetom please enter a selection 1 - 3 Please enter a name for your camel: Superbod Please enter an imtind thirst level for the nel with 1 bring extremely thisty. Please enter a selection 1 - 13: 15 Please enter an initial hunger love for the catel with 1 bcing extremely hungry. Please enter a selection 1 - 13: 9 Please enter an initial energy love for the camel with 1 being extremely tired Please enter a selection 1 - 19: 12 What type of rider would yo
2:39 AM Mon Mar 21 1942% 64 0...t-1-prod-fleet01-xythos.content.blackboardcdn.com CSCI 160 Spring 2022 proj02 Project Assignment 2 Instructions Sample Output: Welcome to Desert Escape! Please select difficulty: 11 Easy 21 Noul 31 Hard 11 Chalenging Please enter a selection 1 - 4: 5 Please enter a selection 1 - 4: No You! Please enter a selection 1 - 4: 2 What type of cemel would you like to use: 1) Standard 21 Random 3) Custom Please enter a aelection 1 -3: 3 i Please enter a name for your camel: Superboh Please enter an initial thirst leve for the cartel with 1 being extremely thivaty. Please enter a selection 1 - 15: 15 Please enter an initial funger leve for the catel with 1 being extremely hungry. Please enter a selection l - 15: 9 Please enter an initial energy level for the camel with 1 being extremely tired Please enter a selection 1 - 15: 12 What type of rider would you like to use: 11 Standard 21 Random 31 Custom Please enter a solnation 1 - 3 2 Please enter your name: Steve After a long night's ride you have escaped the city with the sacred Macguffin and rede out inco the desert By now the royal guards have set after you in pursuit. You must scape across the desert. Distance Travele: 20 Pursuer Distance: Your pursues are more than a Day: 1 day's ride away Time: Morning Rider Statuoi Loudien: Desert Plains We Lher: War Camo Status Thirst: Kell Hydratec Hungariantinted Energy: Fes. Thirst: Quenched Fungar: Sattad Energy: Inv.eated What would you like to do: 11 Best 21 Search for Food 31 Search For Water 4) Travel Carefully 5) Travel Regularly 61 Ride Hard Please enler a selecLion 1 - 6: 5 Your path is obstructed and you must spend some time clearing it Yeu travel throughout the Morning and cover 12 miles. Distance Traveled 32 Purauer Distance: Your pursuere are more than a Day: 1 day's ride away. Time: Afternoon Rider Status Location: Desert Pains Weather: Narm Came: Status: Thirst: Parched Hunger: Eurysy Energy: Fresh Thirst: Ouenahad Alger: Satiated Energy: Fresh What would you like to do: 11 Reet 21 Search Ear Fond 31 Search for Nater 41 Travel Carefully 51 Travel Regularly 6) Ride Hari Please enter a selection 1 - 6: 5 Yeu travel throughout the Afternoon and cover 11 milee. Distance Travel 43 Purduet Dive: Your pursue are more Lus!! Day: 1 day's ride away. Time: Evening Rider Status: Location: Desert Pleine Weather: Warm Camel Statan: Thirst: Parched Hungar: Hungry nepared Thirst. Wel Hydrated Hunger மோட Enern. Fresh
2:39 AM Mon Mar 21 1942% C4 0...t-1-prod-fleet01-xythos.content.blackboardcdn.com Distance Teravell: 43 Pursuer Distance: Your pursuey are more than 4 Day: 1 day's ride away. Time: Evening Rider Status: Location: Desert Pleiny Westher: Warm Camel Status: Thirst: Parched Hungar: Hurgy Energy: Tired Thirst: Wel. Hydrated Hunger: Hungry Energy: Fresh What would you like to do: 1) Rat 21 Search for Food 31 Search for Nater 4) Traval Carefully 51 Tiavel Regularly 61 Ride Hard Please enter a selection 1 - 6: 3 You are unable to find any water Day: 1 : Distance Traveler: Pursuer Distance: Your pursus are more than a day's ride away. Time: Night Rider Status: Location: Desert Hills Weather: Raining : Came Status Thirst: Parched Hunger: Hungry Energy: Tired Thirst: Wel lydrated Hunger: Hungry Energy: Fresh What would you like to do: 11 Kast 21 Search for Food 31 Sarah for water 41 Travel Carefully 5) Travel Engularly 61 Eide Hard Please enter a selection 1 - 6: 1 You decide to rest for the remainder of the Night. The rain makes it more difficult for you to sleep, but you are alle tu collect sone wawer for you and your camel Distance Traveled: 43 Pursuer Distance: Your pursuers are more than a Day: 2 day's ride away. Time: Morning Rider Slal. Werther: Cloudy Loca-ion BV Rank Came- Slals: Thirst: Parched Hunger: Hungry Energy: Fresh Thirst: Quenched HungerSatiated Energy: Fresh What would you like to do: 11 Fest 2) Sedro Cuc Foud 31 Search for water 41 Travel Cacefully 5) Travel Bagularly 61 Ride Claud Please enter a selection 1 - 6: 6 Your camel -e able to make good proguese due to the cooler weather. Your camel fells tired from the strenuous pace and pauses to take a break. You travel at a breakneck pace throughout the Morning and cover 22 miles. Distance traveled: 65 Pursuer Distance: Your pursuere are more than a Day: 2 day's ride away. Time: Afternoon Rider Status: Location: Desert Plains Weather: Extremely Hot Came- Status: Thirst: Parched Hunger: Starving Energy: rcah Thirst: Wall Hydrated Funger: Hurley tinergy: tresh What would you like to do: 11 Reat 2) Search for Food 31 Search tor Water 11 Travel Carefully 51 Travol Regularly 6) Rice and Please enter a selection 1 - 6: 2 Yeu spend the Afternoon searching for food. The axtreme hest of the day heats down upon you during your search. You are unable to find anythng to eat.
2:40 AM Mon Mar 21 1943% E E 0...t-1-prod-fleet01-xythos.content.blackboardcdn.com Distance Travel Pursuer Distance: Your pus are more than a Day: 2 day's ride away. Time: Evening Rider Status: Locatie: ver Dank Camel Status: Wether: Warm Thirst: Very Thirsty Hungar: Starving Energy: Tired Thirst: Wel. Hydrated Funger: Hungry Energy: Fresh What would you like to do: 1) Rust 21 Search for Food 31 Search E Nater 4) Travel Carefully 5: Travel Regularly 61 Ride Hard Please enter a selection 1 - 6: 2 You spend the Boring searching for food. Yeu find some food amidst the desert plants. Distance Traveled ES Purauer Distance: Your pursues are more than a Day: 2 day's ride away. Time: Night Rider Status: Location: Desert Plains Weather: Warm Came Status: Thirst: Vary Thirsty Hunger: Satiated Energy: Tired Thirst: Wal Hydratan Funger: Satiated Energy: Fresh What would you like to do: 11 Reet 21 Saarah Ear Fond 3: Search for Water 4) Travel Carefully 51 Travel Regularly 6) Ride Hard Please enter a selection 1 - 6: 3 You are unat:le tu find any water Distance Travele: 85 Pureuer Distance: Your pursues are more than a Day: 3 day's ride away. Time: Morning Rider Status: Weather: Nam Locacion: Oasis Came Status: Thirst: Very Thirsty Hungar: Satiated Energy: Tired Thirst: WelHydrated Hunger: Satiated Energy: Treen What would you ll ke to do: 1) Rest 2) Search for Food 3: Search Eur Naber 41 Travel Carefully 5) Travel Regularly 6) Ride Hard Please enter a selection 1 - 6: 3 You find plenty of water for you and your camel at the Oasis Distance Traveles: Pursuci Distance: Your pursuers are within a Day: 3 day's ride of you. Time: Afternoon Rider Status: Location: Desert Hills Came Statu! File: thự:: MIUI Thirsl: Well Hydraled Hungar: Satiated Enegy: Tized Thirsl: Quenched Fungar: Sotated Energy: Tiesl. What would you like to do: 11 Rant 21 Search for Food 31 Snaruh Ent Water 4) Travel Cazefully 51 Travel Regularly 61 Rice Hard Please enter a selection 1 - 6: 5 You travel throughout the Afternoon and cover 14 miles. Distance Traveled 79 Pursuer Distance: Your pursuers are more than a Day: 3 day's Lue away Time: Evening Bider sasi 1.00,-ion: DocArt Prins KastherYamo w Hos Camel
2:40 AM Mon Mar 21 1943% E Content X Bb projo2 Instructions.docx x + X → C © ...t-1-prod-fleet01-xythos.content.blackboardcdn.com G Please enter a selection 1 - 6: 5 You travel throughout the Afternoon and cover 14 miles. Distance Traveled: 79 Pursuer Distance: Your PSURYS are more than Day: day's ride away Time: Evening Rider Status: Location: Desert Plains Weather: Extremely Hot Came- Status: Thirst: Well flydrated Hunger: Hungry Energy: Tirad Thirst: Quenched Hengeri Satiated Energy: Tresh WhaL would you like Lo do: 1) Fast 2: Search for Food 3) Sarah for water 11 Travel Carefully 5) Travel Rngularly 61 Eide laud Please enter animation 1 - 6:4 During your travels you are able to capture a sall animal for you to eat. You travel slowly and carefully throughout the Evening and cover 3 miles. Distance Traveled: a 2 Purguet Distance: Your purus are more than a Day: day's ride away. Time: Night Rider Stat! Weather: Warm Location: Ruins CameStatus: Thirst: kell Hydrated Hunger: Hungry Energy: Tired Thirst: Quenched Hunger: Hungry Energy: Fresh What would you like to do: 1) Reet 21 Search tor Food 31 Search Cus Male 4) Travel Carefully 5) Travel Buyularly 6) Rice Hard Please enter a selection 16: 1 You decide to rest for the remainder of the Night. You sleep eoundly under the staza. Distance Traveled: 32 Puraver Distance: Your pursues are within a Day: 4 day's ride of you. Time: Morning Rider Status: Weather Warm Location: Ruins Came Status: Thirst: Well Hydrated llung: Ilungay Energy: Fresh Thirst: Oucnahad Ilunger: Saliated Finargy: Tv Graced What would you like to do: 11 Reet 21 Sarah En Fond 31 Search for Nater 4) Travel Carefully 5) Travel Negularly 6) Ride Hand Please enter a selection 1 - 6: [...] Page 8 of 8
2:41 AM Mon Mar 21 1943% ...t-1-prod-fleet01-xythos.content.blackboardcdn.com Camel Class API Methods: Identifier: getThirst Parameters: Return Value: int - The level of thirst of the Camel Other: Identifier: adjustThirst(int value) Parameters: value - Increase the thirst by value amount (Note: value can be negative to reduce thirst) Return Value: Other: The method should adjust the thirst of the camel based on the input value, but should prevent it from going outside of the correct bounds. Identifier: getEnergy Parameters: Return Value: int - The level of energy of the Camel Other: Identifier: adjustEnergy(int value) Parameters: Value - Increase the energy by value amount (Note: value can be negative to reduce energy) Return Value: Other: The method should adjust the energy of the camel based on the input value, but should prevent it from going outside of the correct bounds. Identifier: getHunger() Parameters: Return Value: int - The level of hunger of the Camel Other: Identifier: adjustHunger(int value) Parameters: Value - Increase the hunger by value amount (Note: value can be negative to reduce hunger) Return Value: Other: The method should adjust the energy of the camel based on the input value, but should prevent it from going outside of the correct bounds. Constructor Methods: Identifier: Camel(String name) Parameters: name - A String representing the name of this Camel Return Valuc: Other: Hunger, thirst, and energy should be set to random values Identifier: Parameters: Camel(String name, int thirst, int hunger, int energy) name - A String representing the name of this Camel thirst - An int representing the initial thirst of the Camel hunger - An intrepresenting the initial mnger of the Camel
2:41 AM Mon Mar 21 1944% E Content х Bb proj02 Instructions.docx X Bb Camel API.docx x + < C ...t-1-prod-fleet01-xythos.content.blackboardcdn.com Camel Class API Methods: Identifier: getThirst) Parameters: Return Value: int - The level of thirst of the Camel Other: Identifier: adjust'Thirst(int value) Parameters: value - Increase the thirst by value amount (Note: value can be negative to reduce thirst) Return Value: Other: The method should adjust the thirst of the camel based on the input value, but should prevent it from going outside of the correct bounds. Identifier: getEnergy Parameters: Return Value: int - The level of energy of the Camel Other: Identifier: adjustEnergy(int value) Parameters: value - Increase the energy by value amount (Note: value can be negative to reduce energy) Return value: Other: The method should adjust the energy of the camel based on the input value, but should prevent it from going outside of the correct bounds. Identifier getHunger() Parameters: Return Value: int - The level of hunger of the Camel Other: Identifier: adjustHunger(int value) Parameters: value - Incrcasc thc hunger by value amount (Note: valuc can be negative to reduce hunger) Return Value: Other: The method should adjust the energy of the camel based on the input value, but should prevent it from going outside of the correct bounds. Constructor Methods: Identifier: Camel(String name) Parameters: name - A String representing the name of this Camel Return Value: Other: Hunger, thirst, and energy should be set to random values Identifier: Camel(String name, int thirst, int hunger, int energy) Parameters: name - A String representing the name of this Camel thirst An int representing the initial thirst of the Camel hunger - An int representing the initial hunger of the Camel energy - An int representing the initial energy of the Camel Return Value: : Other:
2:42 AM Mon Mar 21 19.45% 4 C4 Content х Bb proj02 Instruction X Bb Camel API.docx х X Bb Rider API.docx х + A → c o ...t-1-prod-fleet01-xythos.content.blackboardcdn.com ... Rider Class API Methods: Identifier: getThirst() Parameters: Return Value: int - The level of thirst of the Rider Other: Identifier adjustThirst(int value) Parameters: Value - Increase the thirst by value amount (Note: value can be negative to reduce thirst) Return Value: Other: The method should adjust the thirst of the rider based on the input value, but should prevent it from going outside of the correct value. Identifier: getEnergy Parameters: Return Value: int - The level of energy of the Rider Other: Identifier: adjustEnergy int value) Parameters: value - Increase the energy by value amount (Note: value can be negative to reduce energy) Return Value: Other: The method should adjust the energy of the rider based on the input value, but should prevent it from going outside of the correct value. Identifier: get Hunger) Parameters: Return Value: int -The level of hunger of the Rider Other: Identifier: adjustHunger(int value) Parameters: Value - Increase the hunger by valve amount (Note: value can be negative to reduce hunger) Return value: Other: The method should adjust the hunger of the rider based on the input value, but should prevent it from going outside of the correct value. Constructor Methods: : Identifier: : Rider(String name) Parameters: name - A String representing the name of this Rider Return Value: Other: Hunger, thirst, and energy should be set to randorn values Identifier: Rider(String name, int thirst, int hunger, int energy) Parameters: name - A String representing the name of this Rider thirst - An int representing the initial thirst of the Rider hunger - An int representing the initial hunger of the Rider energy - An int representing the initial energy of the Rider Return Value: Other: Open in...
2:42 AM Mon Mar 21 19 45% C4 Conten Bb projo2 Instructi X X Bb Camel API.docx Bb Rider API.docx X Bb DescriptionHel X + A с o ...t-1-prod-fleet01-xythos.content.blackboardcdn.com DescriptionHelper API Static Methods: Identifier: getThirstDescription Camel camel) Parameters: camel - The camel that should have its thirst described Retum Value: String - A text description of the thirst level Other: This static method returns different strings of text when the thirst level is in certain ranges. For example, when the thirst level is between 2 and 5, the string "Thirsty is returned. Identifier: getHungerDescription(Carnel camel) Parameters: camel - The camel that should have its energy described Retum Value: String - A text description of the hunger level Other: This static method returns different strings of text when the hunger level is in certain ranges. For example, when the hunger level is between 2 and 5, the string "Hungry" is returned Identifier: getEnergy Description(Camel camel) Parameters: camel - The camel that should have its energy described Retum Value: String A text description of the energy level Other: This static method returns different strings of text when the enerxy level is in certain ranges. For example, when the energy level is between 2 and 5, the string "Tired" is returned. Identifier: getThirstDescription Rider rider) Parameters: rider - Tbc rider that should have its thirst described Retum Value String - A text description of the thirst level Other: This static method returns different strings of text when the thurst level is in certain amges. For example, when the thirst level is between 2 and 5, the string "Thirsty is returned Identifier: get Hunger Description Rider rider) Parameters: rider - The rider that should have its energy described Retumu Value String A text description of the bunger level Other: This static method return clifferent strings of text when the hunger level is in certain ranges. For example, when the hunger level is between 2 and 5, the string "Hungry is returned Identifier:getEnergy Description Rider rider) : Parameters: camel - The ride tbat should have its energy described Retum Value: String - A text description of the energy level Other: This static method returns different strings of text when the energy level is in certain ranges. For example, when the energy level is helween 2 and 5, the string "Tired" is returned. Identifier: getStatusRider rider) Parameters: rider - The rider that should be described Returi Value String A text description of the rider Other: This static method will return a text description of the given rider using the other static methods of this class to provide textual descriptions for the different Tesources of the rider Identifier: getStatus(Camel camch) Parameters: camel - The camel that should be described Return value: String A text description of the camel Other: This static method will return a text description of the given camel using the crther static methods of this class to provide textual descriptions for the different Tesources of the camel. Constructor methods: This is a helper class composed entirely of static methods, as such, it should include a private default constructor and no alternate constructors. Page 2 of 2
2:42 AM Mon Mar 21 1946% 64 Bb projo2 Bb Camel API.docx Bb Rider API.docx x Bb DescriptionHel X Bb Menu Helper AF X + ...t-1-prod-fleet01-xythos.content.blackboardcdn.com MenuHelper Class API Static Methods: Identifier: displayMenu(String message, int min, int max) Parameters: message - The entire menu text min - The minimum number of numeric responses to allow max - The maximum number of numeric responses to allow Return Value: int - A int representing the option the user selected. Other: The function will display a menu and accept type and value safe input from the user, returning the option the user entered on the keyboard Identifier: getInput(String prompt) Parameters: prompt - The text to show to the user before asking for their input Return Value: String - A String representing the data the user entered after the given prompt. Other: Constructor methods: This is a helper class composed entirely of static methods, as such, it should include a private default constructor and no alternate constructors. Page 1 of 1 Open in...
2:43 AM Mon Mar 21 O. 1946% % ...t-1-prod-fleet01-xythos.content.blackboardcdn.com Game Class API Methods: Identifier: start() Parameters: Return value Other: Executes the game logic. This can be one large method, but it is suggested to create several private methods to accomplish specific tasks. Potential Instance Variables: The sample game includes the following instance variables. You may use these or others. A Camel object reference • A Rider object reference • A double representing a difficulty modifier on all random numbers generated ints for distance traveled, pursuer distance, the distance between the pursuers and the Rider, and the current day • Strings for the time of day, the weather, and the location, , • A Random number generator Recommended Private Methods: Identifier: checkCamelCan Travel Parameters: Return Value: boolean - If the camel is too tired, too hungry, or too thirsty to ride, return false, else return true Other Also displays a message on the screen indicating the status of the camel (if true is returned) Identifier: check RiderlsDeado Parameters: Return Value: boolean - If the rider has starved, dehydrated, or died of exhaustion return true, else return false Also displays a message on the screen indicating the status of the rider (if true is returned) Other: Identifier: getNewLocation Parameters: Return Value: Other: Performs a random calculation (a number between (-14) and changes the location variable depending on the value. 0-1 - Oasis 2-3- Ruins 4-5-River Bank 6-11 - Desert Plains 12-14-Desert Hills Identifier: get New Weather Parameters: Return Value: Other: : Performs a random calculation (a number between 0-9) and changes the weather variable depending on the value. 0 - Sandstorm 1 - Raining 2- Cloudy 3-5 Warm 6-9 Extremely Hot or Warm depending on the time of day Identifier: getNewTimeOfDay) Parameters: Return Value: Other: Cycles through the times of day and changes the time of day variable and day variable as appropriate. Times of Day include Morning, Afternoon, Evening, and Night
2:43 AM Mon Mar 21 1947% % Bb Came Bb Rider API.docx x Bb DescriptionHel X Bb MenuHelper AF X Bb Game API.docx x + < с o ...t-1-prod-fleet01-xythos.content.blackboardcdn.com variable as appropriate Times of Day include Moming, Afternoon, Evening, and Night Identifier: get Pursuc Distance Description() Parameters: Return value: String - a textual description of how far back the pursucrs are. (Rather than just stating the distance) Other: Identifier Dulput Turn Information Parameters: Return value: Other: Displays the information in the current turn the time of day, the current day, the number of miles traveled, the current location (as text), the current weather, and the camel and rider object references Identifier: processTurn) Parameters: Return value: Other: Display a menu of different options available to the player for their current turn and then call the appropriate method responsible for processing that action. This method may also be responsible for ensuring that a player is capable of taking a particular action Identifier: processResto) Parameters: Return value: Other: Performs what happens when a player selects Rest from the menu Identifier: processFood Scarch Parameters Return value: Other Performans wat happens when a player selects Search for Food from the menu Identifier: process Water Search Parameters: Return value: Other: Performs what happens when a player selects Search for water from the menu Identifier: process TravelCarefully Parameters: Return Value: Other: Performs what happens when a player selects Travel Carefully from the menu Identifier: process TravelRegularly Parameters: Return value Other: Performs what happens when a player selects Travel Regularly from the menu Identifier: procenRice Allu Parameters Return value: Other: Performs what happens when a player selects Ride Hard from the menu Identifier: processPursuiers) Parameters: Return Value: Other: Calculate a random distance (4-7), then change the pursuer distance and distance between variables to adjust the fact that the pursuers moved this tum. You may also want to consider using the time of day, weather, or other factors to adjust how far the pursues can move, Potential Constructor Method: Identifier: Gameint difficulty, Camel camel, Rider rider) Parameters: difficulty - The difficulty modifier comel - The initialized camel rider - The initialized rider Return value: Other: Shoull initialize the other instance variables to reasonable values TREUIL
2:44 AM Mon Mar 21 1947% Bb Rider Bb DescriptionHel X Bb MenuHelper AF X Bb Game API.docx X Bb GameSetup AP X + © ...t-1-prod-fleet01-xythos.content.blackboardcdn.com GameSetup Class API Static Methods: Identifier: setup Game Parameters: Return Value: Game - a fully initialized Game object Other: This factory method will display a short introductory text, then ask the user the level of difficulty they would like to play at. It should then ask the user about their choice of camel (see output screen) and call setupCamel using that option as an input argument. Finally, it should ask the user about their choice of rider (see output screen) and call setupRider Identifier: setupCamelint option) Parameters: option - the kind of camel the user wants to create (.e., average camel, random camel, or custom camel) Return Value: Camel - a fully initialized Camel object Other: The function will ask for the name of the camel and create either a default or random camel or create a new camel based on the user's entered requirements, asking for any user input as necessary Identifier: setupRider(int option) Parameters: option - the kind of rider the user wants to create (i.e., average rider, random rider, or custom rider) Return Value: Rider - a fully initialized Rider object Other: The function will ask for the name of the rider and create either a default or random rider or create a new rider based on the user's entered requirements, asking for any user input as necessary. Constructor methods: This is a helper class composed entirely of static methods, as such, it should include a private default constructor and no alternate constructors. Page 1 of 1 Open in...
2:44 AM Mon Mar 21 1947% % Bb Desc Bb MenuHelper AF X Bb Game API.docx X Bb GameSetup AP X Bb Main API.docx X + © ...t-1-prod-fleet01-xythos.content.blackboardcdn.com Main Class API Static Method: Identifier: main(String [] args) Parameters: An (ignored, but required) array of command line arguments Return Value: Other: Assigns a Game object to the result of calling the Game Setup setupGamel) static method, then calls start on the resulting object reference Page 1 of 1 Open in...
2:38 AM Mon Mar 21 1941% 64 Content X Bb proj02 Instructions.docx X + 0 ...t-1-prod-fleet01-xythos.content.blackboardcdn.com CSCI 160 proj02 Due Date: Spring 2022 Project Assignment 2 Instructions Wednesday, March 23, 2022 @ 11:59 PM Lab Objectives: - Use selection and looping based flow control in program design - Practice developing classes and writing methods. Book Material Covered: - Chapter 4 - 7 To complete this assignment: - Check out the proj02 directory from your SVN repository: 2:38 AM Mon Mar 21 1941% 64 Content X Bb proj02 Instructions.docx X + 0 ...t-1-prod-fleet01-xythos.content.blackboardcdn
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am