Ejemplo n.º 1
0
        public void Tick()
        {
            TileAnimation anim = _anim;
            int           c    = (_counter + 1) % anim.Duration;

            _counter = c;
            for (int f = 0; f < anim.Frames.Length; f++)
            {
                TileAnimation.Frame frame = anim.Frames[f];
                Tileset.Tile        tile  = _tileset.Tiles[frame.TilesetTile];
                for (int s = frame.Stops.Length - 1; s >= 0; s--)
                {
                    TileAnimation.Frame.Stop stop = frame.Stops[s];
                    if (stop.Time <= c)
                    {
                        tile.AnimBitmap = anim.Sheet[stop.SheetTile];
                        goto bottom;
                    }
                }
                tile.AnimBitmap = null;
bottom:
                ;
            }
        }
Ejemplo n.º 2
0
 public Tile(EndianBinaryReader r)
 {
     XFlip       = r.ReadBoolean();
     YFlip       = r.ReadBoolean();
     TilesetTile = Tileset.LoadOrGet(r.ReadInt32()).Tiles[r.ReadInt32()];
 }