Objects First with Java: A Practical Introduction Using BlueJ (6th Edition)
6th Edition
ISBN: 9780134477367
Author: David J. Barnes, Michael Kolling
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Textbook Question
Chapter 8, Problem 31E
Add a restriction that allows the player to carry items only up to a specified maximum weight. The maximum weight a player can carry is an attribute of the player.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
This simulates a basic dungeon escape with creature encounters.
You must create a simple program that allows the Player to move their character across a map and find the
exit. There will be one BOSS monster trying to catch the player. When the player makes a move (step) the
monster must make 1 step (preferably toward the player).
The player must always start off at location row 0 column 0. The destination is at location row 18 and column
19. The monster starts at row18 column 10. This is summarized in the table below.
Player starting location
Exit (Player destination)
BOSS monster starting location
0
43
18
Please enter a direction w,a,5,6 of Fita odt:
18
Column
0
19
The most basic Al strategy for the monster must be implemented as follows:
The monster makes a move in a random direction each time the player makes a move. Not that the monster must
actually move a step.
If you implement the Al using a recursive solution to track the player, bonus marks will be applied.
10
The file…
Gradient FillIn this labwork are asked to write a GUI application again using AWT. This is a fairly easy labworkthat is more about getting used to synchronized online learning. You are expected to:• Draw two rectangles.• Both of them should be filled using GradientPaint() function of AWT. (Check out itsfunction definition that is listed below.)• The first gradient should be parallel to the diagonal of the first rectangle. The colorgradient should not be repeated (acyclic).• The second gradient should be horizontal. The color gradient should be repeated forthis one (cyclic).• You are free to choose the colors but other than that your output should be similar tothe example screenshot given below.
Super Ghost Project (Please Help me I don't really know and have no idea ) (CODE PLEASE )
Rule changes:
The premise of the game remains the same, there are two players adding words to a growing word fragment. Each player will take turns attempting to add letters to a growing word fragment. The letter you select should attempt to force your opponent to spell a word or create a word fragment that has no possibility of creating a word. Unlike the prior ghost competition, when it is your turn you are allowed to add a letter to either the front or back of the word fragment.
Winning Criteria:
If your opponent spells a word that is at least 6 characters long
if your opponent creates a word fragment that has no possibility of creating a word
if your opponent takes longer than 60 seconds to select a word.
Tip: If you are the first player you can only spell words that are odd length thus you can only lose when you spell words that are odd but you can win when your opponent spells words that are…
Chapter 8 Solutions
Objects First with Java: A Practical Introduction Using BlueJ (6th Edition)
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- show how it is executed and the results.arrow_forwardSuper Ghost Project Rule changes: The premise of the game remains the same, there are two players adding words to a growing word fragment. Each player will take turns attempting to add letters to a growing word fragment. The letter you select should attempt to force your opponent to spell a word or create a word fragment that has no possibility of creating a word. Unlike the prior ghost competition, when it is your turn you are allowed to add a letter to either the front or back of the word fragment. Winning Criteria: If your opponent spells a word that is at least 6 characters long if your opponent creates a word fragment that has no possibility of creating a word if your opponent takes longer than 60 seconds to select a word. Tip: If you are the first player you can only spell words that are odd length thus you can only lose when you spell words that are odd but you can win when your opponent spells words that are even length. Accordingly, if you are the first player you should…arrow_forwardImplement the "Add player" menu option. Prompt the user for a new player's jersey number and rating. Append the values to the two vectors. Ex: Enter a new player's jersey number: 49 Enter the player's rating: 8arrow_forward
- Raccoon Rhapsody is a quest-based game. People who sign up for Raccoon Rhapsody — call them players — have accounts. For each player's account, we keep track of the player's name, address, the date that they joined, a cc# (a valid credit card number we keep on file), and a balance (how much money in Canadian dollars they presently have in their game account). Each player will also have a unique login, which is the account's “name”. It is assumed that a given player will have just one account. A player may create over time any number of avatars. An avatar is an in-game persona. Thus, an avatar belongs to a player (an account). An avatar has a name, gender, look, and skill level. There is a small set of looks available, which may be extended over time; e.g., “wizard”, “faerie”, “footballer”, “shark”, and “raccoon”. The game's virtual word is divided up into a number of realms. On any given day, a player may log in (visit) as one of his or her avatars into one of the realms. (The player…arrow_forwardScenario You work for a small company that creates text-based games. You have been asked to pitch an idea to your team for a text-based adventure game with a theme and environment of your choice. Your game must include different rooms, items, and a villain. The basic gameplay will require the player to move between different rooms to gather all of the items. A player wins the game by collecting all the items before encountering the villain. The player will have two options for commands in the game: moving to a different room, and getting an item from the room they are in. Movement between rooms happens in four simple directions: North, South, East, and West. Directions In this project, you will break the problem down into a set of requirements for your game program. Then you will design your game by creating a storyboard and pseudocode or flowcharts. Remember, in Project One, you are only designing the game. You will actually develop the code for your game in Project Two. Review the…arrow_forwardMake Ice Cream In this challenge activity, you will analyze the numbered steps to make vanilla ice cream and translate them into inputs, actions, and outputs. Instructions to make vanilla ice cream: 1. Stir white sugar, heavy cream, and milk in a saucepan. Heat the mixture using low heat until the sugar is dissolved. Continue to heat until the mixture is hot, and a small ring of foam forms around the edge. 2. Transfer the mixture to a large container. Stir in vanilla extract. Chill the mixture for at least two hours. 3. Pour the cold mixture into an ice cream making machine. Churn the ice cream according to the machine directions. 4. When ready, serve the ice cream. Making Ice Cream Input Action Outputarrow_forward
- implement these five methods and main function: 1. getSize() // return the total number of items stored in the bag. Note: DlkdBag does not have itemCount member variable. 2. addFH() //add anEntry from head 3. addFT() //add anEntry from tail 4. display() // display bag items from head to tail 5. clear() // get rid of the bag, and release all memory used by the bag 6. main() // driver code to test all the methods you've implemented Submission: Put everything into a single file, name it as LastNameFirstInitial_a3.cpp (e.g., if your name is John Doearrow_forwardwhen coding a chess game, implement the following method: isInCheck(Side s): Returns true if the king of side s is attacked by any of the opponent’s pieces, i.e., if in the current board state, any of the opponents pieces can move to where the king is. Otherwise, it returns false. Note that this method is only used to warn the player when they are in check. You can use the GUI to test if this is working. public boolean isInCheck(Side side) { // TODO write this method return false; } public enum Side { BLACK, WHITE; public static Side negate(Side s) { return s == Side.BLACK ? Side.WHITE : Side.BLACK; } }arrow_forwardA digital clock shows hours (between 0 and 23) and minutes (between 0 and 59). Once a minute, it receives a pulse to advance the time. Complete the Clock class, using data members for the hours and minutes.arrow_forward
- Using java card Graphic GUI, create a card game with a card layout in which 13 cards are displayed and if that card has the king of heart, then lose if not the player winsarrow_forwardAssignment using Methods For this exercise, you need to complete all the questions in a single project. You will invoke the methods from your main. Questions 1-6 is due at the end of your next class. Write a method with the following specifications:name: DisplayMenuarguments: nonereturn value: nonetasks: display the following menu choice on the screenCalculation Menu3) Calculate Sum 4) Calculate Sum of Squares5) Calculate Sum of Cubes0) To ExitEnter the number that corresponds to your choice: You may beautify the output to your own likings. You don’t have to implement the functionalities of the various menu choices at this stageCall this method from your main. Modify your main so that the above method is call repeatedly. The program will terminate when the user enters 0. Any other choice should produce an error message. Because you will not be doing any arithmetic you may accept the user response either as an int, or a char or a string. Write a method with the following…arrow_forwardDescription:Create a text based game like some of the following options. Game must have a 2 player, and play againstcomputerideas:Some kind of fill in game similar to a tic tac toe, but not tic tac toeHangman type game but not hangman exactlyA card game (like 31 or high card wins, etc)A question based game similar to Who wants to be amillionaireYour own game you inventedGame must:Keep score while the player continues to play. Start score over when a new game startsShow final score to player and allow player to enter a name if they earn the high score. Name and score mustbe written out to a highscore text file. If the player chooses to see high score the program must read it infrom that file and show the name and score.Offer a main menu showing:1. Rules2. Play Against Computer3. Play 2 Player Game4. See High Score5. QuitThe user must be able to keep playing until they decide to quit. Another menu of options should appear insidethe 1 and 2 player games.The high score must be written out…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Time Complexity Analysis - How To Calculate Running Time | InterviewBit; Author: InterviewBit;https://www.youtube.com/watch?v=--oxG4Q1PA0;License: Standard YouTube License, CC-BY