Esempio n. 1
0
    private static void Main()
    {
        var config = new ConfigurationBuilder()
                     .AddIniFile("defaultConfig.ini", false)
                     .AddIniFile("config.ini", true, true)
                     .Build();
        var gameSettings = config.GetSection("Game").Get <GameSettings>();

        using var game = new BunnyGame(gameSettings);

        game.Run();
    }
Esempio n. 2
0
 public GameplayModel(BunnyGame game)
     : base(game)
 {
     GameOver           = false;
     this.game          = game;
     KillLimit          = 1000000;
     PlayerList         = new List <Player>();
     BloodParticleList  = new List <BloodParticle>();
     ProjectileList     = new List <Projectile>();
     BlackHoleList      = new List <BlackHole>();
     PlanetList         = new List <Planet>();
     EntityList         = new List <Entity>();
     PhysicalObjectList = new List <PhysicalObject>();
     GravityPointList   = new List <GravityPoint>();
     ExplosionList      = new List <Explosion>();
     collisionEngine    = new CollisionEngine(this);
     updateEngine       = new UpdateEngine(this);
     ScoreBoard         = new Dictionary <Player, Scores>();
     MaxPlayers         = 4;
     RespawnDelay       = 120;
 }
Esempio n. 3
0
        public MenuModel(Game game)
            : base(game)
        {
            this.game = (BunnyGame)game;

            // Create menu (initially main menu)
            Menu      = new TextMenuComponent(game);
            menuState = MenuState.MainMenu;
            Menu.SetMenuItems(mainMenuItems);

            // Set the message to the empty string initially
            Message = "";

            // Initialize content of settings menu
            string resolution = Utility.ResolutionToString(Settings.Resolution);
            string fullScreen;

            if (Settings.FullScreen)
            {
                fullScreen = "On";
            }
            else
            {
                fullScreen = "Off";
            }
            string entityLimit = Settings.EntityLimit.ToString();
            string goreLevel   = Settings.GoreLevel.ToString();

            settingsMenuItems[0] += resolution;
            settingsMenuItems[1] += fullScreen;
            settingsMenuItems[2] += entityLimit;
            settingsMenuItems[3] += goreLevel;



            // Calculate initial aspect ratio:
            aspectRatio = Utility.GetAspectRatio();
        }