Jump to content
  • Advertisement
Sign in to follow this  
  • entries
    570
  • comments
    2427
  • views
    217350

Entry #21

Sign in to follow this  
Mushu

103 views

  • Random Observation of the Day!!
    I was reading a book today, and suddenly came to realize that I have been spending way too much time on the computer when I, for an instant, was about to "click" Ctrl-F. Dammit... why can't (paper)books have built-in search features?


Current Work-in-Progress: Medival Lordship! (I want those ++ratings!!!)

/* This code is the sole intellectual property of L "Mushu"
Campbell and may not be used, reused, reprinted, or otherwise
distributed without the explicit consent of the owner.

Other than that, have fun! (it's not done yet) */


#include
#include

using namespace std;

// define all our function prototypes
int opt_Menu(); // display main menu
int intro(); // get all user info
int vars_reset(); // reset variables
int vars_disp(); // display current stats

// set up all the global variables

// TODO: LOAD VARIABLES FROM FILE
int st_gold; // amount of gold you have
int st_keep; // level of your keep
int st_army; // size of your army
int st_pop; // amount of people in your lordship
int st_terr; // amount of territory you control
int st_grain; // how much grain the city has
int st_tax; // the % tax in the country
int st_war; // how likely you are to be attacked
int st_city; // the city rating
int st_turn; // current turn number

int opt_last; // last option
string name; // your name

// main procedure
int main()
{
// get all the information
intro();

// reset the variables
// TODO: LOAD VARIABLES
vars_reset();

// display main menu
opt_Menu();

return 0;

}

// display the main option menu
int opt_Menu()
{
cout << "What would you like to do? \n" << endl;
cout << "0: Exit Program" << endl;
cout << "1: End Turn" << endl;
cout << "2: See Stats" << endl;

cin >> opt_last;

if(opt_last== 2)
{
vars_disp();
opt_Menu();
}

return opt_last;
}

// get all the informations from the user
int intro()
{
// basic introduction
cout << "Welcome to Medival Lordship!" << endl;

// get player info
cout << "\n Enter your name: ";

cin >> name;

// TODO: LOAD PLAYER PROFILE FROM FILE
cout << "\n \n Enter your keep! \n" << endl;

// exit the procedure.
return 0;
}

// display all the statistics for the keep
int vars_disp()
{
cout << "\n";
cout << "STATS: \n" << endl;
cout << "Gold: " << st_gold << endl;
cout << "Population: " << st_pop << endl;
cout << "Grain: " << st_grain << endl;
cout << "\n";

return 0;
}

// reset all the variables! (new game)
// TODO: RANDOMIZE STARTING CONDITIONS!
int vars_reset()
{
st_gold = 500;
st_keep = 0;
st_army = 0;
st_pop = 10;
st_terr = 1;
st_grain = 50;
st_tax = 5;
st_war = 0;
st_city = 0;
st_turn = 0;

return 0;
}

Sign in to follow this  


4 Comments


Recommended Comments

I didn't notice it before but your missing some small peaces in your code,just wanted you to know.
edit: yes I know it's not finished i'm talking about the part you
posted.

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!