Example #1
0
        public override void Load()
        {
            base.Load();
            phoenixSpriteSheet = Scripts.LoadTexture(@"Abilities\FireControl\Phoenix");
            phoenixAnimation   = Scripts.LoadEntityWalkAnimation(phoenixSpriteSheet);

            PhoenixWidth         = phoenixSpriteSheet.Width / 4;
            PhoenixHeight        = phoenixSpriteSheet.Height / 4;
            phoenixWalkingOrigin = Scripts.GetWalkingOrigin(PhoenixWidth, PhoenixHeight);
            phoenixWalkingRect   = Scripts.GetWalkingRect(new Vector2(), PhoenixWidth, PhoenixHeight);

            particles = new List <Texture2D>()
            {
                Scripts.LoadTexture(@"Abilities\Circle")
            };
            particleSystem = new ParticleEngine(particles, Owner.Position);

            foreach (KeyValuePair <Direction, Animation> kvp in Owner.walkingAnimation)
            {
                ownerAnimation.Add(kvp.Key, kvp.Value);
            }
            DefaultEntityWidth  = Owner.EntityWidth;
            DefaultEntityHeight = Owner.EntityHeight;
            ownerWalkingOrigin  = Owner.WalkingOrigin;
            ownerWalkingRect    = Owner.WalkingRect;
        }
Example #2
0
 protected virtual void Initialize()
 {
     walkingOrigin = Scripts.GetWalkingOrigin(EntityWidth, EntityHeight);
     origin        = new Vector2(EntityWidth / 2, EntityHeight / 2);
     walkingRect   = Scripts.GetWalkingRect(Position - walkingOrigin, EntityWidth, EntityHeight);
     rect          = new Rectangle((int)position.X - (int)origin.X, (int)position.Y - (int)origin.Y, EntityWidth, EntityHeight);
     UpdateRect();
     baseSpeed = moveSpeed;
 }