public EnemyTank(Game1 _game, Texture2D _tankTexture, Vector2 _location, Vector2 _speed, float _rotation, int _strength, int _lives) : base(_game, _tankTexture, _location, _speed, _rotation, 100, Color.Red, _lives) { strength = _strength; targetDirection = DOWN; deathParticles = new ParticleSpray(location, game, player, tankTexture, Color.Gray, 0); }
public StaticTank(Game1 _game, Texture2D _tankTexture, Vector2 _location, Vector2 _speed, float _rotation, int _strength, int _lives) : base(_game, _tankTexture, _location, _speed, _rotation, _strength, _lives) { deathParticles = new ParticleSpray(location, game, player, tankTexture, Color.Green, 0); tankRect = new Rectangle((int)location.X - tankTexture.Width / 2, (int)location.Y - tankTexture.Height / 2, tankTexture.Width, tankTexture.Height); targetDirection = DOWN; spriteFont = game.Content.Load <SpriteFont>("score"); }
public void Respawn(Vector2 _location) { if (!alive) { location = _location; lives = 3; respawnParticles = new ParticleSpray(location, game, player, tankTexture, Color.Blue, 2); alive = true; } }
public virtual void Die() { if (alive) { deathParticles = new ParticleSpray(location, game, player, tankTexture, Color.Green, 2); alive = false; location = new Vector2(-100, -100); updateRectangleLocation(); } }
public KamikazeTank(Game1 _game, Texture2D _tankTexture, Vector2 _location, Vector2 _speed, float _rotation, int _strength, int _lives) : base(_game, _tankTexture, _location, _speed, _rotation, _strength, _lives) { initSpeed = speed; rotation = _rotation; origin = new Vector2(tankTexture.Width / 2f, tankTexture.Height / 2f); respawnParticles = new ParticleSpray(location, game, player, tankTexture, Color.Gray, 0); deathParticles = new ParticleSpray(location, game, player, tankTexture, Color.Gray, 0); tankRect = new Rectangle((int)location.X - tankTexture.Width / 2, (int)location.Y - tankTexture.Height / 2, tankTexture.Width, tankTexture.Height); targetDirection = DOWN; }
public virtual void Hit() { lives -= 1; if (lives < 1) { Die(); } else { hitParticles = new ParticleSpray(location, game, player, tankTexture, Color.Firebrick, 2, 5); } }
public Tank(Game1 _game, Texture2D _tankTexture, Vector2 _location, Vector2 _speed, float _rotation, int _player, Color _color, int _lives) { tankTexture = _tankTexture; location = _location; startingLocation = _location; speed = _speed; rotation = _rotation; origin = new Vector2(tankTexture.Width / 2f, tankTexture.Height / 2f); game = _game; player = _player; scale = 1f; alive = true; lives = _lives; color = _color; respawnParticles = new ParticleSpray(location, game, player, tankTexture, Color.Firebrick, 0); deathParticles = new ParticleSpray(location, game, player, tankTexture, Color.Green, 0); hitParticles = new ParticleSpray(location, game, player, tankTexture, Color.Silver, 0); tankRect = new Rectangle((int)location.X - tankTexture.Width / 2, (int)location.Y - tankTexture.Height / 2, tankTexture.Width, tankTexture.Height); }