예제 #1
0
파일: Hero.cs 프로젝트: MaciejSzpakowski/mu
        public Hero(string name, HeroClass heroClass)
        {
            Collect = false;
            Online = TimeSpan.Zero;
            Target = Position;
            AcceptArrows = true;
            zLastPosition = Position;
            Netid = 0;
            Name = name;
            Class = heroClass;
            Position.Z = ZLayer.Npc;
            WalkingSpeed = 10;

            SpriteManager.AddPositionedObject(this);

            Collider = ShapeManager.AddCircle();
            Collider.AttachTo(this, false);
            Collider.Visible = false;

            Sprite = LoadSprite();
            Sprite.AttachTo(this, false);
            Sprite.Resize(4);
            Sprite.AnimationSpeed = 0.1f;            

            Label = TextManager.AddText(name, Globals.Font);
            Label.AttachTo(this, false);
            Label.HorizontalAlignment = HorizontalAlignment.Center;
            Label.RelativePosition = new Vector3(0, 4, ZLayer.NpcLabel - Position.Z);            

            InitStats();
        }
예제 #2
0
파일: Mob.cs 프로젝트: MaciejSzpakowski/mu
 private void InitSprite(string file)
 {
     Sprite = Functions.AddSpriteFromAchx(Path.Make(Path.Mob, file));
     Sprite.CurrentChainName = "Idle";
     Sprite.Resize(4);
     Sprite.IgnoresParentVisibility = true;
     Sprite.AttachTo(this, false);
 }