Question: Using Java to program the following, The player selects from a difficulty level, with the corresponding specifications for each level as follows: Easy Highway length:

Using Java to program the following,

The player selects from a difficulty level, with the corresponding specifications for each level as follows:

Easy

Highway length: randomly selected between 10 and 15

Max fuel for vehicle of choice: 100%

Number of obstacles across three lanes of highway: 12

Moderate

Highway length: randomly selected between 15 and 30

Max fuel for vehicle of choice: 80%

Number of obstacles across three lanes of highway: 24

Hard

Highway length: randomly selected between 30 and 50

Max fuel for vehicle of choice: 50%

Number of obstacles across three lanes of highway: 45

The player is then provided with an option to select their escape vehicle

Once the player has selected their choice of vehicle they are informed of the length of the highway and the current fuel present in their vehicle.

The game will then only show at the most 10 sections of the highway to the player at any point in time

The player begins the game randomly placed on any lane of the highway in the first section. The player can be represented using the character '@'

The player is given the following options they can perform:

Move forward

This option allows the player to move forward one section on the highway. This move is always in the same lane and costs 1 fuel point.

Swerve up

This option allows the player to move forward one section on the highway. However, this move allows the player to change to the lane above their current lane. This move is only applicable if the player is not in the topmost lane of the highway. This move costs 2 fuel points.

Swerve down

This option allows the player to move forward one section on the highway. However, this move allows the player to change to the lane below their current lane. This move is only applicable if the player is not in the lowest lane on the highway. This move costs 2 fuel points.

Boost

This option allows the player to move forwardxnumber of sections. Thexis determined based on the vehicle's boost speed. This move costsx* 3 fuel points.

The game should look like the following

The highway should look like the following

Using Java to program the following,The player selects from a difficulty level,

(@ = Player, F = Fuel, B = Road Block, S = Tyre Spike, 0 = Open Manhole) Available Fuel = 99 Damage = 0/30 O Select 1 to move Forward Select 2 to move Swerve Up Select 3 to move Swerve Down Select 4 to move Boost Please choose what to do (@ = Player, F = Fuel, B = Road Block, S = Tyre Spike, 0 = Open Manhole) Available Fuel = 98 Damage = 0/30 B 5 B 0 Select 1 to move Forward Select 2 to move Swerve Up Select 3 to move Swerve Down Select 4 to move Boost Please choose what to do (@ = Player, F = Fuel, B = Road Block, 5 = Tyre Spike, 0 = Open Manhole) Available Fuel = 30 Damage = -20/30 F B S O Select 1 to move Forward Select 2 to move Swerve Up Select 3 to move Swerve Down Select 4 to move Boost Please choose what to do 1 (@ = Player, F = Fuel, B = Road Block, S = Tyre Spike, 0 = Open Manhole) Available Fuel = 29 Damage = -20/30 F B B S Select 1 to move Forward Select 2 to move Swerve Up Select 3 to move Swerve Down Select 4 to move Boost Please choose what to do

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!