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