- Timestamp:
- 2010-07-09 09:00:19 (13 years ago)
- Location:
- 2010/27/anlakane/Nopeuspeli
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
2010/27/anlakane/Nopeuspeli/Content/Content.contentproj
r1210 r1212 83 83 </Compile> 84 84 </ItemGroup> 85 <ItemGroup> 86 <Compile Include="sinewave.wav"> 87 <Name>sinewave</Name> 88 <Importer>WavImporter</Importer> 89 <Processor>SoundEffectProcessor</Processor> 90 </Compile> 91 </ItemGroup> 85 92 </Project> -
2010/27/anlakane/Nopeuspeli/Nopeuspeli.csproj
r1208 r1212 57 57 </PropertyGroup> 58 58 <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"> 60 60 <SpecificVersion>False</SpecificVersion> 61 <HintPath>..\..\..\..\..\ npo\trunk\lib\Jypeli2.dll</HintPath>61 <HintPath>..\..\..\..\..\lib\Jypeli2.dll</HintPath> 62 62 </Reference> 63 63 <Reference Include="Microsoft.Xna.Framework, Version=3.1.0.0, Culture=neutral, PublicKeyToken=6d5c3888ef60e27d" /> -
2010/27/anlakane/Nopeuspeli/Peli.cs
r1211 r1212 20 20 int montakoPainikettaPainettu; 21 21 22 Sound piip; 23 22 24 protected override void Begin() 23 25 { … … 32 34 LisaaPainikkeet(); 33 35 LuoAjastimet(); 36 LataaAanet(); 34 37 35 38 LisaaPistenaytto(); … … 37 40 38 41 } 42 43 void LataaAanet() 44 { 45 SoundEffect siniaalto = LoadSoundEffect("sinewave"); 46 piip = siniaalto.CreateSound(); 47 } 48 39 49 40 50 void LuoAjastimet() … … 146 156 void NopeutaPelia(Timer t) 147 157 { 148 painikkeidenSytytin.Interval /= 1. 2;158 painikkeidenSytytin.Interval /= 1.15; 149 159 } 150 160 … … 155 165 painamattomat.Add(painikkeet[sytytettavanIndeksi]); 156 166 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(); 157 186 } 158 187 159 188 void Sytyta(int i) 160 189 { 161 painikkeet[i].Image = LoadImage(i.ToString()); 190 painikkeet[i].Image = LoadImage(i.ToString()); 191 } 192 193 void SammutaAani() 194 { 195 piip.Stop(); 162 196 } 163 197 164 198 void Sammuta(int i) 165 199 { 166 painikkeet[i].Image = LoadImage(i.ToString() + "_"); 200 painikkeet[i].Image = LoadImage(i.ToString() + "_"); 167 201 } 168 202
Note: See TracChangeset
for help on using the changeset viewer.