Changeset 2991


Ignore:
Timestamp:
2012-06-13 14:52:56 (11 years ago)
Author:
vievkang
Message:

Talletus.

Location:
2012/24/VilmaK/Tasohyppelypeli1
Files:
16 added
18 edited

Legend:

Unmodified
Added
Removed
  • 2012/24/VilmaK/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1.cs

    r2973 r2991  
    1414    double ruudunKorkeus; 
    1515    int ruudunKoko = 40; 
     16    int kaikkiTimantit = 0; 
    1617 
    1718    PlatformCharacter pelaaja1; 
     
    2122 
    2223    SoundEffect maaliAani = LoadSoundEffect("maali"); 
     24 
     25    IntMeter timanttiLaskuri;  
    2326 
    2427    public override void Begin() 
     
    3033        lisaaNappaimet(); 
    3134        Image taustaKuva = LoadImage("rantatausta"); 
    32          
    33  
    3435        Level.Background.Image = taustaKuva; 
    3536        Level.Background.FitToLevel(); 
    36  
    37  
    38  
    3937        Camera.ZoomToLevel(); 
    4038        // Camera.ZoomToAllObjects(); 
    41         Camera.StayInLevel = true; 
     39        //Camera.StayInLevel = true; 
    4240        //Camera.Follow(pelaaja1); 
    4341    } 
     
    4543    void luoKentta() 
    4644    { 
     45        timanttiLaskuri = new IntMeter(0, 0, int.MaxValue); 
     46        timanttiLaskuri.LowerLimit += delegate { MessageDisplay.Add("Kaikki timantit kerätty"); }; 
    4747        TileMap kentta = TileMap.FromLevelAsset("kentta1"); 
    4848        kentta.SetTileMethod('b', lisaaTaso); 
    4949        kentta.SetTileMethod('*', lisaaTimantti); 
    5050        kentta.SetTileMethod('P', lisaaPelaaja); 
    51         kentta.SetTileMethod('m', lisaaMaa); 
     51        kentta.SetTileMethod('m', lisaaHiekka); 
     52        kentta.SetTileMethod('g', lisaaMaa); 
     53        kentta.SetTileMethod('l', lisaaLiaani); 
     54        kentta.SetTileMethod('t', lisaaLaava); 
     55        kentta.SetTileMethod('v', lisaaVesi); 
     56        //kentta.SetTileMethod('j', lisaaJaa); 
     57       // kentta.SetTileMethod('J', lisaaJaaPuikko); 
     58 
    5259        ruudunLeveys = Screen.Width / kentta.GetLength(1); 
    5360        ruudunKorkeus = Screen.Height / kentta.GetLength(0); 
    5461        kentta.Execute(ruudunLeveys, ruudunKorkeus); 
     62        timanttiLaskuri.Value = kaikkiTimantit; 
    5563        Level.CreateBorders(); 
    5664        // Level.Background.CreateGradient(Color.White, Color.SkyBlue); 
    5765        Level.BackgroundColor = Color.Yellow; 
    58     } 
     66 
     67        LuoEpatasainenMaasto(); 
     68    } 
     69 
     70    void LuoEpatasainenMaasto() 
     71    { 
     72 
     73        CollisionShapeParameters csp = new CollisionShapeParameters(); 
     74        csp.DistanceGridSpacing = 10; 
     75        csp.MaxVertexDistance = 10; 
     76 
     77        Surface ylareuna = new Surface(Level.Width, 
     78            Level.Height / 200, // ylin kohta yläreunassa 
     79            Level.Height / 8, // alin kohta 
     80            RandomGen.NextInt(50, 100), // kuinka monta piikkiä 
     81            csp); 
     82        ylareuna.Angle = Angle.FromDegrees(180); 
     83        ylareuna.Left = Level.Left; 
     84        ylareuna.Top = Level.Top; 
     85        ylareuna.TextureFillsShape = true; 
     86        ylareuna.Color = Color.LightBlue; 
     87        // Toivottavasti saadaan allaoleva toimimaan kurssin aikana 
     88        // ylareuna.Image = Image.FromGradient((int)ylareuna.Width, (int)ylareuna.Height, Color.White, Color.Black); 
     89        Add(ylareuna); 
     90    } 
     91 
     92    //void lisaaJaaPuikko(Vector paikka, double leveys, double korkeus) 
     93    //{ 
     94    //    PhysicsObject puikko = PhysicsObject.CreateStaticObject(leveys, korkeus); 
     95    //    puikko.Position = paikka; 
     96    //    puikko.Image = LoadImage("jaa"); 
     97    //    Add(puikko); 
     98   // } 
     99    //void lisaaJaa(Vector paikka, double leveys, double korkeus) 
     100    //{ 
     101    //    PhysicsObject jaa = PhysicsObject.CreateStaticObject(leveys, korkeus); 
     102    //    jaa.Position = paikka; 
     103    //    jaa.Color = new Color(40, 165, 255); 
     104    //    Add(jaa); 
     105   // } 
     106 
     107    //void lisaaJaa(Vector paikka, double leveys, double korkeus) 
     108    //{ 
     109    //    PhysicsObject jaa = PhysicsObject.CreateStaticObject(leveys, korkeus); 
     110    //    jaa.Position = paikka; 
     111    //    jaa.Image = LoadImage("jaa"); 
     112    //    Add(jaa); 
     113    //} 
     114 
     115    void lisaaVesi(Vector paikka, double leveys, double korkeus) 
     116    { 
     117        PhysicsObject vesi = PhysicsObject.CreateStaticObject(leveys, korkeus); 
     118        vesi.Position = paikka; 
     119        vesi.Image = LoadImage("vesi"); 
     120        Add(vesi); 
     121    } 
     122 
     123    void lisaaLaava(Vector paikka, double leveys, double korkeus) 
     124    { 
     125        PhysicsObject laava = PhysicsObject.CreateStaticObject(leveys, korkeus); 
     126        laava.Position = paikka; 
     127        laava.Image = LoadImage("laava"); 
     128        Add(laava); 
     129    } 
     130 
     131    void lisaaLiaani(Vector paikka, double leveys, double korkeus) 
     132    { 
     133        PhysicsObject liaani = PhysicsObject.CreateStaticObject(leveys, korkeus); 
     134        liaani.Position = paikka; 
     135        liaani.Image = LoadImage("liaani"); 
     136        Add(liaani); 
     137    } 
     138 
    59139 
    60140    void lisaaMaa(Vector paikka, double leveys, double korkeus) 
     
    62142        PhysicsObject maa = PhysicsObject.CreateStaticObject(leveys, korkeus); 
    63143        maa.Position = paikka; 
     144        maa.Image = LoadImage("viidakko"); 
     145        Add(maa); 
     146    } 
     147 
     148    void lisaaHiekka(Vector paikka, double leveys, double korkeus) 
     149    { 
     150        PhysicsObject hiekka = PhysicsObject.CreateStaticObject(leveys, korkeus); 
     151        hiekka.Position = paikka; 
    64152        // maa.Color = Color.Brown; 
    65         maa.Image = LoadImage("hiekka"); 
    66         Add(maa); 
     153        hiekka.Image = LoadImage("hiekka"); 
     154        Add(hiekka); 
    67155    } 
    68156 
     
    84172        timantti.Color = Color.Orange; 
    85173        //timantti.Image = tahtiKuva; 
    86          timantti.Tag = "timantti"; 
     174        timantti.Tag = "timantti"; 
     175        timanttiLaskuri.Value++; 
    87176        Add(timantti); 
     177        kaikkiTimantit++; 
    88178    } 
    89179 
     
    131221        if (kohde.Tag.ToString() == "timantti") 
    132222        { 
    133             maaliAani.Play(); 
    134              
     223            //maaliAani.Play(); 
     224 
    135225            //MessageDisplay.Add("Keräsit timantin!"); 
     226            timanttiLaskuri.AddValue(-1); 
    136227            kohde.Destroy(); 
    137228        } 
  • 2012/24/VilmaK/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1.csproj.Debug.cachefile

    r2973 r2991  
    99Content\hiekka.xnb 
    1010Content\rantatausta.xnb 
     11Content\viidakko.xnb 
     12Content\liaani.xnb 
     13Content\laava.xnb 
     14Content\vesi.xnb 
     15Content\jaa.xnb 
     16Content\jaatikko.xnb 
     17Content\tulivuori.xnb 
     18Content\viidakkotausta.xnb 
  • 2012/24/VilmaK/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1/obj/x86/Debug/Tasohyppelypeli1.csproj.FileListAbsolute.txt

    r2973 r2991  
    2929C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Jypeli.dll 
    3030C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Jypeli.xml 
     31C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\viidakko.xnb 
     32C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\liaani.xnb 
     33C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\laava.xnb 
     34C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\vesi.xnb 
     35C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\jaa.xnb 
     36C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\jaatikko.xnb 
     37C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\tulivuori.xnb 
     38C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\viidakkotausta.xnb 
  • 2012/24/VilmaK/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1/obj/x86/Debug/cachefile-{3D11F9FF-84D7-4FD4-9CD5-2D7DDC927B82}-targetpath.txt

    r2973 r2991  
    99Content\hiekka.xnb 
    1010Content\rantatausta.xnb 
     11Content\viidakko.xnb 
     12Content\liaani.xnb 
     13Content\laava.xnb 
     14Content\vesi.xnb 
     15Content\jaa.xnb 
     16Content\jaatikko.xnb 
     17Content\tulivuori.xnb 
     18Content\viidakkotausta.xnb 
  • 2012/24/VilmaK/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1Content/Tasohyppelypeli1Content.contentproj

    r2973 r2991  
    114114    </Compile> 
    115115  </ItemGroup> 
     116  <ItemGroup> 
     117    <Compile Include="viidakko.png"> 
     118      <Name>viidakko</Name> 
     119      <Importer>TextureImporter</Importer> 
     120      <Processor>TextureProcessor</Processor> 
     121    </Compile> 
     122  </ItemGroup> 
     123  <ItemGroup> 
     124    <Compile Include="liaani.png"> 
     125      <Name>liaani</Name> 
     126      <Importer>TextureImporter</Importer> 
     127      <Processor>TextureProcessor</Processor> 
     128    </Compile> 
     129  </ItemGroup> 
     130  <ItemGroup> 
     131    <Compile Include="laava.png"> 
     132      <Name>laava</Name> 
     133      <Importer>TextureImporter</Importer> 
     134      <Processor>TextureProcessor</Processor> 
     135    </Compile> 
     136  </ItemGroup> 
     137  <ItemGroup> 
     138    <Compile Include="vesi.png"> 
     139      <Name>vesi</Name> 
     140      <Importer>TextureImporter</Importer> 
     141      <Processor>TextureProcessor</Processor> 
     142    </Compile> 
     143  </ItemGroup> 
     144  <ItemGroup> 
     145    <Compile Include="jaa.png"> 
     146      <Name>jaa</Name> 
     147      <Importer>TextureImporter</Importer> 
     148      <Processor>TextureProcessor</Processor> 
     149    </Compile> 
     150  </ItemGroup> 
     151  <ItemGroup> 
     152    <Compile Include="jaatikko.png"> 
     153      <Name>jaatikko</Name> 
     154      <Importer>TextureImporter</Importer> 
     155      <Processor>TextureProcessor</Processor> 
     156    </Compile> 
     157  </ItemGroup> 
     158  <ItemGroup> 
     159    <Compile Include="tulivuori.png"> 
     160      <Name>tulivuori</Name> 
     161      <Importer>TextureImporter</Importer> 
     162      <Processor>TextureProcessor</Processor> 
     163    </Compile> 
     164  </ItemGroup> 
     165  <ItemGroup> 
     166    <Compile Include="viidakkotausta.png"> 
     167      <Name>viidakkotausta</Name> 
     168      <Importer>TextureImporter</Importer> 
     169      <Processor>TextureProcessor</Processor> 
     170    </Compile> 
     171  </ItemGroup> 
    116172  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    117173  <!--  To modify your build process, add your task inside one of the targets below and uncomment it.  
  • 2012/24/VilmaK/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1Content/kentta3.txt

    r2947 r2991  
    1616xt            bbbb            bbbb                                 tx 
    1717xt                                                                 tx 
    18 xtttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttx 
    19 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     18ttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt 
  • 2012/24/VilmaK/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1Content/kentta4.txt

    r2947 r2991  
    1 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    2 xjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjx 
    3 xj    jj    j    jj    jj    jj    jjj    jjjjj    jj    jjjjj    jjx 
    4 x    jj    j    j      jj          jjj        j        j j      j   x 
    5 x    j        j                  j           jj                j    x 
     1jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj 
     2jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj 
     3jj    jj    j    jj    jj    jj    jjj    jjjjj    jj    jjjjj    jjj 
     4x    jj    J    j      jj          jjj        j        j j      j   x 
     5x    J        J                  j           jj                j    x 
    66x                                        j                          x 
    77x                    bbb                                       bbbb x 
     
    1616x   bbbbb       bbbbb                    bbbb                       x 
    1717x                                                                   x 
    18 xvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvx 
    19 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     18vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv 
     19vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv 
  • 2012/24/VilmaK/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1Content/obj/x86/Debug/ContentPipeline.xml

    r2973 r2991  
    2727      <Options>None</Options> 
    2828      <Output>C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\Pingviini.xnb</Output> 
    29       <Time>2012-06-13T09:46:04.9593471+03:00</Time> 
     29      <Time>2012-06-13T13:34:48.622865+03:00</Time> 
    3030    </Item> 
    3131    <Item> 
     
    4545      <Options>None</Options> 
    4646      <Output>C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\kentta2.xnb</Output> 
    47       <Time>2012-06-13T09:38:06.8195471+03:00</Time> 
     47      <Time>2012-06-13T10:38:37.0880101+03:00</Time> 
    4848    </Item> 
    4949    <Item> 
     
    5454      <Options>None</Options> 
    5555      <Output>C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\kentta3.xnb</Output> 
    56       <Time>2012-06-13T09:38:06.8195471+03:00</Time> 
     56      <Time>2012-06-13T11:57:44.6272101+03:00</Time> 
    5757    </Item> 
    5858    <Item> 
     
    6363      <Options>None</Options> 
    6464      <Output>C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\kentta4.xnb</Output> 
    65       <Time>2012-06-13T09:38:06.8975471+03:00</Time> 
     65      <Time>2012-06-13T12:14:14.4592581+03:00</Time> 
    6666    </Item> 
    6767    <Item> 
     
    9191      <Output>C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\rantatausta.xnb</Output> 
    9292      <Time>2012-06-13T10:01:45.3823383+03:00</Time> 
     93    </Item> 
     94    <Item> 
     95      <Source>viidakko.png</Source> 
     96      <Name>viidakko</Name> 
     97      <Importer>TextureImporter</Importer> 
     98      <Processor>TextureProcessor</Processor> 
     99      <Options>None</Options> 
     100      <Output>C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\viidakko.xnb</Output> 
     101      <Time>2012-06-13T11:34:19.3578101+03:00</Time> 
     102    </Item> 
     103    <Item> 
     104      <Source>liaani.png</Source> 
     105      <Name>liaani</Name> 
     106      <Importer>TextureImporter</Importer> 
     107      <Processor>TextureProcessor</Processor> 
     108      <Options>None</Options> 
     109      <Output>C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\liaani.xnb</Output> 
     110      <Time>2012-06-13T11:43:47.4038101+03:00</Time> 
     111    </Item> 
     112    <Item> 
     113      <Source>laava.png</Source> 
     114      <Name>laava</Name> 
     115      <Importer>TextureImporter</Importer> 
     116      <Processor>TextureProcessor</Processor> 
     117      <Options>None</Options> 
     118      <Output>C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\laava.xnb</Output> 
     119      <Time>2012-06-13T11:56:39.5902101+03:00</Time> 
     120    </Item> 
     121    <Item> 
     122      <Source>vesi.png</Source> 
     123      <Name>vesi</Name> 
     124      <Importer>TextureImporter</Importer> 
     125      <Processor>TextureProcessor</Processor> 
     126      <Options>None</Options> 
     127      <Output>C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\vesi.xnb</Output> 
     128      <Time>2012-06-13T12:03:52.5130101+03:00</Time> 
     129    </Item> 
     130    <Item> 
     131      <Source>jaa.png</Source> 
     132      <Name>jaa</Name> 
     133      <Importer>TextureImporter</Importer> 
     134      <Processor>TextureProcessor</Processor> 
     135      <Options>None</Options> 
     136      <Output>C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\jaa.xnb</Output> 
     137      <Time>2012-06-13T12:13:17.3952457+03:00</Time> 
     138    </Item> 
     139    <Item> 
     140      <Source>jaatikko.png</Source> 
     141      <Name>jaatikko</Name> 
     142      <Importer>TextureImporter</Importer> 
     143      <Processor>TextureProcessor</Processor> 
     144      <Options>None</Options> 
     145      <Output>C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\jaatikko.xnb</Output> 
     146      <Time>2012-06-13T14:42:11.6504652+03:00</Time> 
     147    </Item> 
     148    <Item> 
     149      <Source>tulivuori.png</Source> 
     150      <Name>tulivuori</Name> 
     151      <Importer>TextureImporter</Importer> 
     152      <Processor>TextureProcessor</Processor> 
     153      <Options>None</Options> 
     154      <Output>C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\tulivuori.xnb</Output> 
     155      <Time>2012-06-13T14:19:55.779665+03:00</Time> 
     156    </Item> 
     157    <Item> 
     158      <Source>viidakkotausta.png</Source> 
     159      <Name>viidakkotausta</Name> 
     160      <Importer>TextureImporter</Importer> 
     161      <Processor>TextureProcessor</Processor> 
     162      <Options>None</Options> 
     163      <Output>C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\viidakkotausta.xnb</Output> 
     164      <Time>2012-06-13T14:15:18.910865+03:00</Time> 
    93165    </Item> 
    94166    <BuildSuccessful>true</BuildSuccessful> 
Note: See TracChangeset for help on using the changeset viewer.