示例#1
0
文件: HUD.cs 项目: zeOxx/Perihelion
        /************************************************************************/
        /* 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));
        }
示例#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;
        }
示例#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);
        }
示例#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
        }
示例#5
0
 //private Projectile[] playerBullets;
 public Gameworld(ContentHolder contentHolder, Viewport view)
 {
     initializeGameworld(contentHolder);
     camera = new Camera(view);
     hud = new HUD(contentHolder, camera);
 }
示例#6
0
 protected override void Initialize()
 {
     camera = new Camera(GraphicsDevice.Viewport);
     base.Initialize();
 }
示例#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
        }
示例#8
0
文件: HUD.cs 项目: zeOxx/Perihelion
 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));
 }