Ejemplo n.º 1
0
 public override void Draw(GameTime gameTime, Camera camera)
 {
     if (this.Alive) {
         zombieDrawTextureSheet.DrawCellAtIndex(camera, Location, currentCellIndex);
         //zombieDefenseTextureSheet.DrawCellAtIndex(camera, Location, currentCellIndex);
     }
 }
Ejemplo n.º 2
0
 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;
     }
 }
Ejemplo n.º 3
0
 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;
     }
 }
Ejemplo n.º 4
0
 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);
 }
Ejemplo n.º 5
0
 private void DrawSurvivorStatusArea(GameTime gameTime, Camera camera)
 {
     staminaBar.Draw(gameTime, camera.SpriteBatch);
     healthBar.Draw(gameTime, camera.SpriteBatch);
 }
Ejemplo n.º 6
0
 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);
 }
Ejemplo n.º 7
0
 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);
 }
Ejemplo n.º 8
0
 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);
 }
Ejemplo n.º 10
0
 public abstract void Draw(GameTime gameTime, Camera camera);
Ejemplo n.º 11
0
 public void DrawCellAtIndex(Camera camera, Location location, int cellIndex)
 {
     DrawCellAtIndex(camera, location, cellIndex, SpriteEffects.None);
 }
Ejemplo n.º 12
0
 public void DrawCellAtIndex(Camera camera, Vector2 position, int cellIndex)
 {
     DrawCellAtIndex(camera, new Location(position, 1.0f, 0.0f), cellIndex);
 }
Ejemplo n.º 13
0
 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);
 }