Exemplo n.º 1
0
        public Unit(Tile t, DMI.SpriteFamily family, float moveHz, float animHz)
            : base(t, true)
        {
            Sprite   = new ImageSprite(family, moveHz, animHz);
            Movement = new TimerPeriodic(moveHz);

            _tmrAIUpdate = new TimerPeriodic(s_f32AIUpdateHz);
            _tmrAIUpdate.Trigger += delay => { if (AI != null) AI.Update(); };

            Moved += prev => Sprite.Position = Tile.PositionRender;
            MutatedHealth += prev => { if (Dead) IFF = null; };
            // Snap the initial position to our location.
            Sprite.PositionSnap = t.PositionRender;
        }
Exemplo n.º 2
0
            internal SpriteFamily(DMI owner, string strName, Rectangle[][] frames)
            {
                Sheet      = owner;
                Name       = strName;
                Directions = new Sprite[frames.Length];

                for (int i = 0; i < frames.Length; ++i)
                    Directions[i] = new Sprite(this, frames[i]);
            }
Exemplo n.º 3
0
 public ImageDirectional(DMI.SpriteFamily family)
     : base(family.Sheet.TextureSheet, family[0][0])
 {
     Family = family;
 }
Exemplo n.º 4
0
 public ImageSprite(DMI.SpriteFamily family, float hz_move, float hz_frame = 10)
     : base(family)
 {
     HzFrame = hz_frame;
     HzMove  = hz_move;
 }