Administrator

Administrator

  • Tech Writer
  • 2.2k
  • 1.5m

Storing variables throughout a "session"

Mar 25 2003 7:27 PM
I'm in startup phase of creating a Yatzee game in .NET, using Windows Forms and C#. I apologize for moron-like questions here, but I'm a web programmer.... From what I understand, there is no such thing as a global variables (as in Visual Basic 6.....bas files) in .NET. Am I right? Ok, if this is the case, how would I have to approach the situation in my game where I have to store players scores throughout a game? I suppose I can use the labels in my form, but this just seems like a pain in the butt, because then I have to go through all labels whenever I need to calculate total scores etc. It would be nice to have an array of objects (Player objects) where I store a player's data (name, score, how many choices left, and so on). Can anyone give me a pointer? Thanks so much!

Answers (1)