Exemplo n.º 1
0
        public static LevelScreen BuildLevelScreen(Game game, Func<Level> createLevel)
        {
            var screen = new LevelScreen();
            var gameState = game.Services.GetService<GameState>();

            gameState.Player = new Player
            {
                WorldPosition = new Vector2(0, 0),
                AttackDamage = 60f,
                AttackRange = 1280
            };

            gameState.Camera.Position = Vector2.Zero;
            gameState.Camera.FocusedAt = gameState.Player;
            gameState.AreControlsEnabled = true;
            gameState.IsGameOver = false;

            gameState.Level = createLevel();

            gameState.Inventory.Set(Items.SmallShield, 10);
            gameState.Inventory.Set(Items.SmallMedkit, 10);

            foreach (var bot in gameState.Player.Nanobots)
            {
                bot.EmitParticle = x => EmitParticle(x, screen.Level);
            }

            return screen;
        }
Exemplo n.º 2
0
 public WindowsInputHandler(Game game, LevelScreen host)
     : base(game)
 {
     _host = host;
 }