public Inventory(TankGame game) : base(game) { heavyShot = 1; scatterShot = 1; missileDropShot = 1; }
static void Main(string[] args) { using (TankGame game = new TankGame()) { game.Run(); } }
public PowerUp(TankGame game, Vector2 pos, String type) : base(game) { this.game = game; this.powerUpPosition = pos; powerUpPic = Game.Content.Load<Texture2D>(@type); }
public PowerUp(TankGame game, Vector2 pos, String type) : base(game) { this.game = game; this.powerUpPosition = pos; powerUpPic = Game.Content.Load <Texture2D>(@type); }
public StartScreen(TankGame game, String type) : base(game) { blink = true; spriteFont = Game.Content.Load <SpriteFont>(@type); addToTitleList(); }
public bool scanTarget() { detectionCircle = new Circle(position, sensorDistance); if (TankGame.CircleRectangleIntersection(detectionCircle, tankCollisionRectangle)) { missile = new Missile(game, new Vector2(tankPosition.X + missileOffset)); Game.Components.Add(missile); target = new TargetLocked(game, new Vector2(tankPosition.X + tankSize.X / 2, tankPosition.Y + tankSize.Y / 2)); target.AutoInitialize(game.GraphicsDevice, game.Content, TankGame.spriteBatch); target.UpdateOrder = 100; target.DrawOrder = 100; target.Visible = true; targetLockedOn = true; } else { targetLockedOn = false; } bulletCollided(); return(targetLockedOn); }
public DetectionWheel(TankGame cGame, Vector2 newPosition, string detectionWheel, float rotationSpeed) : base(cGame) { position = new Vector3(newPosition.X, newPosition.Y, 0); this.detectionWheel = detectionWheel; this.rotationSpeed = rotationSpeed; }
public override void InitializeParticleProperties(DefaultSpriteParticle cParticle) { cParticle.Lifetime = DPSFHelper.RandomNumberBetween(.5f, 1); cParticle.Position = Emitter.PositionData.Position; float randomVelocity = DPSFHelper.RandomNumberBetween(-200, 200); currentRotation += (float)Math.PI / 20; Vector2 rotatedRandomVector = TankGame.rotateVector(new Vector2(randomVelocity, randomVelocity), currentRotation); cParticle.Velocity = new Vector3(rotatedRandomVector.X, rotatedRandomVector.Y, 0); cParticle.Width = DPSFHelper.RandomNumberBetween(2, 6); cParticle.Height = DPSFHelper.RandomNumberBetween(2, 12); cParticle.Rotation = currentRotation; //Vector3 sVelocityMin = new Vector3(-100, 25, -100); //Vector3 sVelocityMax = new Vector3(100, 50, 100); //cParticle.Velocity = DPSFHelper.RandomVectorBetweenTwoVectors(sVelocityMin, sVelocityMax); //cParticle.Velocity = Vector3.Transform(cParticle.Velocity, Emitter.OrientationData.Orientation); cParticle.StartColor = startColor; cParticle.EndColor = endColor; }
public StartScreen(TankGame game, String type) : base(game) { blink = true; spriteFont = Game.Content.Load<SpriteFont>(@type); addToTitleList(); }
public SmokeCloud(TankGame cGame, Vector2 newPosition, int maxParticles, int particlesPerSecond, Color cloudColor) : base(cGame) { position = new Vector3(newPosition.X, newPosition.Y, 0); this.maxParticles = maxParticles; this.particlesPerSecond = particlesPerSecond; this.cloudColor = cloudColor; }
public void UpdateParticleVelocity(DPSFDefaultBaseParticle cParticle, float fElapsedTimeInSeconds) { currentRotation += (float)Math.PI / 4; Vector2 rotatedRandomVector = TankGame.rotateVector(originalVector, currentRotation); cParticle.Velocity = new Vector3(rotatedRandomVector.X * 800, rotatedRandomVector.Y * 800, 0); }
public Puff(TankGame cGame, Vector2 newPosition, Vector2 newDirection, float power) : base(cGame) { position = new Vector3(newPosition.X, newPosition.Y, 0); direction = new Vector3(newDirection.X, newDirection.Y, 0); this.power = power; maxParticles = (int)power; }
public Spark(TankGame cGame, Vector2 position, int maxParticles, float lifeTime) : base(cGame) { offsetX = DPSFHelper.RandomNumberBetween(-20, 20); offsetY = DPSFHelper.RandomNumberBetween(-20, 20); this.position = new Vector3(position.X + offsetX, position.Y + offsetY, 0); this.maxParticles = maxParticles; this.lifeTime = lifeTime; }
public Bullet(TankGame game, Vector2 bulletPosition) : base(game) { this.position = bulletPosition; this.type = BulletType.BasicBullet; damage = 50; mass = 1.0f; angle = 0; speed = Vector2.Zero; }
public Shots(TankGame game, Vector2 bulletPosition, Vector2 scatterDirection) : base(game) { this.position = bulletPosition; this.type = BulletType.ScatterShot; damage = 20; mass = .75f; angle = 0; speed = scatterDirection; }
public HeavyShot(TankGame game, Vector2 bulletPosition) : base(game) { this.position = bulletPosition; this.type = BulletType.HeavyShot; damage = 75; mass = 2.0f; angle = 0; speed = Vector2.Zero; }
public Missle(TankGame game, Vector2 bulletPosition) : base(game) { this.position = new Vector2(bulletPosition.X, 0); this.type = BulletType.Missile; damage = 60; mass = 1.0f; angle = 0; speed = Vector2.Zero; }
public MissleDrop(TankGame game, Vector2 bulletPosition) : base(game) { Bullet basic = new Bullet(game); this.position = bulletPosition; this.type = BulletType.MissileDrop; damage = 20; mass = 1.0f; angle = 0; speed = Vector2.Zero; }
public MissileDrop(TankGame game, Vector2 bulletPosition) : base(game) { this.game = game; this.position = bulletPosition; this.type = BulletType.MissileDrop; damage = 10; mass = 1.0f; angle = 0; speed = Vector2.Zero; detect = new List <DetectionWheel>(); }
public MissileDrop(TankGame game, Vector2 bulletPosition) : base(game) { this.game = game; this.position = bulletPosition; this.type = BulletType.MissileDrop; damage = 10; mass = 1.0f; angle = 0; speed = Vector2.Zero; detect = new List<DetectionWheel>(); }
public TeleportShot(TankGame game, Vector2 bulletPosition) : base(game) { this.position = bulletPosition; this.type = BulletType.TeleportShot; damage = 10; mass = 1.0f; angle = 0; speed = Vector2.Zero; trail = new TeleportTrail(game, this.position); trail.AutoInitialize(game.GraphicsDevice, game.Content, TankGame.spriteBatch); trail.UpdateOrder = 100; trail.DrawOrder = 100; trail.Visible = true; }
public override void InitializeParticleProperties(DefaultSpriteParticle cParticle) { cParticle.Lifetime = DPSFHelper.RandomNumberBetween(.1f, lifeTime / 2); cParticle.Position = Emitter.PositionData.Position; currentRotation += (float)Math.PI / 10; Vector2 rotatedRandomVector = TankGame.rotateVector(originalVector, currentRotation); cParticle.Velocity = new Vector3(rotatedRandomVector.X * 60, rotatedRandomVector.Y * 60, 0); cParticle.Size = DPSFHelper.RandomNumberBetween(1, 4); cParticle.Rotation = currentRotation; cParticle.StartColor = Color.Yellow; cParticle.EndColor = Color.Red; cParticle.Friction = DPSFHelper.RandomNumberBetween(50, 200); }
public ScatterShot(TankGame game, Vector2 bulletPosition) : base(game) { Bullet basic = new Bullet(game); this.position = bulletPosition; this.type = BulletType.ScatterShot; angle = 0; scatterAngle = 0; damage = 20; mass = .75f; bulletDirection = new Vector2(1, 0); speed = Vector2.Zero; scatterShots = new List<Shots>(); }
public Tank(TankGame game, Vector2 tankPosition, float turretAngle) : base(game) { this.game = game; this.tankPosition = tankPosition; turretPosition = new Vector2(tankPosition.X + 40, tankPosition.Y + 25); this.turretAngle = turretAngle; health = 200; turnTime = 0; moveLimit = 0; originalTurretDirection = new Vector2(0, 1); turretDirection = new Vector2((float)(Math.Cos(-turretAngle) * originalTurretDirection.X - Math.Sin(-turretAngle) * originalTurretDirection.Y), (float)(Math.Sin(-turretAngle) * originalTurretDirection.X + Math.Cos(-turretAngle) * originalTurretDirection.Y)); bullet = new Bullet(game); type = BulletType.BasicBullet; inventory = new Inventory(game); damageClouds = null; timer = 0.0f; currentTankState = TankState.Normal; }
public ScatterShot(TankGame game, Vector2 bulletPosition) : base(game) { Bullet basic = new Bullet(game); this.position = bulletPosition; this.type = BulletType.ScatterShot; angle = 0; scatterAngle = 0; damage = 20; mass = .75f; bulletDirection = new Vector2(1, 0); speed = Vector2.Zero; scatterShots = new List <Shots>(); }
public Fireworks(TankGame cGame, Vector2 position) : base(cGame) { this.position = new Vector3(position.X, position.Y, 0); switch ((int)DPSFHelper.RandomNumberBetween(0, 3)) { case 0: startColor = Color.Yellow; endColor = Color.DarkRed; break; case 1: startColor = Color.LightCyan; endColor = Color.Green; break; case 2: startColor = Color.LightBlue; endColor = Color.DarkBlue; break; } }
public void scatter() { if (scatterTime >= 1) { damage = 10; for (int i = 0; i < 8; i++) { scatterDirection = TankGame.rotateVector(bulletDirection, scatterAngle); scatterShots.Add(new Shots((TankGame)Game, this.position, scatterDirection * new Vector2(TankGame.GRAVITY * 10 + .25f, -TankGame.GRAVITY * 10 - .25f))); scatterAngle += (float)Math.PI / 7; Game.Components.Add(scatterShots[i]); } if (position.Y < 200) { speed = new Vector2(0, TankGame.GRAVITY * mass * 40); } else if (position.Y < 800) { speed = new Vector2(0, TankGame.GRAVITY * mass * 20); } else { speed = Vector2.Zero; } scattered = true; bulletCollided(); } }
public MoveHintScreen(TankGame game) : base(game) { }
public GameOverScreen(TankGame game) : base(game) { this.game = game; }
public ScreenManager(TankGame game) : base(game) { }
public ShootHintScreen(TankGame game) : base(game) { }
public ConfettiDrop(TankGame cGame, Vector2 position) : base(cGame) { this.position = new Vector3(position.X, position.Y, 0); }
public Bullet(TankGame game) : base(game) { type = BulletType.NullBullet; }
public DirtTrail(TankGame cGame, Vector2 newPosition, Vector2 newDirection) : base(cGame) { position = new Vector3(newPosition.X, newPosition.Y, 0); direction = new Vector3(newDirection.X, newDirection.Y, 0); }
public TeleportBlast(TankGame cGame, Vector2 newPosition) : base(cGame) { position = new Vector3(newPosition.X, newPosition.Y, 0); }
public Tanksplosion(TankGame cGame, Vector2 position) : base(cGame) { this.position = new Vector3(position.X, position.Y, 0); }
public PowerUpHint(TankGame game) : base(game) { }
public HealthPack(TankGame game, SpriteBatch batch) : base(game) { batcher = batch; healthPackImage = Game.Content.Load <Texture2D>(@"Images/HealthPackTexture"); }
public TeleportTrail(TankGame cGame, Vector2 position) : base(cGame) { this.position = new Vector3(position.X, position.Y, 0); }
public BasicBlast(TankGame cGame, Vector2 position) : base(cGame) { this.position = new Vector3(position.X, position.Y, 0); }
public Background(TankGame game) : base(game) { this.game = game; }
public PowerUpManager(TankGame game) : base(game) { this.game = game; }
public Flare(TankGame cGame, Vector2 newPosition) : base(cGame) { position = new Vector3(newPosition.X, newPosition.Y, 0); }
/// <summary> /// Constructor /// </summary> /// <param name="cGame">Handle to the Game object being used. Pass in null for this /// parameter if not using a Game object.</param> public BasicParticleSystem(TankGame cGame) : base(cGame) { }