Changeset 4953


Ignore:
Timestamp:
2014-06-11 14:55:15 (9 years ago)
Author:
sasosorv
Message:
 
Location:
2014/24/SanniS/Tasohyppelypeli2idk_new
Files:
16 added
3 deleted
15 edited

Legend:

Unmodified
Added
Removed
  • 2014/24/SanniS/Tasohyppelypeli2idk_new/Tasohyppelypeli2idk_new.sln

    r4940 r4953  
    22Microsoft Visual Studio Solution File, Format Version 11.00 
    33# Visual Studio 2010 
    4 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tasohyppelypeli2idk_new", "Tasohyppelypeli2idk_new\Tasohyppelypeli2idk_new\Tasohyppelypeli2idk_new.csproj", "{5BD77BA0-897F-4BD2-9B85-07D31A1C5E1B}" 
     4Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "needkaffeine", "Tasohyppelypeli2idk_new\Tasohyppelypeli2idk_new\needkaffeine.csproj", "{5BD77BA0-897F-4BD2-9B85-07D31A1C5E1B}" 
    55EndProject 
    6 Project("{96E2B04D-8817-42C6-938A-82C39BA4D311}") = "tasohyppely", "Tasohyppelypeli2idk_new\Tasohyppelypeli2idk_newContent\tasohyppely.contentproj", "{E3F42B96-D200-4A60-B141-89E671674F57}" 
     6Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "tasohyppely", "Tasohyppelypeli2idk_new\Tasohyppelypeli2idk_newContent\tasohyppely.contentproj", "{E3F42B96-D200-4A60-B141-89E671674F57}" 
    77EndProject 
    88Global 
  • 2014/24/SanniS/Tasohyppelypeli2idk_new/Tasohyppelypeli2idk_new/Tasohyppelypeli2idk_new/Tasohyppelypeli2idk_new.cs

    r4940 r4953  
    1111    const double nopeus = 200; 
    1212    const double hyppyNopeus = 750; 
    13     const int RUUDUN_KOKO = 40; 
     13 
     14     
     15    const int RUUDUN_KOKO = 70; 
    1416 
    1517    PlatformCharacter pelaaja1; 
     18 
     19      
    1620 
    1721    Image pelaajanKuva = LoadImage("kehveli"); 
    1822    Image tahtiKuva = LoadImage("kuppi"); 
    1923    Image taustaKuva = LoadImage("tausta"); 
    20  
    21     SoundEffect maaliAani = LoadSoundEffect("maali"); 
    22  
     24     
     25     
     26     
    2327    public override void Begin() 
    2428    { 
    25         Gravity = new Vector(0, -1000); 
    2629 
     30         
     31         
    2732        LuoKentta(); 
    2833        LisaaNappaimet(); 
    29  
    30         Camera.Follow(pelaaja1); 
    31         Camera.ZoomFactor = 1.2; 
    32         Camera.StayInLevel = true; 
     34        
    3335    } 
    3436 
    3537    void LuoKentta() 
    3638    { 
    37         TileMap kentta = TileMap.FromLevelAsset("kentta1"); 
    38         kentta.SetTileMethod('#', LisaaTaso); 
    39         kentta.SetTileMethod('*', LisaaTahti); 
    40         kentta.SetTileMethod('N', LisaaPelaaja); 
    41         kentta.Execute(RUUDUN_KOKO, RUUDUN_KOKO); 
    42          
     39        ColorTileMap ruudut = ColorTileMap.FromLevelAsset("kentta22"); 
     40        ruudut.SetTileMethod(Color.Rose, LisaaPelaaja); 
     41        ruudut.SetTileMethod(Color.Red, LisaaTahti); 
     42        ruudut.SetTileMethod(Color.Black, LisaaTaso); 
     43 
     44        ruudut.Execute(20, 20); 
     45        
     46        Gravity = new Vector (0.0, -800.0); 
     47 
    4348        Level.Background.Image = taustaKuva; 
    44      
     49        Camera.ZoomToLevel(); 
     50        Level.Background.FitToLevel(); 
     51        Level.Background.ScaleToLevelByWidth(); 
     52 
    4553    } 
    4654 
     
    6169        tahti.Tag = "kuppi"; 
    6270        Add(tahti); 
     71     
    6372    } 
    64  
     73     
    6574    void LisaaPelaaja(Vector paikka, double leveys, double korkeus) 
    6675    { 
    6776        pelaaja1 = new PlatformCharacter(leveys, korkeus); 
    6877        pelaaja1.Position = paikka; 
    69         pelaaja1.Mass = 15.0; 
     78         
     79         
    7080        pelaaja1.Image = pelaajanKuva; 
    7181        AddCollisionHandler(pelaaja1, "kuppi", TormaaTahteen); 
     
    7787        Keyboard.Listen(Key.F1, ButtonState.Pressed, ShowControlHelp, "Näytä ohjeet"); 
    7888        Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 
     89         
    7990 
    8091        Keyboard.Listen(Key.Left, ButtonState.Down, Liikuta, "Liikkuu vasemmalle", pelaaja1, -nopeus); 
    8192        Keyboard.Listen(Key.Right, ButtonState.Down, Liikuta, "Liikkuu vasemmalle", pelaaja1, nopeus); 
    82         Keyboard.Listen(Key.Up, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", pelaaja1, hyppyNopeus); 
    83  
     93       Keyboard.Listen(Key.Up, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", pelaaja1, hyppyNopeus); 
    8494        ControllerOne.Listen(Button.Back, ButtonState.Pressed, Exit, "Poistu pelistä"); 
    8595 
    8696        ControllerOne.Listen(Button.DPadLeft, ButtonState.Down, Liikuta, "Pelaaja liikkuu vasemmalle", pelaaja1, -nopeus); 
    8797        ControllerOne.Listen(Button.DPadRight, ButtonState.Down, Liikuta, "Pelaaja liikkuu oikealle", pelaaja1, nopeus); 
    88         ControllerOne.Listen(Button.A, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", pelaaja1, hyppyNopeus); 
    89  
     98      ControllerOne.Listen(Button.A, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", pelaaja1, hyppyNopeus); 
    9099        PhoneBackButton.Listen(ConfirmExit, "Lopeta peli"); 
    91100    } 
     
    94103    { 
    95104        hahmo.Walk(nopeus); 
    96     } 
    97105 
    98     void Hyppaa(PlatformCharacter hahmo, double nopeus) 
     106        } 
     107        void Hyppaa(PlatformCharacter hahmo, double nopeus) 
    99108    { 
    100109        hahmo.Jump(nopeus); 
     110         
     111 
     112     
    101113    } 
    102114 
    103115    void TormaaTahteen(PhysicsObject hahmo, PhysicsObject tahti) 
    104116    { 
    105         maaliAani.Play(); 
    106         MessageDisplay.Add("Keräsit tähden!"); 
     117         
     118        MessageDisplay.Add("KAHVIAArrgghh"); 
     119        MessageDisplay.TextColor = Color.Cyan; 
    107120        tahti.Destroy(); 
     121 
     122         
     123 
    108124    } 
     125 
     126     
    109127} 
  • 2014/24/SanniS/Tasohyppelypeli2idk_new/Tasohyppelypeli2idk_new/Tasohyppelypeli2idk_new/obj/x86/Debug/ContentPipeline-{E3F42B96-D200-4A60-B141-89E671674F57}.xml

    r4940 r4953  
    3636      <Options>None</Options> 
    3737      <Output>C:\MyTemp\SanniS\Tasohyppelypeli2idk_new\Tasohyppelypeli2idk_new\Tasohyppelypeli2idk_new\bin\x86\Debug\Content\kentta1.xnb</Output> 
    38       <Time>2014-06-10T14:55:52.3181993+03:00</Time> 
     38      <Time>2014-06-11T13:17:02.0059604+03:00</Time> 
    3939    </Item> 
    4040    <Item> 
     
    4545      <Options>None</Options> 
    4646      <Output>C:\MyTemp\SanniS\Tasohyppelypeli2idk_new\Tasohyppelypeli2idk_new\Tasohyppelypeli2idk_new\bin\x86\Debug\Content\kehveli.xnb</Output> 
    47       <Time>2014-06-10T13:53:54.7244489+03:00</Time> 
     47      <Time>2014-06-11T14:44:12.7238971+03:00</Time> 
    4848    </Item> 
    4949    <Item> 
     
    5757    </Item> 
    5858    <Item> 
    59       <Source>kentta2.png</Source> 
    60       <Name>kentta2</Name> 
    61       <Importer>TextureImporter</Importer> 
    62       <Processor>TextureProcessor</Processor> 
    63       <Options>None</Options> 
    64       <Output>C:\MyTemp\SanniS\Tasohyppelypeli2idk_new\Tasohyppelypeli2idk_new\Tasohyppelypeli2idk_new\bin\x86\Debug\Content\kentta2.xnb</Output> 
    65       <Time>2014-06-10T14:20:06.5257302+03:00</Time> 
    66     </Item> 
    67     <Item> 
    6859      <Source>kuppi.png</Source> 
    6960      <Name>kuppi</Name> 
     
    7364      <Output>C:\MyTemp\SanniS\Tasohyppelypeli2idk_new\Tasohyppelypeli2idk_new\Tasohyppelypeli2idk_new\bin\x86\Debug\Content\kuppi.xnb</Output> 
    7465      <Time>2014-06-10T14:51:40.7260426+03:00</Time> 
     66    </Item> 
     67    <Item> 
     68      <Source>katti.png</Source> 
     69      <Name>katti</Name> 
     70      <Importer>TextureImporter</Importer> 
     71      <Processor>TextureProcessor</Processor> 
     72      <Options>None</Options> 
     73      <Output>C:\MyTemp\SanniS\Tasohyppelypeli2idk_new\Tasohyppelypeli2idk_new\Tasohyppelypeli2idk_new\bin\x86\Debug\Content\katti.xnb</Output> 
     74      <Time>2014-06-11T11:48:49.2937139+03:00</Time> 
     75    </Item> 
     76    <Item> 
     77      <Source>kentta22.png</Source> 
     78      <Name>kentta22</Name> 
     79      <Importer>TextureImporter</Importer> 
     80      <Processor>TextureProcessor</Processor> 
     81      <Options>None</Options> 
     82      <Output>C:\MyTemp\SanniS\Tasohyppelypeli2idk_new\Tasohyppelypeli2idk_new\Tasohyppelypeli2idk_new\bin\x86\Debug\Content\kentta22.xnb</Output> 
     83      <Time>2014-06-11T14:18:59.0953235+03:00</Time> 
     84    </Item> 
     85    <Item> 
     86      <Source>ukko.png</Source> 
     87      <Name>ukko</Name> 
     88      <Importer>TextureImporter</Importer> 
     89      <Processor>TextureProcessor</Processor> 
     90      <Options>None</Options> 
     91      <Output>C:\MyTemp\SanniS\Tasohyppelypeli2idk_new\Tasohyppelypeli2idk_new\Tasohyppelypeli2idk_new\bin\x86\Debug\Content\ukko.xnb</Output> 
     92      <Time>2014-06-11T14:22:50.2853235+03:00</Time> 
     93    </Item> 
     94    <Item> 
     95      <Source>orkki.png</Source> 
     96      <Name>orkki</Name> 
     97      <Importer>TextureImporter</Importer> 
     98      <Processor>TextureProcessor</Processor> 
     99      <Options>None</Options> 
     100      <Output>C:\MyTemp\SanniS\Tasohyppelypeli2idk_new\Tasohyppelypeli2idk_new\Tasohyppelypeli2idk_new\bin\x86\Debug\Content\orkki.xnb</Output> 
     101      <Time>2014-06-11T14:42:21.6350971+03:00</Time> 
    75102    </Item> 
    76103    <BuildSuccessful>true</BuildSuccessful> 
  • 2014/24/SanniS/Tasohyppelypeli2idk_new/Tasohyppelypeli2idk_new/Tasohyppelypeli2idk_new/obj/x86/Debug/Tasohyppelypeli2idk_new.csproj.FileListAbsolute.txt

    r4940 r4953  
    1414C:\MyTemp\SanniS\Tasohyppelypeli2idk_new\Tasohyppelypeli2idk_new\Tasohyppelypeli2idk_new\bin\x86\Debug\Content\kentta2.xnb 
    1515C:\MyTemp\SanniS\Tasohyppelypeli2idk_new\Tasohyppelypeli2idk_new\Tasohyppelypeli2idk_new\bin\x86\Debug\Content\kuppi.xnb 
     16C:\MyTemp\SanniS\Tasohyppelypeli2idk_new\Tasohyppelypeli2idk_new\Tasohyppelypeli2idk_new\obj\x86\Debug\Tasohyppelypeli2idk_new.csprojResolveAssemblyReference.cache 
  • 2014/24/SanniS/Tasohyppelypeli2idk_new/Tasohyppelypeli2idk_new/Tasohyppelypeli2idk_new/obj/x86/Debug/cachefile-{E3F42B96-D200-4A60-B141-89E671674F57}-targetpath.txt

    r4940 r4953  
    55Content\kehveli.xnb 
    66Content\tausta.xnb 
    7 Content\kentta2.xnb 
    87Content\kuppi.xnb 
     8Content\katti.xnb 
     9Content\kentta22.xnb 
     10Content\ukko.xnb 
     11Content\orkki.xnb 
  • 2014/24/SanniS/Tasohyppelypeli2idk_new/Tasohyppelypeli2idk_new/Tasohyppelypeli2idk_newContent/kentta1.txt

    r4940 r4953  
    1      
    2   * 
    3   #                   * 
    4   # * #        #### 
    5   ######## ## 
    6             #### 
    7                                 ###                           
    8   *         N       #### * 
    9   ##            ####    #####   
    10 #               #######   
    11 ##       
    12 ########## * ###### * ########     ## 
    13 ######################       ##  *  ## 
    14                               ######  
     1 
     2 
     3 
     4                                                                         * 
     5         N                                                                                                                   ####### 
     6   #####                                                                                              ###### ##### 
     7                                                     ##### 
     8                                                                                                                                                             *  
     9               *                                  ###########                                      #### 
     10             #####                            ######             ##                            #########  
     11                                         ########              # ######                   * ####    
     12  *  ##########                     ##########               ##       ##               ####### 
     13######    #############    R    #########    #              ###       ##             ####    
     14                   ##############            #        #############   ## *         ##### 
     15                                                             #  *   ########          ############## 
     16                                              ####### 
  • 2014/24/SanniS/Tasohyppelypeli2idk_new/Tasohyppelypeli2idk_new/Tasohyppelypeli2idk_newContent/tasohyppely.contentproj

    r4940 r4953  
    8282  </ItemGroup> 
    8383  <ItemGroup> 
    84     <Compile Include="kentta2.png"> 
    85       <Name>kentta2</Name> 
     84    <Compile Include="kuppi.png"> 
     85      <Name>kuppi</Name> 
    8686      <Importer>TextureImporter</Importer> 
    8787      <Processor>TextureProcessor</Processor> 
     
    8989  </ItemGroup> 
    9090  <ItemGroup> 
    91     <Compile Include="kuppi.png"> 
    92       <Name>kuppi</Name> 
     91    <Compile Include="katti.png"> 
     92      <Name>katti</Name> 
     93      <Importer>TextureImporter</Importer> 
     94      <Processor>TextureProcessor</Processor> 
     95    </Compile> 
     96  </ItemGroup> 
     97  <ItemGroup> 
     98    <Compile Include="kentta22.png"> 
     99      <Name>kentta22</Name> 
     100      <Importer>TextureImporter</Importer> 
     101      <Processor>TextureProcessor</Processor> 
     102    </Compile> 
     103  </ItemGroup> 
     104  <ItemGroup> 
     105    <Compile Include="ukko.png"> 
     106      <Name>ukko</Name> 
     107      <Importer>TextureImporter</Importer> 
     108      <Processor>TextureProcessor</Processor> 
     109    </Compile> 
     110  </ItemGroup> 
     111  <ItemGroup> 
     112    <Compile Include="orkki.png"> 
     113      <Name>orkki</Name> 
    93114      <Importer>TextureImporter</Importer> 
    94115      <Processor>TextureProcessor</Processor> 
Note: See TracChangeset for help on using the changeset viewer.