Example #1
0
 //Constructor
 //The constructor takes an instance of BossAttack so that it can spawn in an instance of the attack when it (the boss) is on screen
 //It takes in an instance of the player so that the BossAttack can be moved to the player's X-value each time it is created
 public Boss(Game game, /* Physics phys,*/ BossAttack bsAttk, Player plyr)
     : base(game)//, phys)
 {
     collidable           = true;
     attack               = bsAttk;
     this.objectRectangle = new Rectangle(50, 50, 100, 150);
     characterAnimation   = new Animation(objectTexture, this);
     this.IsAlive         = true;
     playerInstance       = plyr;
     currentSpriteState   = spriteState.Princess;
 }
Example #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()
        {
            playerInput = new UserInput(this);
            magic       = new Magic(this);
            player      = new Player(this, playerInput, magic);
            bsAttack    = new BossAttack(this);
            boss        = new Boss(this, bsAttack, player);
            gameWorld   = new World(this, player, playerInput, magic, boss);

            // Adds the engine components to the Components List of the Game
            this.Components.Add(playerInput);
            this.Components.Add(gameWorld);
            this.Components.Add(player);
            this.Components.Add(magic);
            this.Components.Add(bsAttack);
            this.Components.Add(boss);

            base.Initialize();
        }