Beispiel #1
0
 public TileDecal(Sprite _sprite, Vector2D _position, Tile _tile, Color color)
 {
     sprite = _sprite;
     position = _position;
     tile = _tile;
     sprite.Color = color;
 }
Beispiel #2
0
        private void SetSpritesAround(Tile t)
        {
            Tile[] tiles = (Tile[])GetAllWallIn(new RectangleF(t.Position.X - (TileSpacing / 2f), t.Position.Y - (TileSpacing / 2f), TileSpacing * 2, TileSpacing * 2));

            foreach (Tile u in tiles)
            {
                if(u != t)
                    u.SetSprite();
            }
        }
Beispiel #3
0
 private void TileChanged(Tile t)
 {
     if (OnTileChanged != null)
         OnTileChanged(t.Position);
 }
Beispiel #4
0
 private Rectangle TilePos(Tile T)
 {
     return new Rectangle((int)(T.Position.X), (int)(T.Position.Y), TileSpacing, TileSpacing);
 }
Beispiel #5
0
 private void RemoveTile(Tile t)
 {
     if (t.GetType().Name == "Wall")
     {
         _wallArray.Remove(t);
         SetSpritesAround(t);
     }
     else
     {
         _groundArray.Remove(t);
     }
 }
Beispiel #6
0
 public void AddTile(Tile t)
 {
     if (t.GetType().Name == "Wall")
     {
         _wallArray.Insert(t);
         SetSpritesAround(t);
     }
     else
     {
         _groundArray.Insert(t);
     }
 }