public void Shoot(List<Projectile> projectiles, GameSprite owner) { if (Temperature <= MaxTemperature) { if (GCL.Utilities.GetTimeDifference(timeOfLastShot, true) > 1000 / ShotsPerSecond) { timeOfLastShot = DateTime.Now; Temperature += 5; sound.Play(); Projectile p = new Projectile(new Vector2f(owner.Position.X, owner.Position.Y - owner.Origin.Y), AssetsManager.Textures["projectile"]); projectiles.Add(p); } } }
/// <summary> /// Loads the content of the class /// </summary> protected override void LoadContent() { spriteBatch = new SpriteBatch(GraphicsDevice); proj = new Projectile(imageBullet.Width, imageBullet.Height,x,y,velocity); base.LoadContent(); }
/// <summary> /// Loads the projectile. /// </summary> protected override void LoadContent() { spriteBatch = new SpriteBatch(GraphicsDevice); projectile = new Projectile(imageProjectile.Height, imageProjectile.Width, positionX, positionY, velocity); base.LoadContent(); }