コード例 #1
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            levelRenderer = new LevelLibrary.LevelRenderer();

            base.Initialize();
        }
コード例 #2
0
ファイル: Game.cs プロジェクト: surfziggy/flaming-octopus
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            // TODO: Add your initialization logic here
            // Initialize the player class
            player = new Player();
            input = new Input();
            mainbg   = new ParallaxingBackground();
            bgLayer1 = new ParallaxingBackground();
            bgLayer2 = new ParallaxingBackground();
            levelRenderer = new LevelLibrary.LevelRenderer();

            // Camera that follows the player
            camera = new Camera(GraphicsDevice.Viewport, Vector2.Zero);
            camera.Follow(player, 0f);
            hud = new HUDisplay();

            base.Initialize();
        }