Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Assignment 6 B: Level Map Creator. There are a variety of ways that game developers store their level layouts. One simple method is to associate
Assignment B: Level Map Creator. There are a variety of ways that game developers store
their level layouts. One simple method is to associate level elements with certain symbols, and
then storing them in a D grid inside a text file. We will use our knowledge of D lists to create a
very simple Level Map Creator tool.
The program should prompt the user to enter a width and height for the level. Then it should
initialize a D list and fill every element with the symbol. Afterwards, the user should be
given the following options via a menu:
Clear Level Reinitialize the D list and fill every element with the symbol.
Add Platform Prompt the user to enter a starting point and length for the
horizontal platform. Replace those elements in the D list with the
symbol. If the length is longer than the number of columns or
out of bounds notify the user that this is not possible.
Add Item Prompt the user to enter a column and row index. Replace that
element in the D list with the P symbol. If the column and row
index in outside the bounds of the list, notify the user that this is not
possible.
Quit: End the program
After completing the task, print the modified D list, If anything other than Quit is
selected, display the menu again. Otherwise, tell the player Good bye! and stop.
Hints: Since were using a D list to represent the level map, well use its indexes for our
level coordinates. will be the topleft corner of the map, and will correspond to list
Sample Output #:
FYE Level Map Creator
Enter a level map width:
Enter a level map height:
Options
Clear Level
Add Platform
Add Items
Quit
Enter a choice:
Add Platform
Enter X Coordinate:
Enter Y Coordinate:
Enter Length:
Options
Clear Level
Add Platform
Add Items
Quit
Enter a choice:
Add Item
Enter X Coordinate:
Enter Y Coordinate:
This is not a valid location!
Options
Clear Level
Add Platform
Add Items
Quit
Enter a choice:
Add Item
Enter X Coordinate:
Enter Y Coordinate:
P
Options
Clear Level
Add Platform
Add Items
Quit
Enter a choice:
Add Platform
Enter X Coordinate:
Enter Y Coordinate:
Enter Length:
This platform wont fit in the level!
P
Options
Clear Level
Add Platform
Add Items
Quit
Enter a choice:
Clear Level
Options
Clear Level
Add Platform
Add Items
Quit
Enter a choice:
Goodbye!
Step by Step Solution
There are 3 Steps involved in it
Step: 1
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