Changeset 5453 for 2014/27/PekkaR
- Timestamp:
- 2014-07-04 12:55:52 (9 years ago)
- Location:
- 2014/27/PekkaR/D2x_2d
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
2014/27/PekkaR/D2x_2d/D2x_2d/D2x_2d/D2x_2d.cs
r5450 r5453 245 245 Timer ajastin = new Timer(); 246 246 ajastin.Interval = 0.8; 247 ajastin.Timeout += delegate { if (!(pelaaja.IsDestroyed || vih.IsDestroyed) && RandomGen.NextBool()) Add(vih.Ammu(pelaaja)); vih.Move(RandomGen.NextVector(20, 20)); double ad = RandomGen.NextDouble(-0.5, 0.5); if (ajastin.Interval + ad < 0.1) ajastin.Interval = 0.1; else ajastin.Interval += ad; };247 ajastin.Timeout += delegate { if (!(pelaaja.IsDestroyed || vih.IsDestroyed) && RandomGen.NextBool()) Add(vih.Ammu(pelaaja)); vih.Move(RandomGen.NextVector(20, 20)); double ad = RandomGen.NextDouble(-0.5, 0.5); if (ajastin.Interval + ad < 0.1) ajastin.Interval = 0.1; else if(ajastin.Interval + ad > 2) ajastin.Interval = 2; else ajastin.Interval += ad; }; 248 248 ajastin.Start(); 249 249 AddCollisionHandler<Vihollinen, Ammus>(vih, "ammusToV", Osuma); … … 338 338 Timer ajastin = new Timer(); 339 339 ajastin.Interval = 0.6; 340 ajastin.Timeout += delegate { if (!(pelaaja.IsDestroyed || reaktori.IsDestroyed) && RandomGen.NextBool()) { Ammus am = reaktori.Ammu(pelaaja); am.Color = Color.Red; Add(am); } };340 ajastin.Timeout += delegate { if (!(pelaaja.IsDestroyed || reaktori.IsDestroyed) && RandomGen.NextBool()) { Ammus am = reaktori.Ammu(pelaaja); am.Color = Color.Red; Add(am); } double ad = RandomGen.NextDouble(-0.5, 0.5); if (ajastin.Interval + ad < 0.1) ajastin.Interval = 0.1; else if (ajastin.Interval + ad > 2) ajastin.Interval = 1.5; else ajastin.Interval += ad; }; 341 341 ajastin.Start(); 342 342 Add(reaktori);
Note: See TracChangeset
for help on using the changeset viewer.