Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The original Lemmings video game is a puzzle game where a player can assign skills to Lemming characters in order to help them navigate
The original Lemmings video game is a puzzle game where a player can assign skills to Lemming characters in order to help them navigate through a level. Implement an Enum in Java called Lemming which enumerates the different Lemming skill types from the original Lemmings video game. Include in the enum the speed of each lemming carrying out their respective skill, as follows, Climber-5, Floater-3, Bomber-0, Blocker=0, Builder=2, Basher=4, Miner=3, Digger=1, and a boolean indicating whether or not they are destructive to their environment. Bombers, Bashers, Miners, and Diggers are destructive; the others are not. Provide a suitable toString() method to print information about the enumerated types. Write a Java program to provide a GUI for configuring and starting the game of Lemmings. Use suitable Swing components to allow the player to set the following properties and perform the following operations: 1) Start the game. 2) Choose the game resolution from a list (640 x 480; 1280 x 720; 1920 x 1080; 2560 x 1440) 3) Enter a level code (e.g., CAJJMDLJCL) 4) Game difficulty selection buttons (Fun; Tricky; Taxing; Mayhem) 5) Exit the game. Show the top-level design of the GUI, including any Panels and related Layout Manager objects that you propose to use. For each of the components you have chosen above, write the code to construct the component, add the component to a container, and then set up simple event handling for the component. The event handlers only need to print out a message to indicate that they have been called. Show using a code example how a thread may be created (and started) using an application class that implements the Runnable interface. Include a mechanism in the Runnable class to allow it to be shutdown gracefully (i.e., without needing to call the stop () method). Assume you have a bank account class that may be accessed by more than one thread of execution simultaneously. Show how the various business methods of the class may be made thread safe. Outline the design and code implementation of the Java class for an object that will be used as a buffer to hold a string object. The contents of the String may be written randomly by one or more Producer threads, provided that it has already been consumed by one of a number of Consumer threads. Each value produced must be consumed exactly once and there may be multiple producer and consumer threads executing (and attempting to access the buffer) concurrently.
Step by Step Solution
★★★★★
3.47 Rating (180 Votes )
There are 3 Steps involved in it
Step: 1
ANSWER Part 1 Enum for Lemming skills Heres the implementation of the Lemming enum in Java which includes the skill types their speeds and whether or ...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