Changeset 1212 for 2010/27


Ignore:
Timestamp:
2010-07-09 09:00:19 (13 years ago)
Author:
anlakane
Message:

Äänet ja vähän helpotuista peliin.

Location:
2010/27/anlakane/Nopeuspeli
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • 2010/27/anlakane/Nopeuspeli/Content/Content.contentproj

    r1210 r1212  
    8383    </Compile> 
    8484  </ItemGroup> 
     85  <ItemGroup> 
     86    <Compile Include="sinewave.wav"> 
     87      <Name>sinewave</Name> 
     88      <Importer>WavImporter</Importer> 
     89      <Processor>SoundEffectProcessor</Processor> 
     90    </Compile> 
     91  </ItemGroup> 
    8592</Project> 
  • 2010/27/anlakane/Nopeuspeli/Nopeuspeli.csproj

    r1208 r1212  
    5757  </PropertyGroup> 
    5858  <ItemGroup> 
    59     <Reference Include="Jypeli2, Version=1.0.0.0, Culture=neutral, processorArchitecture=x86"> 
     59    <Reference Include="Jypeli2, Version=2.2.5.0, Culture=neutral, processorArchitecture=x86"> 
    6060      <SpecificVersion>False</SpecificVersion> 
    61       <HintPath>..\..\..\..\..\npo\trunk\lib\Jypeli2.dll</HintPath> 
     61      <HintPath>..\..\..\..\..\lib\Jypeli2.dll</HintPath> 
    6262    </Reference> 
    6363    <Reference Include="Microsoft.Xna.Framework, Version=3.1.0.0, Culture=neutral, PublicKeyToken=6d5c3888ef60e27d" /> 
  • 2010/27/anlakane/Nopeuspeli/Peli.cs

    r1211 r1212  
    2020    int montakoPainikettaPainettu; 
    2121 
     22    Sound piip; 
     23 
    2224    protected override void Begin() 
    2325    { 
     
    3234        LisaaPainikkeet(); 
    3335        LuoAjastimet(); 
     36        LataaAanet(); 
    3437 
    3538        LisaaPistenaytto(); 
     
    3740 
    3841    } 
     42 
     43    void LataaAanet() 
     44    { 
     45        SoundEffect siniaalto = LoadSoundEffect("sinewave"); 
     46        piip = siniaalto.CreateSound(); 
     47    } 
     48 
    3949 
    4050    void LuoAjastimet() 
     
    146156    void NopeutaPelia(Timer t) 
    147157    { 
    148         painikkeidenSytytin.Interval /= 1.2; 
     158        painikkeidenSytytin.Interval /= 1.15; 
    149159    } 
    150160 
     
    155165        painamattomat.Add(painikkeet[sytytettavanIndeksi]); 
    156166        Timer.SingleShot(t.Interval / 1.4, delegate() { Sammuta(sytytettavanIndeksi); }); 
     167        Timer.SingleShot(t.Interval / 2, SammutaAani); 
     168        switch (sytytettavanIndeksi) 
     169        { 
     170            case 0 : 
     171                piip.Pitch = -1; 
     172                break; 
     173            case 1: 
     174                piip.Pitch = -.75; 
     175                break; 
     176            case 2: 
     177                piip.Pitch = -0.4; 
     178                break; 
     179            case 3: 
     180                piip.Pitch = -0.15; 
     181                break; 
     182 
     183        } 
     184         
     185        piip.Play(); 
    157186    } 
    158187 
    159188    void Sytyta(int i) 
    160189    { 
    161         painikkeet[i].Image = LoadImage(i.ToString()); 
     190        painikkeet[i].Image = LoadImage(i.ToString());         
     191    } 
     192 
     193    void SammutaAani() 
     194    { 
     195        piip.Stop(); 
    162196    } 
    163197 
    164198    void Sammuta(int i) 
    165199    { 
    166         painikkeet[i].Image = LoadImage(i.ToString() + "_"); 
     200        painikkeet[i].Image = LoadImage(i.ToString() + "_");         
    167201    } 
    168202 
Note: See TracChangeset for help on using the changeset viewer.