Ignore:
Timestamp:
2013-07-23 14:56:27 (6 years ago)
Author:
anlakane
Message:

Talletus.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 2013/30/MiskaK/MW2(My Warfare 2)/MW2(My Warfare 2)/MW2(My Warfare 2)/Partikkelit.cs

    r4507 r4580  
    2525    public static ExplosionSystem RajahdysPartikkelit3 { get; private set; } 
    2626    public static ExplosionSystem RajahdysPartikkelit4 { get; private set; } 
     27 
     28    public static List<Smoke> ValikkoSavut { get; private set; } 
    2729 
    2830    public static Flame Tuli { get; private set; } 
     
    3739    private static readonly Image liekkiHiukkanen1 = MW2_My_Warfare_2_.LoadImage("liekkihiukkanen1"); 
    3840    private static readonly Image liekkiHiukkanen2 = MW2_My_Warfare_2_.LoadImage("liekkihiukkanen2"); 
     41    private static readonly Image valikkopartikkeli1 = MW2_My_Warfare_2_.LoadImage("valikkopartikkeli1"); 
     42    private static readonly Image valikkopartikkeli2 = MW2_My_Warfare_2_.LoadImage("valikkopartikkeli2"); 
     43 
    3944    //private static readonly Image rajahdysPartikkeli1 = MW2_My_Warfare_2_.LoadImage("Räjähdys1"); 
    4045    //private static readonly Image rajahdysPartikkeli2 = MW2_My_Warfare_2_.LoadImage("räjähdyspartikkeli1"); 
     
    199204        return Tuli; 
    200205    } 
     206 
     207    public static Smoke CreateSmoke(Image kuva, Vector paikka, double leveys, Angle suunta, double elinaika) 
     208    { 
     209        Smoke savu = new Smoke(kuva, leveys, suunta); 
     210        savu.MaximumLifetime = TimeSpan.FromSeconds(100000); 
     211        savu.MinLifetime = elinaika; 
     212        savu.MaxLifetime = 40.0; 
     213        savu.Position = paikka; 
     214        savu.MinAcceleration = 50.0; 
     215        return savu; 
     216    } 
     217 
     218    public static void LisaaValikkoTaustaPartikkelit() 
     219    { 
     220        ValikkoSavut = new List<Smoke>(); 
     221        ValikkoSavut.Add(CreateSmoke(valikkopartikkeli1, new Vector(MW2_My_Warfare_2_.Screen.Left + 100, MW2_My_Warfare_2_.Screen.Bottom), 15, Angle.FromDegrees(90), RandomGen.NextInt(1, 20))); 
     222        ValikkoSavut.Add(CreateSmoke(valikkopartikkeli2, new Vector(MW2_My_Warfare_2_.Screen.Left + 200, MW2_My_Warfare_2_.Screen.Bottom), 15, Angle.FromDegrees(90), RandomGen.NextInt(1, 20))); 
     223        ValikkoSavut.Add(CreateSmoke(valikkopartikkeli1, new Vector(MW2_My_Warfare_2_.Screen.Left + 300, MW2_My_Warfare_2_.Screen.Bottom), 15, Angle.FromDegrees(90), RandomGen.NextInt(1, 20))); 
     224        ValikkoSavut.Add(CreateSmoke(valikkopartikkeli2, new Vector(MW2_My_Warfare_2_.Screen.Left + 500, MW2_My_Warfare_2_.Screen.Bottom), 15, Angle.FromDegrees(90), RandomGen.NextInt(1, 20))); 
     225        ValikkoSavut.Add(CreateSmoke(valikkopartikkeli1, new Vector(MW2_My_Warfare_2_.Screen.Left + 700, MW2_My_Warfare_2_.Screen.Bottom), 15, Angle.FromDegrees(90), RandomGen.NextInt(1, 20))); 
     226        ValikkoSavut.Add(CreateSmoke(valikkopartikkeli1, new Vector(MW2_My_Warfare_2_.Screen.Left + 800, MW2_My_Warfare_2_.Screen.Bottom), 15, Angle.FromDegrees(90), RandomGen.NextInt(1, 20))); 
     227        ValikkoSavut.Add(CreateSmoke(valikkopartikkeli2, new Vector(MW2_My_Warfare_2_.Screen.Left + 1000, MW2_My_Warfare_2_.Screen.Bottom), 15, Angle.FromDegrees(90), RandomGen.NextInt(1, 20))); 
     228        ValikkoSavut.Add(CreateSmoke(valikkopartikkeli1, new Vector(MW2_My_Warfare_2_.Screen.Left + 1100, MW2_My_Warfare_2_.Screen.Bottom), 15, Angle.FromDegrees(90), RandomGen.NextInt(1, 20))); 
     229        ValikkoSavut.Add(CreateSmoke(valikkopartikkeli2, new Vector(MW2_My_Warfare_2_.Screen.Left + 1200, MW2_My_Warfare_2_.Screen.Bottom), 15, Angle.FromDegrees(90), RandomGen.NextInt(1, 20))); 
     230        ValikkoSavut.Add(CreateSmoke(valikkopartikkeli1, new Vector(MW2_My_Warfare_2_.Screen.Left + 1400, MW2_My_Warfare_2_.Screen.Bottom), 15, Angle.FromDegrees(90), RandomGen.NextInt(1, 20))); 
     231        ValikkoSavut.Add(CreateSmoke(valikkopartikkeli1, new Vector(MW2_My_Warfare_2_.Screen.Left + 1500, MW2_My_Warfare_2_.Screen.Bottom), 15, Angle.FromDegrees(90), RandomGen.NextInt(1, 20))); 
     232        ValikkoSavut.Add(CreateSmoke(valikkopartikkeli2, new Vector(MW2_My_Warfare_2_.Screen.Left + 1600, MW2_My_Warfare_2_.Screen.Bottom), 15, Angle.FromDegrees(90), RandomGen.NextInt(1, 20))); 
     233        ValikkoSavut.Add(CreateSmoke(valikkopartikkeli1, new Vector(MW2_My_Warfare_2_.Screen.Left + 1800, MW2_My_Warfare_2_.Screen.Bottom), 15, Angle.FromDegrees(90), RandomGen.NextInt(1, 20))); 
     234 
     235 
     236 
     237        foreach (Smoke savu in ValikkoSavut) 
     238        { 
     239            MW2_My_Warfare_2_.Peli.Add(savu); 
     240        } 
     241    } 
     242 
     243    public static void PoistaValikkoTaustaPartikkelit() 
     244    { 
     245        foreach (Smoke savu in ValikkoSavut) 
     246        { 
     247            savu.Destroy(); 
     248        } 
     249        ValikkoSavut.Clear(); 
     250    } 
    201251} 
Note: See TracChangeset for help on using the changeset viewer.