public Sprite(GameObject obj, bool flag) { SpriteImage = (Image)ImageSets[obj.ObjType][SpriteType.Hitted][obj.HitState].Clone(); Coordinates = new Point(obj.X - obj.SpriteWidth / 2, obj.Y); if (obj.OnHitDirection == Direction.Left) { SpriteImage.RotateFlip(RotateFlipType.RotateNoneFlipX); } }
public Sprite(GameObject obj) { if (obj.CurrentSprite == SpriteType.Attack) { if (obj.ObjType == ObjectType.Player) { SpriteImage = (Image)AttackSets[((Player)obj).CurrentWeapon.Type][obj.State].Clone(); } else { SpriteImage = (Image)ImageSets[obj.ObjType][obj.CurrentSprite][obj.State].Clone(); } Coordinates = new Point(obj.X - obj.SpriteWidth / 2 + obj.XCorrection, obj.Y + obj.YCorrection); } else { SpriteImage = (Image)ImageSets[obj.ObjType][obj.CurrentSprite][obj.State].Clone(); Coordinates = new Point(obj.X - obj.SpriteWidth / 2, obj.Y); } if (obj.CurrentDirection == Direction.Left) { SpriteImage.RotateFlip(RotateFlipType.RotateNoneFlipX); } }