public override void Draw(GameTime gameTime, Camera camera) { if (this.Alive) { zombieDrawTextureSheet.DrawCellAtIndex(camera, Location, currentCellIndex); //zombieDefenseTextureSheet.DrawCellAtIndex(camera, Location, currentCellIndex); } }
private void DrawWeaponsEnabled(Camera camera) { Vector2 basepoint = WEAPONS_ENABLED_BASEPOINT; float width = smallWeaponIconsTextureSheet.CellSourceRectangles[0].Width; foreach (HUDWeaponInfo weaponInfo in WeaponsEnabled) { smallWeaponIconsTextureSheet.DrawCellAtIndex(camera, basepoint, weaponInfo.IconCellIndex); switch (weaponInfo.Type) { case HUDWeaponType.Gasoline: Vector2 textLocation = new Vector2(basepoint.X + (width / 2.0f), basepoint.Y - 16.0f); Fonts.DrawTextTopCenterAligned("DebugSpriteFont", Game.SurvivorSubsystem.PlayerOneSurvivorSprite.Ammunition.GasolineTotal.ToString("F0"), camera.SpriteBatch, textLocation, Color.White); break; case HUDWeaponType.Pistol: textLocation = new Vector2(basepoint.X + (width / 2.0f), basepoint.Y - 16.0f); Fonts.DrawTextTopCenterAligned("DebugSpriteFont", Game.SurvivorSubsystem.PlayerOneSurvivorSprite.Ammunition.PistolRoundsTotal.ToString("F0"), camera.SpriteBatch, textLocation, Color.White); break; case HUDWeaponType.Shotgun: textLocation = new Vector2(basepoint.X + (width / 2.0f), basepoint.Y - 16.0f); Fonts.DrawTextTopCenterAligned("DebugSpriteFont", Game.SurvivorSubsystem.PlayerOneSurvivorSprite.Ammunition.ShotgunShellsTotal.ToString("F0"), camera.SpriteBatch, textLocation, Color.White); break; default: break; } basepoint.X += width; } }
private void DrawWeaponsStatusArea(Camera camera) { DrawWeaponsEnabled(camera); weaponIconsTextureSheet.DrawCellAtIndex(camera, WEAPON_ICON_POSITION, WeaponInfo.IconCellIndex); switch (WeaponInfo.Type) { case HUDWeaponType.Gasoline: Fonts.DrawTextTopRightAligned("MediumLEDSpriteFont", Game.SurvivorSubsystem.PlayerOneSurvivorSprite.Ammunition.GasolineCans.ToString("F0"), camera.SpriteBatch, WEAPON_CLIPS_POSITION, Color.White); Fonts.DrawTextTopRightAligned("MediumLEDSpriteFont", Game.SurvivorSubsystem.PlayerOneSurvivorSprite.Ammunition.GasolineInCurrentCan.ToString("F0"), camera.SpriteBatch, WEAPON_ROUNDS_POSITION, Color.White); break; case HUDWeaponType.Pistol: Fonts.DrawTextTopRightAligned("MediumLEDSpriteFont", Game.SurvivorSubsystem.PlayerOneSurvivorSprite.Ammunition.PistolClips.ToString("F0"), camera.SpriteBatch, WEAPON_CLIPS_POSITION, Color.White); Fonts.DrawTextTopRightAligned("MediumLEDSpriteFont", Game.SurvivorSubsystem.PlayerOneSurvivorSprite.Ammunition.PistolRoundsInCurrentClip.ToString("F0"), camera.SpriteBatch, WEAPON_ROUNDS_POSITION, Color.White); break; case HUDWeaponType.Shotgun: Fonts.DrawTextTopRightAligned("MediumLEDSpriteFont", Game.SurvivorSubsystem.PlayerOneSurvivorSprite.Ammunition.ShotgunShellsInBandolier.ToString("F0"), camera.SpriteBatch, WEAPON_CLIPS_POSITION, Color.White); Fonts.DrawTextTopRightAligned("MediumLEDSpriteFont", Game.SurvivorSubsystem.PlayerOneSurvivorSprite.Ammunition.ShotgunShellsInMagazine.ToString("F0"), camera.SpriteBatch, WEAPON_ROUNDS_POSITION, Color.White); break; default: break; } }
private void DrawGameStatusText(Camera camera, String title, String value, Vector2 baseline) { Fonts.DrawTextTopRightAligned("LargeLEDSpriteFont", value, camera.SpriteBatch, baseline, Color.White); Fonts.DrawTextTopRightAligned("HUDLabelSpriteFont", title, camera.SpriteBatch, baseline, Color.White); }
private void DrawSurvivorStatusArea(GameTime gameTime, Camera camera) { staminaBar.Draw(gameTime, camera.SpriteBatch); healthBar.Draw(gameTime, camera.SpriteBatch); }
public void Draw(GameTime gameTime, Camera camera) { camera.SpriteBatch.Draw(pixelTexture, HUD_TOP_BAR_BACKROUND_FRAME, HUD_TOP_BAR_BACKGROUND_COLOR); DrawWeaponsStatusArea(camera); DrawGameStatusArea(camera); DrawSurvivorStatusArea(gameTime, camera); messageQueue.Draw(gameTime, camera.SpriteBatch); }
private void DrawGameStatusArea(Camera camera) { DrawGameStatusText(camera, "Survival Time", SurvivalTimeString, SURVIVAL_TIME_TEXT_POSITION); DrawGameStatusText(camera, "Points", PointsString, POINTS_TEXT_POSITION); DrawGameStatusText(camera, "Kills", ZombieKillsString, ZOMBIE_KILLS_TEXT_POSITION); DrawGameStatusText(camera, "Waves", ZombieWavesString, ZOMBIE_WAVES_TEXT_POSITION); }
public void Draw(GameTime gameTime, Camera camera) { switch (collectableEntityType) { case CollectableEntityType.Gasoline: gasolineCollectableTextureSheet.DrawCellAtIndex(camera, Location, 0); break; case CollectableEntityType.Health: healthCollectableTextureSheet.DrawCellAtIndex(camera, Location, 0); break; case CollectableEntityType.PistolAmmo: pistolAmmoCollectableTextureSheet.DrawCellAtIndex(camera, Location, 0); break; case CollectableEntityType.ShotgunAmmo: shotgunAmmoCollectableTextureSheet.DrawCellAtIndex(camera, Location, 0); break; case CollectableEntityType.Energy: energyCollectableTextureSheet.DrawCellAtIndex(camera, Location, 0); break; default: break; } }
public DrawingManager(Game game, GraphicsDevice graphicsDevice) : base(game) { drawableEntities = new List<IDrawableEntity>(); camera = new Camera(graphicsDevice); }
public abstract void Draw(GameTime gameTime, Camera camera);
public void DrawCellAtIndex(Camera camera, Location location, int cellIndex) { DrawCellAtIndex(camera, location, cellIndex, SpriteEffects.None); }
public void DrawCellAtIndex(Camera camera, Vector2 position, int cellIndex) { DrawCellAtIndex(camera, new Location(position, 1.0f, 0.0f), cellIndex); }
public void DrawCellAtIndex(Camera camera, Location location, int cellIndex, SpriteEffects spriteEffects) { camera.SpriteBatch.Draw(this.Texture, location.Position, this.CellSourceRectangles[cellIndex], Color.White, location.Rotation, this.CellOffsets[cellIndex], location.Scale, spriteEffects, 1.0f); }
public override void Draw(GameTime gameTime, Camera camera) { survivorDrawTextureSheet.DrawCellAtIndex(camera, Location, CurrentCellIndex); //ShotgunWeapon.shotgunAttackTextureSheet.DrawCellAtIndex(camera, Location, 0); }