public override void Updata() { WeaponSprite.Update(); var tempx = (float)(WeaponSprite.Width * Math.Cos(WeaponSprite.Rotation)); var tempy = (float)(WeaponSprite.Width * Math.Sin(WeaponSprite.Rotation)); _firePosition = WeaponSprite.Position + new Vector2(tempx, tempy); }
public override void Equip(Hero.Hero hero) { var temp = hero.HeroSprite.Center; Vector2 tempPosition = new Vector2(temp.X, temp.Y + 50); WeaponSprite.Position = tempPosition; Vector2 tempVelocity = new Vector2(hero.HeroSprite.SpeedX, hero.HeroSprite.SpeedY); WeaponSprite.Velocity = tempVelocity; float tempRotation = hero.HeroSprite.Rotation; WeaponSprite.Rotation = tempRotation; WeaponSprite.IsLive = true; WeaponSprite.Update(); }