You are to create an RPG for your programming assignment. This program: needs to
ID: 3657841 • Letter: Y
Question
You are to create an RPG for your programming assignment. This program: needs to use at least one vector needs to use at least one algorithm Allow the player to select their character (3-4) -- you may use the selection below or develop your own characters and weapons. character warrior , priest, mage , peasant item sword , staff , book , pitchfork As game play begins, give the player a game menu: 1) Move, 2)Rest, 3)View Stats, 4)Quit 1) In the Move option, you encounter a random enemy (monster, lizard, bat, dragon, etc -- you can also make up your own enemies) Display information about the encounter -- who do you encounter, how healthy are they, how accurate are they... Display information for your next step: 1)Run Away, 2) Attack 1) Run Away returns to the game menu. 2) Attack you will sustain damage and possibly be attacked Stats will be displayed on both and Run Away/Attack menu will be displayed until you or monster are killed on the attack display encounter - menu for attack, run away, 2) Rest - gains back health points 3) View stats displays player name, weapon, level, strength, health, XP, points until next XP, etc. *****************Explanation / Answer
#include #include using namespace std; // Maximum number of items the player can have const int MAX_ITEMS = 100; bool running = 1; // Allow easy termination of the program int userInput = 0; int playerInfo[2]; // The player can pick 2 options int playerItems[MAX_ITEMS][10]; // The player can equip 1 thing; a weapon int playerEquippedItems[1][10]; int playerHealth = 10; int playerMaxHealth = 10; int playerStrength = 5; int playerAgility = 5; int playerEndurance = 5; string itemNames[] = { "Dagger", "Rope" }; short playerItemCount = 0; // How many items the player has int playerLocation = 0; // A numerical reference to the location of the player bool itemPickedUp2 = 0; // Has the item in area 2 been picked up? // Name ID, Health, Attack, Defense, Agility int enemyStats[][5] = { {0, 5, 2, 0, 4 } }; string enemyNames[] = { "Snake" }; int currentEnemyHealth = 0; void titleFunc(); // Handles the title screen void newGameFunc(); // Handles creating a new game void menuFuncNav(); // Handles the navigation page void menuFuncInfo(); // Handles the stats page void menuFuncItems(); // Handles the items page // This is slightly different to the tutorial; we've used an array instead // of lots of variables int dialogue[5] = { 0 }; void dialogueFunc(int greeting, int topics[5]); // Handles the dialogue system void dialogueTopicDisplayFunc(int topic); // Output a topic void dialogueContentDisplayFunc(int topic); void battleFunc(int enemy); void battlePlayerAttackFunc(int enemy); void battlePlayerFleeFunc(); void battleEnemyAttackFunc(int enemy); void battlePlayerWinFunc(int enemy); void battlePlayerLoseFunc(int enemy); int main() { titleFunc(); while(running) { if(playerLocation == 1) { coutRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.