Changeset 5453 for 2014/27/PekkaR


Ignore:
Timestamp:
2014-07-04 12:55:52 (9 years ago)
Author:
pealrist
Message:
 
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  
    245245        Timer ajastin = new Timer(); 
    246246        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; }; 
    248248        ajastin.Start(); 
    249249        AddCollisionHandler<Vihollinen, Ammus>(vih, "ammusToV", Osuma); 
     
    338338        Timer ajastin = new Timer(); 
    339339        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; }; 
    341341        ajastin.Start(); 
    342342        Add(reaktori); 
Note: See TracChangeset for help on using the changeset viewer.