377,6 → 377,7 |
public string detailText = ""; |
public int lang; |
|
public bool extraPretty = false; |
Random rnd = new Random(); |
|
public Form1(int language) |
775,13 → 776,11 |
for (int j = 1; j < points.Length - 1; j++) |
points[j] = new PointF(enemies[towers[i].target].loc.X + notZero(towers[i].loc.X - (int)enemies[towers[i].target].loc.X) / points.Length * j + rnd.Next(-points.Length - 4, points.Length + 4), enemies[towers[i].target].loc.Y + notZero(towers[i].loc.Y - (int)enemies[towers[i].target].loc.Y) / points.Length * j + rnd.Next(-points.Length - 4, points.Length + 4)); |
g.DrawLines(new Pen(towerTypes[towers[i].type].laserColour, 3), points); |
// //impactThing |
// points = new PointF[getDist(towers[i].loc, FtoP(enemies[towers[i].target].loc)) / 50 + 3]; |
// points[0] = enemies[towers[i].target].loc; |
// points[points.Length - 1] = enemies[towers[i].target].loc; |
// for (int j = 1; j < points.Length - 1; j++) |
// points[j] = new PointF((int)enemies[towers[i].target].loc.X + rnd.Next(-(int)(enemyTypes[enemies[towers[i].target].type].img.imgs[0].Width * 0.8), (int)(enemyTypes[enemies[towers[i].target].type].img.imgs[0].Width * 0.8)), (int)enemies[towers[i].target].loc.Y + rnd.Next(-(int)(enemyTypes[enemies[towers[i].target].type].img.imgs[0].Height * 0.8), (int)(enemyTypes[enemies[towers[i].target].type].img.imgs[0].Height * 0.8))); |
// g.DrawLines(new Pen(towerTypes[towers[i].type].laserColour, 3), points); |
if (extraPretty) |
{ |
for (int j = 0; j < 3; j++) |
g.DrawLines(new Pen(towerTypes[towers[i].type].laserColour, 1), rndmisePoints(points, true)); |
} |
break; |
} |
case (2): |
793,6 → 792,11 |
for (int j = 1; j < points.Length - 1; j++) |
points[j] = new PointF(enemies[towers[i].target].loc.X + notZero(towers[i].loc.X - (int)enemies[towers[i].target].loc.X) / points.Length * j + rnd.Next(-points.Length - 4, points.Length + 4), enemies[towers[i].target].loc.Y + notZero(towers[i].loc.Y - (int)enemies[towers[i].target].loc.Y) / points.Length * j + rnd.Next(-points.Length - 4, points.Length + 4)); |
g.DrawLines(new Pen(towerTypes[towers[i].type].laserColour, 3), points); |
if (extraPretty) |
{ |
for (int j = 0; j < 3; j++) |
g.DrawLines(new Pen(towerTypes[towers[i].type].laserColour, 1), rndmisePoints(points, true)); |
} |
//furtherLasers |
for (int r = 1; r < towers[i].targets.Count; r++) |
{ |
802,6 → 806,11 |
for (int j = 1; j < points.Length - 1; j++) |
points[j] = new PointF(enemies[towers[i].targets[r]].loc.X + notZero(enemies[towers[i].targets[r - 1]].loc.X - (int)enemies[towers[i].targets[r]].loc.X) / points.Length * j + rnd.Next(-points.Length - 4, points.Length + 4), enemies[towers[i].targets[r]].loc.Y + notZero(enemies[towers[i].targets[r - 1]].loc.Y - (int)enemies[towers[i].targets[r]].loc.Y) / points.Length * j + rnd.Next(-points.Length - 4, points.Length + 4)); |
g.DrawLines(new Pen(towerTypes[towers[i].type].laserColour, 3), points); |
if (extraPretty) |
{ |
for (int j = 0; j < 3; j++) |
g.DrawLines(new Pen(towerTypes[towers[i].type].laserColour, 1), rndmisePoints(points, true)); |
} |
} |
break; |
} |
870,6 → 879,22 |
|
} |
|
public PointF[] rndmisePoints(PointF[] oldPoints, bool ignoreStartAndEnd) |
{ |
PointF[] newPoints = oldPoints; |
if (ignoreStartAndEnd) |
{ |
for (int i = 1; i < newPoints.Length - 1; i++) |
newPoints[i] = new PointF(oldPoints[i].X + (float)rnd.Next(-5, 6), oldPoints[i].Y + (float)rnd.Next(-5, 6)); |
} |
else |
{ |
for (int i = 0; i < newPoints.Length; i++) |
newPoints[i] = new PointF(oldPoints[i].X + (float)rnd.Next(-5, 6), oldPoints[i].Y + (float)rnd.Next(-5, 6)); |
} |
return newPoints; |
} |
|
public string textWrap(Font font, string textN, int width) |
{ |
string text = textN; |
1111,6 → 1136,9 |
case Keys.F4: |
timer1.Enabled = !timer1.Enabled; |
break; |
case Keys.E: |
extraPretty = !extraPretty; |
break; |
// case Keys.S: |
// sound = !sound; |
// break; |