Ejemplo n.º 1
0
 internal override void LoadInfo(XElement info)
 {
     base.LoadInfo(info);
     AttackType = (AttackTypes)(int)info.Attribute("AttackType");
     AttackRange = (double)info.Attribute("AttackRange");
     BulletData = new BulletDatas() {
         Type = (BulletTypes)(int)info.Attribute("BulletType"),
         Code = (int)info.Attribute("BulletCode"),
         Speed = (double)info.Attribute("BulletSpeed")
     };
 }
Ejemplo n.º 2
0
 public Bullet(BulletDatas bulletData)
 {
     switch (bulletType = bulletData.Type) {
         case BulletTypes.Common:
             this.Source = GlobalMethod.GetImage(string.Format("Bullet/{0}.png", bulletData.Code), UriType.Project);
             Offset = new Point(Source.PixelWidth, Source.PixelHeight / 2);
             break;
         case BulletTypes.Animation:
             AnimationBase animation = new AnimationBase() { Code = bulletData.Code, Loop = bulletData.Loop };
             animation.HeartStart();
             this.Children.Add(animation);
             Offset = new Point(animation.Center.X * 2, animation.Center.Y);
             break;
     }
 }