Ejemplo n.º 1
0
        static Tile()
        {
            stone = new Tile
            {
                TileIndex = 20,
                HasEdges = true,
                Collides = true,
                FileName = "Cloud 9/blocks/Terrain"
            };
            dirt = new Tile
            {
                TileIndex = 1,
                HasEdges = true,
                Collides = true,
                FileName = "Cloud 9/blocks/Terrain"
            };
            air = new Tile
            {
                TileIndex = 0,
                HasEdges = false,
                Collides = false,
                FileName = "Cloud 9/blocks/Terrain"
            };

            tiles = new Tile[] { air, dirt, stone };
        }
Ejemplo n.º 2
0
        static Tile()
        {
            dirt = new Tile
            {
                Texture = World.Content.Load<Texture2D>("Cloud 9/blocks/Dirt"),
                EdgeTexture = World.Content.Load<Texture2D>("Cloud 9/blocks/dirtedge"),
                Collides = true
            };
            air = new Tile
            {
                Texture = World.Content.Load<Texture2D>("Cloud 9/blankpixel"),
                Collides = false
            };

            tiles = new Tile[] { air, dirt };
        }
Ejemplo n.º 3
0
 public void SetTile(int x, int y, Tile t)
 {
     if (!isValidTile(x, y))
         throw new IndexOutOfRangeException("Tile out of range in Tile.SetTile");
     tileData[y * Width + x] = Tile.GetByte(t);
 }
Ejemplo n.º 4
0
 public static byte GetByte(Tile t)
 {
     return (byte)Array.IndexOf(tiles, t);
 }