public void turn() { if (MyOrigin == null || MyTiles == null || MyTiles.Length == 0) return; double startY = MyOrigin.Y, endY = MyOrigin.Y + MyTiles.Length * TileSize,latitude=MyOrigin.X; for (int i = 0; i < (endY - startY) / TileSize; i++) { myTiles[0, i] = new tileObj(new PointObj(latitude, startY + i * TileSize, 0), new PointObj(latitude, startY + (i + 1) * TileSize, TileSize), Common.colorBrown, Common.colorBlack); } Orientation = Common.planeOrientation.X; }
public LowWall(double altitude, double startX, double endX, int tileSize) { assignId(); //Create tiles myTiles = new tileObj[1,(int)(endX - startX)/tileSize]; for (int i = 0; i < (endX-startX)/tileSize; i++) { myTiles[0,i] = new tileObj(new PointObj(startX + i * tileSize, altitude, 0), new PointObj(startX + (i + 1) * tileSize, altitude, tileSize), Common.colorBrown, Common.colorBlack); } MyOrigin = myTiles[0, 0].MyOrigin; TileSize = tileSize; Orientation = Common.planeOrientation.Y; }
public HighWall(double altitude, double startX, double endX, int tileSize) { assignId(); IPoint or = new PointObj(startX, altitude, 0); IPoint topOr = new PointObj(or.X, or.Y, or.Z + tileSize); //Create tiles myTiles = new tileObj[2,(int)(endX - startX)/tileSize]; for (int i = 0; i < (endX-startX)/tileSize; i++) { myTiles[0,i] = new tileObj(new PointObj(or.X+ i * tileSize, or.Y, or.Z), new PointObj(or.X + (i + 1) * tileSize, or.Y, or.Z+tileSize), Common.colorBrown, Common.colorBlack); myTiles[1, i] = new tileObj(new PointObj(topOr.X + i * tileSize, topOr.Y, topOr.Z), new PointObj(topOr.X + (i + 1) * tileSize, topOr.Y, topOr.Z + tileSize), Common.colorBrown, Common.colorBlack); } MyOrigin = myTiles[0, 0].MyOrigin; TileSize = tileSize; Orientation = Common.planeOrientation.Y; }
private static void initObjects() { PC.setColor(colorRed); //Create tiles for (int i = 0; i < number_of_tiles; i++) { for (int j = 0; j < number_of_tiles; j++) { myTiles[i, j] = new tileObj(i*tileSize-wallSize/2, j*tileSize-wallSize/2, 0, colorRed,colorWhite); } } for (int i = 0; i < backgroundButtons.Length; i++) { backgroundButtons[i] = new tileObj(); backgroundButtons[i].myX = -form.Width / 2 + 100; backgroundButtons[i].myY = form.Height / 2 - 100 - 50 * i; switch (i) { case 0: backgroundButtons[i].setColor(colorRed); break; case 1: backgroundButtons[i].setColor(colorOrange); break; case 2: backgroundButtons[i].setColor(colorYellow); break; case 3: backgroundButtons[i].setColor(colorGreen); break; case 4: backgroundButtons[i].setColor(colorBrown); break; default: backgroundButtons[i].setColor(colorWhite); break; } } }
public void turn() { if (MyOrigin == null || MyTiles == null || MyTiles.Length == 0) return; double startY = MyOrigin.Y, endY = MyOrigin.Y + MyTiles.Length/2 * TileSize; IPoint or = new PointObj(MyOrigin.X,startY, 0); IPoint topOr = new PointObj(or.X, or.Y, or.Z + TileSize); for (int i = 0; i < (endY - startY) / TileSize; i++) { myTiles[0, i] = new tileObj(new PointObj(or.X, or.Y + i * TileSize, or.Z), new PointObj(or.X , or.Y + (i + 1) * TileSize, or.Z + TileSize), Common.colorBrown, Common.colorBlack); myTiles[1, i] = new tileObj(new PointObj(topOr.X , topOr.Y + i * TileSize , topOr.Z), new PointObj(topOr.X, topOr.Y + (i + 1) * TileSize, topOr.Z + TileSize), Common.colorBrown, Common.colorBlack); } Orientation = Common.planeOrientation.X; }