Exemplo n.º 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));
        }
Exemplo n.º 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;
        }
Exemplo n.º 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);
        }
Exemplo n.º 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
        }
Exemplo n.º 5
0
 //private Projectile[] playerBullets;
 public Gameworld(ContentHolder contentHolder, Viewport view)
 {
     initializeGameworld(contentHolder);
     camera = new Camera(view);
     hud = new HUD(contentHolder, camera);
 }
Exemplo n.º 6
0
 protected override void Initialize()
 {
     camera = new Camera(GraphicsDevice.Viewport);
     base.Initialize();
 }
Exemplo n.º 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
        }
Exemplo n.º 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));
 }