[80 points] Write a simple quest based game. I once played a pc game where the player would receive one random quest after another. You would return to the surface and a villager would say "Go to level XX and retrieve the ITEM of DESCRIPTION. Bring this back to me and I will pay you NN gold." I am fairly confident that the level was, your current deepest level +/- 10% and the names of the item and description as well as the reward type were pulled at random from a table. The reward amount was probably randomly generated based on the type of reward.
The game also had a random dungeon level generator. It would generate a level and populate it with bad guys. As you approached the quest item, there would be a boss protecting it.
I would like you to write a simpler version of this game. You should have a quest generator in your world that generates and assigns quests. This should occur when the player approaches the quest generator and has no current quest. The generator should place an item somewhere in the world and instruct the player to find it.
- I would have a table of items (helm, shield, bulldog, ...), a table of attributes (glory, retribution, grossness, ... ) and a table of results (increase health, increase ammo capacity, gold). You could then generate quests like
- Find the helm of glory for 5 gold.
- Find the bulldog of grossness for 5 increased health.
- Find the shield of retribution for 20 gold.
- I would have a table of locations where I could place the item in the world.
- Feel free to use items from a pack you have downloaded. In my game, they probably have to find the pickup truck of happiness or the minivan of great sadness.
- Nothing NSFW however.
To complete the quest, the player must find and touch the item, then return to the quest generator. They will be given the reward and a new quest will be generated.
The player should be able to press Q at any time to toggle a display of the current quest.
As implied in the previous description the player should have the following attributes
- Gold: initially 0.
- Max Health: initially 50.
- Max Ammo: initially 20.
- Quests: initially 0.
The player should be able to press S at any time and the game will pause the game and show their current Statistics. Pressing S again will remove the statistics menu and continue the game.
To make the level more fun, you should add a number of laser traps. A laser trap sits at a location and shines an invisible laser beam into the play area. If a player crosses the beam, they will take some points of damage. You should make the key L toggle the visibility of lasers on and off. In addition make the D key toggle the damage from lasers on and off (so I can grade your game).
Shooting a laser should disable the laser for a random amount of time.
You should have a number of areas where health and ammunition spawn at random. Do not spawn a new health or ammo if the item at the spawn location has not yet been picked up.
You should implement a help menu which displays the various keys described above. Please toggle this menu with the H key.
You should have a HUD that
- Contains a bar on the left hand side of the screen showing health.
- Contains a bar on the right hand side of the screen showing ammo
- Contains a space at the top where the current quest is displayed.
+-------------------------------------+
| Current quest when toggled on |
| - -|
| + +|
| + +|
| + +|
| + +|
| + +|
| + +|
| - -|
| H A|
+-------------------------------------+