public void TakeDamage() { if (!tempDead) { Sfx.Play.PlayerDeath(); screenClear = new ScreenClear(position, Constants.StandardSize); extraLife--; tempDead = true; } }
public override void Update() { moving = false; if (!tempDead) { PlayerMovement(); BulletManagment(); } else if (tempDead) { MoveToStartPosition(); } if (Constants.HeatValue >= 100) { overheated = true; } else if (Constants.HeatValue <= 0) { overheated = false; } if (overheated) { Constants.HeatValue -= 0.4f; } if (screenClear != null) { if (!screenClear.remove) { screenClear.Update(); } else if (screenClear.remove) { screenClear = null; } } viscinity.Position = position; view.Position = position; view.Rotation = angle - MathHelper.ToRadians(90f); base.Update(); }
public Player(Vector2 position, int size) : base(position, size) { extraLife = 3; tempDead = false; movementSpeed = 5f; fireRate = 15; direction = new Vector2(1, 0); texture = ContentManager.Get <Texture2D>("playerTex"); crosshairTex = ContentManager.Get <Texture2D>("Crosshair"); screenClear = null; bulletList = new List <Bullet>(); removeList = new List <Bullet>(); viscinity = new PointLight(); view = new Spotlight(); viscinity.Scale = new Vector2(750, 750); view.Scale = new Vector2(1000, 1000); view.Intensity = 2f; }