Esempio n. 1
0
        //constructor

        /// <summary>
        /// The constructor for the player class
        /// </summary>
        /// <param name="sprite">The sprite of the player</param>
        /// <param name="position">The location and size of the player</param>
        /// <param name="projectileSprite">The sprite of the projectile</param>
        public Player(Texture2D sprite, Rectangle position, Texture2D projectileSprite, Hive hive, EnemyManager enemyManager) : base(sprite, position)
        {
            //arbitrarily assigned number
            health = 100;

            maxX = 0;
            maxY = 0;

            projectiles = new ProjectileManager(hive, enemyManager);

            this.projectileSprite = projectileSprite;

            this.hive = hive;

            score = 0;
        }
Esempio n. 2
0
 //constructors
 public ProjectileManager(Hive hive, EnemyManager enemyManager)
 {
     this.hive         = hive;
     this.enemyManager = enemyManager;
     projectiles       = new List <Projectile>();
 }
Esempio n. 3
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch    = new SpriteBatch(GraphicsDevice);
            arial14        = Content.Load <SpriteFont>("File");
            gill24         = Content.Load <SpriteFont>("Text");
            actualGill24   = Content.Load <SpriteFont>("actualGill24");
            betterTriangle = Content.Load <Texture2D>("betterTriangle");
            square         = Content.Load <Texture2D>("square");
            circle         = Content.Load <Texture2D>("circle1");
            background     = Content.Load <Texture2D>("Assets/Edited Background");
            noRoll         = Content.Load <Texture2D>("Assets/honeycomb");
            roll           = Content.Load <Texture2D>("Assets/honeydrip");
            menuScreens    = Content.Load <Texture2D>("Assets/Beehive");
            instructions   = Content.Load <Texture2D>("Assets/instructions");
            logo           = Content.Load <Texture2D>("Assets/Buzz Battle Logo");
            bullet         = Content.Load <Texture2D>("Assets/Bullet");
            hive           = Content.Load <Texture2D>("Assets/hive");

            //Bee Textures
            beeW  = Content.Load <Texture2D>("Assets/BeeW");
            beeWD = Content.Load <Texture2D>("Assets/BeeWD");
            beeD  = Content.Load <Texture2D>("Assets/BeeD");
            beeDS = Content.Load <Texture2D>("Assets/BeeDS");
            beeS  = Content.Load <Texture2D>("Assets/BeeS");
            beeSA = Content.Load <Texture2D>("Assets/BeeSA");
            beeA  = Content.Load <Texture2D>("Assets/BeeA");
            beeAW = Content.Load <Texture2D>("Assets/BeeAW");

            //Beetle Textures
            beetleUp    = Content.Load <Texture2D>("Assets/Beetle Up");
            beetleRight = Content.Load <Texture2D>("Assets/Beetle Right");
            beetleDown  = Content.Load <Texture2D>("Assets/Beetle Down");
            beetleLeft  = Content.Load <Texture2D>("Assets/Beetle Left");
            // TODO: use this.Content to load your game content here

            homeBase = new Hive(hive, new Rectangle(GraphicsDevice.Viewport.Width / 2 - 50, GraphicsDevice.Viewport.Height / 2 - 50, 100, 100), 100);

            enemyManager = new EnemyManager(
                circle,
                new Rectangle(
                    homeBase.X,
                    homeBase.Y,
                    homeBase.Width,
                    homeBase.Health),
                homeBase,
                GraphicsDevice.Viewport.Width,
                GraphicsDevice.Viewport.Height
                );

            enemyManager.SpawnLocationLeft  = new Rectangle(0, GraphicsDevice.Viewport.Height / 2, 75, 75);
            enemyManager.SpawnLocationRight = new Rectangle(GraphicsDevice.Viewport.Width, GraphicsDevice.Viewport.Height / 2, 75, 75);
            enemyManager.SpawnLocationTop   = new Rectangle(GraphicsDevice.Viewport.Width / 2, 0, 75, 75);
            enemyManager.SpawnLocationBot   = new Rectangle(GraphicsDevice.Viewport.Width / 2, GraphicsDevice.Viewport.Height, 75, 75);

            player      = new Player(beeDS, new Rectangle(50, 50, 75, 75), bullet, homeBase, enemyManager);
            player.MaxX = GraphicsDevice.Viewport.Width;
            player.MaxY = GraphicsDevice.Viewport.Height;

            currentCD = 0;
            fsm       = new FSMLogic(player, homeBase, enemyManager, roll, noRoll);
        }