示例#1
0
 public GameControls(Game game)
     : base(game)
 {
     gameInput = new GameInput();
     CrossControl = new CrossControl(game, gameInput);
     AttackControl = new AttackControl(game, gameInput);
     controls = new List<DrawableGameComponent> {CrossControl, AttackControl};
 }
示例#2
0
        public GameScene(Game game)
            : base(game)
        {
            // Initialize map settings
            camera = new Camera(game, new Rectangle(0, 0, 800, 480)); // TODO: Fix this so it is not hardcoded -> GraphicsDevice is not initialized at this point, need to wrap it somehow (perhaps add it as a service) so the camera will access it later when it's initialized

            MapInformation mapInformation = new MapInformation(Game);
            mapInformation.LoadMapFromXML("test map");
            map = MapGenerator.Generate(mapInformation, camera);

            Font gameTitle = new Font(game, "Generated map", new Vector2(0, 0), Color.Black);

            crossControl = new CrossControl(game);

            // Player
            player = new Player(game, camera);
            SceneComponents.Add(map);
            SceneComponents.Add(gameTitle);
            SceneComponents.Add(player);
            SceneComponents.Add(crossControl);
        }