public Board(Encounter encounter, BoardShape boardShape, Vector2 position, Vector2 dimensions, int tileSize, int tileGameSize, BoardTextureSet textureSet) : base(new Vector2(dimensions.X * tileSize / 2, dimensions.Y * tileSize / 2) + position) { this.encounter = encounter; this.textureSet = textureSet; this.tileGameSize = tileGameSize; if (boardShape == BoardShape.Square) { LaySquareBoard(dimensions, tileSize); } }
public Form1() { gm = Graphics.FromImage(mp); bs = TileFactory.fancy(); bd = TileFactory.CreateBoard(22, bs); corners = PaintBoard.Tilate(bd, 700, 600, tileTilt.vertical); squareSize = PaintBoard.TileSize(bd, 700, 600, tileTilt.vertical); gm.CompositingMode = System.Drawing.Drawing2D.CompositingMode.SourceCopy; gm.FillRectangle(bush, 0, 0, 700, 600); InitializeComponent(); bearImg = Image.FromFile(@"..\..\..\bear.bmp", false); }
public BoardTile(BoardShape boardShape, Vector2 position, Texture2D texture, int size, Board board) : base(position, texture, board) { this.board = board; boardTileShape = boardShape; transform.SetSize(new Vector2(size, size), texture); transform.LayerDepth = EngManager.layerDepths[LayerDepths.Ground]; creature = null; orderControl = null; if (boardShape == BoardShape.Square) { BoardTileSquare(position, texture, size); } }
public static List <Tile> CreateTiles(int m, BoardShape bs) { List <Tile> mylist = new List <Tile>(); int i, j; for (i = 0; i < m; i++) { for (j = 0; j < m; j++) { if (bs(i, j)) { mylist.Add(new Tile(TileType.empty, i, j)); } } } return(mylist); }
public static BoardShape fancy() { BoardShape bs = HexBoard(3); return(delegate(int i, int j) { if (bs(i, j)) { return true; } if (bs(i - 2, j)) { return true; } return false; }); }
public void LaySquareBoard(Vector2 dimensions, int tileSize) { boardShape = BoardShape.Square; MakeHitbox(new Vector2(0, 0), HitboxShape.Rectangle, new Vector3(dimensions.X * tileSize, dimensions.Y * tileSize, 0)); boardTiles = new BoardTile[(int)dimensions.X, (int)dimensions.Y]; int xPos = (int)((-dimensions.X / 2) * tileSize + tileSize / 2); for (int x = 0; x < dimensions.X; x++) { int yPos = (int)((-dimensions.Y / 2) * tileSize + tileSize / 2); for (int y = 0; y < dimensions.Y; y++) { MakeBoardTileSquare(x, y, xPos, yPos, tileSize); yPos += tileSize; } xPos += tileSize; } }
public static Board CreateBoard(int m, BoardShape bs) { return(new Board(CreateTiles(m, bs))); }