Exemple #1
0
        /************************************************************************/
        /* Constructor                                                          */
        /************************************************************************/
        public HUD(ContentHolder contentHolder, Camera camera)
        {
            updateHudPositions(camera);

            healthAuxBar = new Models.Interface(contentHolder.healthAuxBar, healthAuxBarPosition.X, healthAuxBarPosition.Y, new Vector2(0, 0));
            special = new Models.Interface(contentHolder.special, specialPosition.X, specialPosition.Y, new Vector2(0, 0));
        }
Exemple #2
0
        private Controllers.UnitHandler unithandler = new Controllers.UnitHandler(); //WIP - mostly empty

        #endregion Fields

        #region Constructors

        public Gameworld(ContentHolder contentHolder, Viewport view, int levelSize)
        {
            particleSystem = new Controllers.ParticleSystem();
            initializeGameworld(contentHolder);
            camera = new Camera(view);
            hud = new HUD(contentHolder, camera);
            LevelSize = levelSize;
            Debug = false;
        }
Exemple #3
0
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            this.spriteTexture = Content.Load<Texture2D>("texturePlayer");
            this.spritePosition = new Vector2(300, 250);

            this.backgroundTexture = Content.Load<Texture2D>("background");

            camera = new Camera(GraphicsDevice.Viewport);
        }
Exemple #4
0
        /************************************************************************/
        /* Constructor                                                          */
        /************************************************************************/
        public HUD(ContentHolder contentHolder, Camera camera)
        {
            updateHudPositions(camera);

            healthAuxBar = new Models.Interface(contentHolder.healthAuxBar, healthAuxBarPosition.X, healthAuxBarPosition.Y, new Vector2(0, 0), 0);
            special = new Models.Interface(contentHolder.special, specialPosition.X, specialPosition.Y, new Vector2(0, 0), 0);

            ammoFont = contentHolder.creditsFont;
            ammoCounterSpecial = "deo";

            #if DEBUG
            this.debugFont = contentHolder.debugFont;
            #endif
        }
Exemple #5
0
 //private Projectile[] playerBullets;
 public Gameworld(ContentHolder contentHolder, Viewport view)
 {
     initializeGameworld(contentHolder);
     camera = new Camera(view);
     hud = new HUD(contentHolder, camera);
 }
Exemple #6
0
 protected override void Initialize()
 {
     camera = new Camera(GraphicsDevice.Viewport);
     base.Initialize();
 }
Exemple #7
0
        public void updateHudPositions(Camera camera)
        {
            healthAuxBarPosition = new Vector2(-camera.Position.X - (camera.View.Width / 2 - margin),
                                               -camera.Position.Y - (camera.View.Height / 2 - margin));
            specialPosition = new Vector2(-camera.Position.X - (camera.View.Width  / 2 - margin),
                                          -camera.Position.Y +  camera.View.Height / 2 - 42);  // 42 = texture.height + margin
            specialAmmoPosition = new Vector2(specialPosition.X + 35, specialPosition.Y + 5);

            #if DEBUG
            if (displayDebug)
            {
                playerSpeedVector = new Vector2(-camera.Position.X, -camera.Position.Y + 330);
                playerPositionVector = new Vector2(-camera.Position.X, -camera.Position.Y + 300);
                numberOfBulletsVector = new Vector2(-camera.Position.X, -camera.Position.Y + 270);
            }
            #endif
        }
Exemple #8
0
 public void updateHudPositions(Camera camera)
 {
     healthAuxBarPosition = new Vector2(camera.Center.X - (camera.View.Width/2 - 10), camera.Center.Y - (camera.View.Height/2 - 10));
     specialPosition = new Vector2(camera.Center.X - (camera.View.Width/2 -10), camera.Center.Y + (camera.View.Height/2 - 74));
 }