Ron

Ron

  • NA
  • 5
  • 0

Quick C# Game Question

Jan 17 2010 2:31 AM
Hey everyone.  I'm writing a small drugwars style game in Visual C#, basically just generating random numbers and adding them and subtracting them from the user's cash.  I have a quick question on how to store user variables.  I don't know whether to store the variables for the user's stats in the same class that I write the main functions for opening windows and stuff in, or should I build another class just to store user variables.  I could also inherit the main functions class into my player stats class and have access to my variables and my functions also.  Any help on what more experienced programs would do would be helpful.

Here's what I've got so far:
 namespace DrugWarsBeta4
{
public partial class mainMenu : Form
{
public mainMenu()
{
InitializeComponent();
}

private void mainMenu_Load(object sender, EventArgs e)
{

}

public void pDisplayStats()
{

}

public static int pRandomNumber(int pMin,int pMax)
{
Random pUserNum = new Random();
return pUserNum.Next(pMin,pMax);
}

public void pDisplayBuy()
{
subMenu pBuyScreen = new subMenu();
pBuyScreen.ShowDialog();
}
}

public class pPlayerInfo : mainMenu
{
pPlayerInfo pCurrentPlayer;

public pPlayerInfo()
{
pCurrentPlayer = new pPlayerInfo();
}
}
}
Thanks.


Answers (4)