Ignore:
Timestamp:
2010-07-08 23:13:56 (13 years ago)
Author:
anlakane
Message:

Siistimistä.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 2010/27/anlakane/Nopeuspeli/Peli.cs

    r1209 r1211  
    126126        painamattomat.Clear(); 
    127127        for (int i = 0; i < painikkeet.Count; i++) 
    128             Sytyta(painikkeet[i], i); 
     128            Sytyta(i); 
    129129        Keyboard.Listen(Key.Enter, ButtonState.Pressed, AloitaPeli, null); 
    130130    } 
     
    152152    { 
    153153        int sytytettavanIndeksi = RandomGen.NextInt(0, painikkeet.Count - 1); 
    154         Color alkuperainenVari = painikkeet[sytytettavanIndeksi].Color; 
    155         Sytyta(painikkeet[sytytettavanIndeksi], sytytettavanIndeksi); 
     154        Sytyta(sytytettavanIndeksi); 
    156155        painamattomat.Add(painikkeet[sytytettavanIndeksi]); 
    157156        Timer.SingleShot(t.Interval / 1.4, delegate() { Sammuta(sytytettavanIndeksi); }); 
    158157    } 
    159158 
    160     void Sytyta(GameObject sytytettava, int indeksi) 
     159    void Sytyta(int i) 
    161160    { 
    162         Color alkuperainenVari = sytytettava.Color; 
    163         double r = alkuperainenVari.RedComponent + 164; 
    164         double g = alkuperainenVari.GreenComponent + 164; 
    165         double b = alkuperainenVari.BlueComponent + 164; 
    166         if (r >= 255) r = 255; 
    167         if (g >= 255) g = 255; 
    168         if (b >= 255) b = 255; 
    169         sytytettava.Image = LoadImage(indeksi.ToString()); 
     161        painikkeet[i].Image = LoadImage(i.ToString()); 
    170162    } 
    171163 
Note: See TracChangeset for help on using the changeset viewer.