public HexPlayfield(int laneCount, bool biggerBase = false) : base(ScrollingDirection.Left) { Anchor = Anchor.Centre; Origin = Anchor.TopLeft; //create lanes Lanes = new HexLane[laneCount]; for (int i = 0; i < laneCount; i++) { AddNested(Lanes[i] = new HexLane(i, laneCount, biggerBase) { Rotation = 90f + 360f * i / laneCount, Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, Padding = new MarginPadding { Left = Constants.PaddingBase * laneCount / 10f }, OnUpdate = drawable => drawable.Rotation += (float)Time.Elapsed / 16f * 0.0625f }); } Children = new Drawable[] { new Container { Children = Lanes } }; }
public HexPlayfield(int laneCount, bool biggerBase = false) { Direction.Value = ScrollingDirection.Left; Anchor = Anchor.Centre; Origin = Anchor.TopLeft; //create lanes Lanes = new HexLane[laneCount]; for (int i = 0; i < laneCount; i++) { AddNested(Lanes[i] = new HexLane(i, laneCount, biggerBase) { Rotation = 90f + 360f * i / laneCount, Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, OnUpdate = drawable => drawable.Rotation += (float)Time.Elapsed / 16f * 0.0625f }); } InternalChildren = new Drawable[] { new Container { Children = Lanes } }; }
public HexLaneBase(HexLane parent) { _parent = parent; _laneColor = parent._laneColor; Add(_poly = new Polygon(parent._laneCount) { RelativeSizeAxes = Axes.Both, Colour = colorIdle, }); }