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; }
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]); }
public ImageDirectional(DMI.SpriteFamily family) : base(family.Sheet.TextureSheet, family[0][0]) { Family = family; }
public ImageSprite(DMI.SpriteFamily family, float hz_move, float hz_frame = 10) : base(family) { HzFrame = hz_frame; HzMove = hz_move; }