public override void OnRender(CompositionTargetBase target) { if (this.IsAlive) { //alien walking switch (this.Status) { case AlienStatus.Walk1: //legs target.DrawPixel(this.XCenter - 1, this.YCenter, Colors.Lime); target.DrawPixel(this.XCenter + 1, this.YCenter, Colors.Lime); //head target.DrawPixel(this.XCenter, this.YCenter - 1, Colors.Red); break; case AlienStatus.Walk2: //leg(s) target.DrawPixel(this.XCenter, this.YCenter, Colors.Lime); //head target.DrawPixel(this.XCenter, this.YCenter - 1, Colors.Red); break; } } else { this.RenderDeath(target); } }
public void OnRender(CompositionTargetBase target) { if (this.IsActive) { target.DrawPixel(this.XCenter, this.YCenter, Colors.Red); } }
public void OnRender(CompositionTargetBase target) { int bricks; if ((bricks = this.BricksAlive) != 0) { for (int y = 0; y < BarrierHeight; y++) { int yy = this.YTop + y; for (int x = 0; x < BarrierWidth; x++) { if ((bricks & 1) != 0) { target.DrawPixel( this.XLeft + x, yy, Colors.Lime); } bricks >>= 1; } } } }
public void OnRender(CompositionTargetBase target) { switch (this.Status) { case SaucerStatus.Inactive: break; case SaucerStatus.Active: //cabin target.DrawPixel(this.XCenter, this.YCenter, Colors.Lime); target.DrawPixel(this.XCenter + 1, this.YCenter, Colors.Lime); //rockets int y = this.YCenter + 1; int color1 = (this.XCenter & 1) != 0 ? Colors.Red : Colors.Yellow; int color2 = (this.XCenter & 1) == 0 ? Colors.Red : Colors.Yellow; target.DrawPixel(this.XCenter - 1, y, color1); target.DrawPixel(this.XCenter, y, color2); target.DrawPixel(this.XCenter + 1, y, color1); target.DrawPixel(this.XCenter + 2, y, color2); break; case SaucerStatus.ExplodeExpand: case SaucerStatus.ExplodeCollapse: target.DrawPixel(this.XCenter, this.YCenter, Colors.Red); target.DrawPixel(this.XCenter + 1, this.YCenter, Colors.Red); target.DrawPixel(this.XCenter - 1, this.YCenter - 1, Colors.Yellow); target.DrawPixel(this.XCenter - 1, this.YCenter + 1, Colors.Yellow); target.DrawPixel(this.XCenter + 1, this.YCenter - 1, Colors.Yellow); break; case SaucerStatus.ExplodeMax: target.DrawPixel(this.XCenter, this.YCenter, Colors.Red); target.DrawPixel(this.XCenter - 1, this.YCenter, Colors.Red); target.DrawPixel(this.XCenter, this.YCenter - 1, Colors.Red); target.DrawPixel(this.XCenter + 1, this.YCenter - 1, Colors.Red); target.DrawPixel(this.XCenter - 1, this.YCenter - 2, Colors.Yellow); target.DrawPixel(this.XCenter + 1, this.YCenter - 2, Colors.Yellow); target.DrawPixel(this.XCenter + 2, this.YCenter - 2, Colors.Yellow); target.DrawPixel(this.XCenter + 1, this.YCenter - 3, Colors.Yellow); target.DrawPixel(this.XCenter - 2, this.YCenter + 1, Colors.Yellow); target.DrawPixel(this.XCenter + 2, this.YCenter + 1, Colors.Yellow); break; } }
protected void RenderDeath(CompositionTargetBase target) { switch (this.Status) { case AlienStatus.ExplodeExpand: case AlienStatus.ExplodeCollapse: target.DrawPixel(this.XCenter, this.YCenter, Colors.Red); target.DrawPixel(this.XCenter + 1, this.YCenter, Colors.Red); target.DrawPixel(this.XCenter - 1, this.YCenter - 1, Colors.Yellow); target.DrawPixel(this.XCenter - 1, this.YCenter + 1, Colors.Yellow); target.DrawPixel(this.XCenter + 1, this.YCenter - 1, Colors.Yellow); break; case AlienStatus.ExplodeMax: target.DrawPixel(this.XCenter, this.YCenter, Colors.Red); target.DrawPixel(this.XCenter - 1, this.YCenter, Colors.Red); target.DrawPixel(this.XCenter, this.YCenter - 1, Colors.Red); target.DrawPixel(this.XCenter + 1, this.YCenter - 1, Colors.Red); target.DrawPixel(this.XCenter - 1, this.YCenter - 2, Colors.Yellow); target.DrawPixel(this.XCenter + 1, this.YCenter - 2, Colors.Yellow); target.DrawPixel(this.XCenter + 2, this.YCenter - 2, Colors.Yellow); target.DrawPixel(this.XCenter + 1, this.YCenter - 3, Colors.Yellow); target.DrawPixel(this.XCenter - 2, this.YCenter + 1, Colors.Yellow); target.DrawPixel(this.XCenter + 2, this.YCenter + 1, Colors.Yellow); break; } }
private static void TestPoints() { int x = _counter & 31; _composition.DrawPixel(x, 0, Colors.Red); _composition.DrawPixel(x, 2, Colors.Red); _composition.DrawPixel(x, 4, Colors.Red); _composition.DrawPixel(x, 6, Colors.Red); _composition.DrawPixel(x, 8, Colors.Red); _composition.DrawPixel(x, 10, Colors.Red); _composition.DrawPixel(x, 12, Colors.Red); _composition.DrawPixel(x, 14, Colors.Red); _composition.DrawPixel(31 - x, 1, Colors.Lime); _composition.DrawPixel(31 - x, 3, Colors.Lime); _composition.DrawPixel(31 - x, 5, Colors.Lime); _composition.DrawPixel(31 - x, 7, Colors.Lime); _composition.DrawPixel(31 - x, 9, Colors.Lime); _composition.DrawPixel(31 - x, 11, Colors.Lime); _composition.DrawPixel(31 - x, 13, Colors.Lime); _composition.DrawPixel(31 - x, 15, Colors.Lime); }
public void OnRender(CompositionTargetBase target) { switch (this.Status) { case ShipStatus.Alive: target.DrawPixel(this.XCenter, this.YCenter, Colors.Yellow); target.DrawPixel(this.XCenter, this.YCenter - 1, Colors.Yellow); target.DrawPixel(this.XCenter - 1, this.YCenter, Colors.Yellow); target.DrawPixel(this.XCenter + 1, this.YCenter, Colors.Yellow); break; case ShipStatus.ExplodeExpand: case ShipStatus.ExplodeCollapse: target.DrawPixel(this.XCenter, this.YCenter, Colors.Red); target.DrawPixel(this.XCenter + 1, this.YCenter, Colors.Red); target.DrawPixel(this.XCenter - 1, this.YCenter - 1, Colors.Yellow); target.DrawPixel(this.XCenter - 1, this.YCenter + 1, Colors.Yellow); target.DrawPixel(this.XCenter + 1, this.YCenter - 1, Colors.Yellow); break; case ShipStatus.ExplodeMax: target.DrawPixel(this.XCenter, this.YCenter, Colors.Red); target.DrawPixel(this.XCenter - 1, this.YCenter, Colors.Red); target.DrawPixel(this.XCenter, this.YCenter - 1, Colors.Red); target.DrawPixel(this.XCenter + 1, this.YCenter - 1, Colors.Red); target.DrawPixel(this.XCenter - 1, this.YCenter - 2, Colors.Yellow); target.DrawPixel(this.XCenter + 1, this.YCenter - 2, Colors.Yellow); target.DrawPixel(this.XCenter + 2, this.YCenter - 2, Colors.Yellow); target.DrawPixel(this.XCenter + 1, this.YCenter - 3, Colors.Yellow); target.DrawPixel(this.XCenter - 2, this.YCenter + 1, Colors.Yellow); target.DrawPixel(this.XCenter + 2, this.YCenter + 1, Colors.Yellow); break; } }