Changeset 6090 for 2015/24


Ignore:
Timestamp:
2015-06-15 09:41:01 (4 years ago)
Author:
sieerinn
Message:

Ratasääni valikkoon.

Location:
2015/24/ohjaajat/Dungeon/Dungeon
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • 2015/24/ohjaajat/Dungeon/Dungeon/Dungeon/MainMenu.cs

    r6089 r6090  
    1919    private Image pimeysKuva = Game.LoadImage("pimeys"); 
    2020 
     21    private SoundEffect ratasAani = Game.LoadSoundEffect("gear"); 
     22 
    2123    private GameObject pala; // Putoava palkki. 
    2224    private GameObject ratas; // Palkin vieressä pyörivä ratas. 
     
    2628    private const double Kimmoisuus = -0.4; 
    2729    private double palaNopeus = 0.0; 
     30    private double palaSiirtyma; // Ääni soitetaan jos pala on siirtynyt tarpeeksi. 
    2831 
    2932    public PushButton[] Painikkeet { get; set; } 
     
    5861        }; 
    5962        barbaariAjastin.Start(); 
     63 
     64        //Sound aani = ratasAani.CreateSound(); 
     65        ////aani.IsLooped = true; 
     66        //aani.Volume = 1.0; 
     67        //aani.Pitch = 0.0; 
     68        //aani.Play(); 
    6069    } 
    6170 
     
    121130        pala.Y += palaNopeus * dt; 
    122131 
     132        palaSiirtyma += palaNopeus * dt; 
     133        if (Math.Abs(palaSiirtyma) > 20.0 && Math.Abs(palaNopeus) > 10.0) 
     134        { 
     135            ratasAani.Play(); 
     136            palaSiirtyma = 0.0; 
     137        } 
     138 
    123139        // Menu hyppää takas jos se on loppumaisillaan. 
    124140        if (pala.Top < Game.Screen.Top) 
     
    126142            palaNopeus *= Kimmoisuus; 
    127143            pala.Top = Game.Screen.Top; 
     144 
     145            if (Math.Abs(palaNopeus) > 10.0) 
     146                ratasAani.Play(); 
    128147        } 
    129148 
  • 2015/24/ohjaajat/Dungeon/Dungeon/DungeonContent/DungeonContent.contentproj

    r6088 r6090  
    280280    </Compile> 
    281281  </ItemGroup> 
     282  <ItemGroup> 
     283    <Compile Include="gear.wav"> 
     284      <Name>gear</Name> 
     285      <Importer>WavImporter</Importer> 
     286      <Processor>SoundEffectProcessor</Processor> 
     287    </Compile> 
     288  </ItemGroup> 
    282289  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    283290  <!--  To modify your build process, add your task inside one of the targets below and uncomment it.  
Note: See TracChangeset for help on using the changeset viewer.