Changeset 6924


Ignore:
Timestamp:
2015-07-22 14:32:03 (8 years ago)
Author:
ellihutt
Message:

Lisätty aloitusvalikko josta voi valita pelihahmon, painovoiman kiihtyvyys ja uusi pelihahmo

Location:
2015/30/EllenH/OmaPeli
Files:
3 added
13 edited

Legend:

Unmodified
Added
Removed
  • 2015/30/EllenH/OmaPeli/OmaPeli/OmaPeli/OmaPeli.cs

    r6909 r6924  
    99public class OmaPeli : PhysicsGame 
    1010{ 
    11     const double nopeus = 100; 
     11    const double nopeus = 250; 
    1212    const double hyppyNopeus = 750; 
    1313    const int RUUDUN_KOKO = 40; 
     
    2020    SoundEffect maaliAani = LoadSoundEffect("maali"); 
    2121 
     22    Timer kiihtyvyysajastin; 
     23 
    2224    public override void Begin() 
     25    { 
     26        Alkuvalikko(); 
     27    } 
     28 
     29    void AloitaKentta() 
    2330    { 
    2431        ClearAll(); 
     
    3138        Camera.ZoomFactor = 1.2; 
    3239        Camera.StayInLevel = true; 
     40 
     41        kiihtyvyysajastin = new Timer(); 
     42        kiihtyvyysajastin.Interval = 1; 
     43        kiihtyvyysajastin.Timeout += Kiihdytys; 
     44        kiihtyvyysajastin.Start(); 
    3345    } 
    3446 
     
    116128       Timer.SingleShot(0.5, Begin); 
    117129   } 
     130 
     131    void Kiihdytys() 
     132    { 
     133        if (Gravity.Y < -500) 
     134        { 
     135            kiihtyvyysajastin.Stop(); 
     136        } 
     137        Gravity = Gravity - new Vector(0, 25); 
     138    } 
     139 
     140    void Alkuvalikko() 
     141    { 
     142        MultiSelectWindow alkuValikko = new MultiSelectWindow("Valitse pelihahmo", "Herkko Hemiläinen", "Sateenkaariponi", "Kääpiö",  
     143            "Poistu"); 
     144        alkuValikko.AddItemHandler(0, ValitseHerkko); 
     145        alkuValikko.AddItemHandler(1, ValitseESPoni); 
     146        alkuValikko.AddItemHandler(2, ValitseKaapio); 
     147        alkuValikko.AddItemHandler(3, Exit); 
     148        alkuValikko.DefaultCancel = 3; 
     149        Add(alkuValikko); 
     150    } 
     151 
     152    void ValitseHerkko() 
     153    { 
     154        pelaajanKuva = LoadImage("herkko"); 
     155        AloitaKentta(); 
     156    } 
     157 
     158    void ValitseESPoni() 
     159    { 
     160        pelaajanKuva = LoadImage("esponi"); 
     161        AloitaKentta(); 
     162    } 
     163 
     164    void ValitseKaapio() 
     165    { 
     166        pelaajanKuva = LoadImage("kaapio"); 
     167        AloitaKentta(); 
     168    } 
    118169} 
  • 2015/30/EllenH/OmaPeli/OmaPeli/OmaPeli/OmaPeli.csproj.Debug.cachefile

    r6909 r6924  
    66Content\esponi.xnb 
    77Content\es.xnb 
     8Content\kaapio.xnb 
  • 2015/30/EllenH/OmaPeli/OmaPeli/OmaPeli/obj/x86/Debug/OmaPeli.csproj.FileListAbsolute.txt

    r6909 r6924  
    1414C:\MyTemp\EllenH\OmaPeli\OmaPeli\OmaPeli\bin\x86\Debug\Content\esponi.xnb 
    1515C:\MyTemp\EllenH\OmaPeli\OmaPeli\OmaPeli\bin\x86\Debug\Content\es.xnb 
     16C:\MyTemp\EllenH\OmaPeli\OmaPeli\OmaPeli\bin\x86\Debug\Content\kaapio.xnb 
  • 2015/30/EllenH/OmaPeli/OmaPeli/OmaPeli/obj/x86/Debug/cachefile-{128CCA7D-2017-4F3A-B4A1-A70BDF9EB76C}-targetpath.txt

    r6909 r6924  
    66Content\esponi.xnb 
    77Content\es.xnb 
     8Content\kaapio.xnb 
  • 2015/30/EllenH/OmaPeli/OmaPeli/OmaPeliContent/OmaPeliContent.contentproj

    r6909 r6924  
    8888    </Compile> 
    8989  </ItemGroup> 
     90  <ItemGroup> 
     91    <Compile Include="kaapio.png"> 
     92      <Name>kaapio</Name> 
     93      <Importer>TextureImporter</Importer> 
     94      <Processor>TextureProcessor</Processor> 
     95    </Compile> 
     96  </ItemGroup> 
    9097  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    9198  <!--  To modify your build process, add your task inside one of the targets below and uncomment it.  
  • 2015/30/EllenH/OmaPeli/OmaPeli/OmaPeliContent/kentta1.txt

    r6909 r6924  
    112112...............*............ 
    113113................*........... 
    114 ............................ 
    115 ............................ 
    116 ............................ 
    117 ............................ 
     114...............*............ 
     115..............**.####....... 
     116..............**............ 
     117.............****........... 
    118118............................ 
    119119............................ 
  • 2015/30/EllenH/OmaPeli/OmaPeli/OmaPeliContent/obj/x86/Debug/ContentPipeline.xml

    r6909 r6924  
    3636      <Options>None</Options> 
    3737      <Output>C:\MyTemp\EllenH\OmaPeli\OmaPeli\OmaPeli\bin\x86\Debug\Content\kentta1.xnb</Output> 
    38       <Time>2015-07-22T11:45:41.1387073+03:00</Time> 
     38      <Time>2015-07-22T12:41:11.7636181+03:00</Time> 
    3939    </Item> 
    4040    <Item> 
     
    6464      <Output>C:\MyTemp\EllenH\OmaPeli\OmaPeli\OmaPeli\bin\x86\Debug\Content\es.xnb</Output> 
    6565      <Time>2015-07-22T11:30:53.0268301+03:00</Time> 
     66    </Item> 
     67    <Item> 
     68      <Source>kaapio.png</Source> 
     69      <Name>kaapio</Name> 
     70      <Importer>TextureImporter</Importer> 
     71      <Processor>TextureProcessor</Processor> 
     72      <Options>None</Options> 
     73      <Output>C:\MyTemp\EllenH\OmaPeli\OmaPeli\OmaPeli\bin\x86\Debug\Content\kaapio.xnb</Output> 
     74      <Time>2015-07-22T14:21:21.1102347+03:00</Time> 
    6675    </Item> 
    6776    <BuildSuccessful>true</BuildSuccessful> 
Note: See TracChangeset for help on using the changeset viewer.