Game Configuration in C # and XNA

What is the easiest way to read and write game configurations, for example: whether to show fps or play sound, etc.

Maybe there is some class in xna that can be used for this?

I really don't want to use the standard C # XML thingy for an XNA game.

+5
source share
2 answers

Since you mentioned that you might want to connect to xbox, I would recommend using the EasyStorage library . This is what many people use for simple reading / writing.

( ) , , , .. /, / .

+1

. , ? :

public static class Debugging
{
  public static bool ShowFPS = true;
  public static bool PlaySound = false;
}

, . , , - if (Debugging.ShowFPS). , (Debugging.ShowFPS = false;).

, , , XML , :

  • F5,

, , - . . 100% , , ifdef :

    public static class Debugging
    {
#if DEBUG
      public static bool ShowFPS = true;
      public static bool PlaySound = true;
#else
      public static bool ShowFPS = false;
      public static bool PlaySound = false;
#endif
    }

- ; -)

+5
source

All Articles