示例#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()
        {
            rnd           = new Random();
            spriteManager = new GameComponent1(this);
            Components.Add(spriteManager);
            spriteManager.Enabled = false;
            spriteManager.Visible = false;
            this.IsMouseVisible   = true;

            // TODO: Add your initialization logic here

            base.Initialize();
        }
示例#2
0
 public ChasingSprite(Texture2D texture, Point currentFrame, Point frameSize, Point sheetSize, Vector2 speed, Vector2 position, int collisionOffset, SoundEffect sound, GameComponent1 spriteManager)
     : base(texture, currentFrame, frameSize, sheetSize, speed, position, collisionOffset)
 {
     this.sound = sound; this.spriteManager = spriteManager;
 }