Пример #1
0
        public Player(Game game, GameplayComponent gameplay)
            : base(game)
        {
            this.gameplay = gameplay;

            DrawOrder = 12;

            animation = defaultAnimation;
        }
Пример #2
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()
        {
            sound = new SoundManager(this);
            Components.Add(sound);

            intro = new IntroScreen(this);
            Components.Add(intro);
            intro.Enabled = true;

            gameplay = new GameplayComponent(this);
            Components.Add(gameplay);

            base.Initialize();
        }
Пример #3
0
        public override void Initialize()
        {
            gameplay = Game.Services.GetService(typeof(GameplayComponent)) as GameplayComponent;
            sounds = Game.Services.GetService(typeof(SoundManager)) as SoundManager;

            base.Initialize();
        }