Changeset 6988


Ignore:
Timestamp:
2015-07-23 14:59:25 (8 years ago)
Author:
tomikkon
Message:
 
Location:
2015/30/TomiM/Tasohyppelypeli
Files:
11 added
5 deleted
14 edited

Legend:

Unmodified
Added
Removed
  • 2015/30/TomiM/Tasohyppelypeli/Tasohyppelypeli/Tasohyppelypeli/Tasohyppelypeli.cs

    r6968 r6988  
    2020    Image setelikuva = LoadImage("seteli"); 
    2121    Image vihollisenKuva = LoadImage("vihollinen"); 
     22    Image setelikuva2 = LoadImage("seteli2"); 
     23    Image palikkakuva = LoadImage("palikka"); 
     24    Image palikkakuva2 = LoadImage("palikka2"); 
     25    Image maaalikuva = LoadImage("maaali"); 
    2226 
    2327    SoundEffect maaliAani = LoadSoundEffect("maali"); 
     
    6367        kentta.SetTileMethod('V', LisaaVihollinen); 
    6468        kentta.SetTileMethod('S', LisaaSeteli); 
     69        kentta.SetTileMethod('1', LisaaSeteli2); 
     70        kentta.SetTileMethod('P', LisaaPalikka); 
     71        kentta.SetTileMethod('p', LisaaPalikka2); 
     72        kentta.SetTileMethod('M', LisaaMaali); 
     73 
    6574 
    6675 
     
    6978        Level.CreateBorders(); 
    7079        Level.Background.CreateGradient(Color.Blue, Color.SkyBlue); 
    71     } 
    72     void PelaajaTormasi(PhysicsObject vihollinen, PhysicsObject pelaaja1) 
    73     { 
    74  
    75         { 
    76  
    77         } 
     80     
     81     
    7882 
    7983 
     
    107111        AddCollisionHandler(pelaaja1, "kolikko", TormaaTahteen); 
    108112        AddCollisionHandler(pelaaja1, "pahis", PelaajaOsuu); 
     113        AddCollisionHandler(pelaaja1, "seteli", TormaaSeteliin); 
     114        AddCollisionHandler(pelaaja1, "seteli2", TormaaSeteliin2); 
     115        AddCollisionHandler(pelaaja1, "maali", TormaaMaaliin); 
    109116        Add(pelaaja1); 
    110117        pelaaja1.CanRotate = false; 
     
    151158        Keyboard.Listen(Key.Up, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", pelaaja1, hyppyNopeus); 
    152159 
    153         Keyboard.Listen(Key.Space, ButtonState.Down, AmmuAseella, "Ammu", pelaaja1); 
     160         
    154161 
    155162 
     
    180187        MessageDisplay.Add("Keräsit kolikon!"); 
    181188        tahti.Destroy(); 
     189        pisteLaskuri.Value += 1; 
    182190    } 
    183191    void PelaajaOsuu(PhysicsObject hahmo, PhysicsObject vihollinen) 
     
    206214 
    207215        Camera.Follow(pelaaja1); 
    208         Camera.ZoomFactor = 1.2; 
     216        Camera.ZoomFactor = 0.2; 
    209217        Camera.StayInLevel = true; 
    210218 
     
    231239        pisteNaytto.IntFormatString = "rahaa: {0:D1}"; 
    232240 
    233     } 
    234     void AmmuAseella(PlatformCharacter pelaaja1) 
    235     { 
    236         PhysicsObject ammus = pelaaja1.Weapon.Shoot(); 
     241     
     242     
    237243 
    238244    } 
     
    240246    { 
    241247        PhysicsObject seteli = PhysicsObject.CreateStaticObject(leveys, korkeus); 
    242         seteli .IgnoresCollisionResponse = true; 
     248        seteli.IgnoresCollisionResponse = true; 
    243249        seteli.Position = paikka; 
    244250        seteli.Image = setelikuva; 
     
    249255 
    250256    } 
    251  
    252 }     
    253  
    254  
    255  
    256        
    257      
    258  
    259  
    260  
    261      
    262  
     257    void TormaaSeteliin(PhysicsObject hahmo, PhysicsObject tahti) 
     258    { 
     259 
     260        maaliAani.Play(); 
     261        MessageDisplay.Add("Keräsit setelin!"); 
     262        tahti.Destroy(); 
     263        pisteLaskuri.Value += 5; 
     264    } 
     265 
     266    void LisaaSeteli2(Vector paikka, double leveys, double korkeus) 
     267    { 
     268        PhysicsObject seteli2 = PhysicsObject.CreateStaticObject(leveys, korkeus); 
     269        seteli2.IgnoresCollisionResponse = true; 
     270        seteli2.Position = paikka; 
     271        seteli2.Image = setelikuva2; 
     272        seteli2.Tag = "seteli2"; 
     273        Add(seteli2); 
     274    } 
     275    void TormaaSeteliin2(PhysicsObject hahmo, PhysicsObject tahti) 
     276    { 
     277 
     278        maaliAani.Play(); 
     279        MessageDisplay.Add("Keräsit setelin!"); 
     280        tahti.Destroy(); 
     281        pisteLaskuri.Value += 100; 
     282    } 
     283    void LisaaPalikka(Vector paikka, double leveys, double korkeus) 
     284    { 
     285        PhysicsObject palikka = PhysicsObject.CreateStaticObject(leveys, korkeus); 
     286        palikka.IgnoresCollisionResponse = true; 
     287        palikka.Position = paikka; 
     288        palikka.Image = palikkakuva; 
     289        palikka.Tag = "palikka"; 
     290        Add(palikka); 
     291 
     292 
     293 
     294 
     295    } 
     296    void LisaaPalikka2(Vector paikka, double leveys, double korkeus) 
     297    { 
     298        PhysicsObject palikka2 = PhysicsObject.CreateStaticObject(leveys, korkeus); 
     299        palikka2.IgnoresCollisionResponse = true; 
     300        palikka2.Position = paikka; 
     301        palikka2.Image = palikkakuva2; 
     302        palikka2.Tag = "palikka2"; 
     303        Add(palikka2); 
     304    } 
     305    void LisaaMaali(Vector paikka, double leveys, double korkeus) 
     306    { 
     307        PhysicsObject maali = PhysicsObject.CreateStaticObject(leveys, korkeus); 
     308        maali.IgnoresCollisionResponse = true; 
     309        maali.Position = paikka; 
     310        maali.Image = maaalikuva; 
     311        maali.Tag = "maali"; 
     312        Add(maali); 
     313 
     314 
     315    } 
     316    void TormaaMaaliin(PhysicsObject hahmo, PhysicsObject maali) 
     317    { 
     318        maaliAani.Play(); 
     319        MessageDisplay.Add("Läpäisit Tason!"); 
     320        SeuraavaKentta(); 
     321 
     322 
     323    } 
     324    void SeuraavaKentta() 
     325    { 
     326        ClearAll(); 
     327        LisaaNappaimet(); 
     328        LuoPistelaskuri(); 
     329        LuoKentta2(); 
     330 
     331 
     332        Gravity = new Vector(0, -1000); 
     333 
     334        Camera.Follow(pelaaja1); 
     335        Camera.ZoomFactor = 1.2; 
     336        Camera.StayInLevel = true; 
     337    } 
     338    void LuoKentta2() 
     339    { 
     340 
     341        LuoKentta(); 
     342        LisaaNappaimet(); 
     343        LuoPistelaskuri(); 
     344 
     345  
     346   } 
     347   
     348         
     349     
     350 
     351} 
     352 
  • 2015/30/TomiM/Tasohyppelypeli/Tasohyppelypeli/Tasohyppelypeli/Tasohyppelypeli.csproj.Debug.cachefile

    r6968 r6988  
    11Content\maali.xnb 
    2 Content\norsu.xnb 
    3 Content\tahti.xnb 
    42Content\kolikko.xnb 
    53Content\tyyppi3.xnb 
     
    119Content\tyyppi6.xnb 
    1210Content\kentta1.xnb 
     11Content\seteli.xnb 
     12Content\seteli2.xnb 
     13Content\palikka.xnb 
     14Content\palikka2.xnb 
     15Content\kentta.xnb 
    1316Content\kentta2.xnb 
    14 Content\seteli.xnb 
     17Content\maaali.xnb 
  • 2015/30/TomiM/Tasohyppelypeli/Tasohyppelypeli/Tasohyppelypeli/obj/x86/Debug/Tasohyppelypeli.csproj.FileListAbsolute.txt

    r6968 r6988  
    11C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\maali.xnb 
    2 C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\norsu.xnb 
    3 C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\tahti.xnb 
    42C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Tasohyppelypeli.exe 
    53C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Tasohyppelypeli.pdb 
     
    1917C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\tyyppi6.xnb 
    2018C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\kentta1.xnb 
     19C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\seteli.xnb 
     20C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\seteli2.xnb 
     21C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\palikka.xnb 
     22C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\palikka2.xnb 
     23C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\kentta.xnb 
    2124C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\kentta2.xnb 
    22 C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\seteli.xnb 
     25C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\maaali.xnb 
  • 2015/30/TomiM/Tasohyppelypeli/Tasohyppelypeli/Tasohyppelypeli/obj/x86/Debug/cachefile-{CA2FFE4F-20E6-425C-B09B-578352278E8F}-targetpath.txt

    r6968 r6988  
    11Content\maali.xnb 
    2 Content\norsu.xnb 
    3 Content\tahti.xnb 
    42Content\kolikko.xnb 
    53Content\tyyppi3.xnb 
     
    119Content\tyyppi6.xnb 
    1210Content\kentta1.xnb 
     11Content\seteli.xnb 
     12Content\seteli2.xnb 
     13Content\palikka.xnb 
     14Content\palikka2.xnb 
     15Content\kentta.xnb 
    1316Content\kentta2.xnb 
    14 Content\seteli.xnb 
     17Content\maaali.xnb 
  • 2015/30/TomiM/Tasohyppelypeli/Tasohyppelypeli/TasohyppelypeliContent/TasohyppelypeliContent.contentproj

    r6968 r6988  
    5050      <Importer>WavImporter</Importer> 
    5151      <Processor>SoundEffectProcessor</Processor> 
    52     </Compile> 
    53     <Compile Include="norsu.png"> 
    54       <Name>norsu</Name> 
    55       <Importer>TextureImporter</Importer> 
    56       <Processor>TextureProcessor</Processor> 
    57     </Compile> 
    58     <Compile Include="tahti.png"> 
    59       <Name>tahti</Name> 
    60       <Importer>TextureImporter</Importer> 
    61       <Processor>TextureProcessor</Processor> 
    6252    </Compile> 
    6353  </ItemGroup> 
     
    126116  </ItemGroup> 
    127117  <ItemGroup> 
    128     <Compile Include="kentta2.png"> 
    129       <Name>kentta2</Name> 
     118    <Compile Include="seteli.png"> 
     119      <Name>seteli</Name> 
    130120      <Importer>TextureImporter</Importer> 
    131121      <Processor>TextureProcessor</Processor> 
     
    133123  </ItemGroup> 
    134124  <ItemGroup> 
    135     <Compile Include="seteli.png"> 
    136       <Name>seteli</Name> 
     125    <Compile Include="seteli2.png"> 
     126      <Name>seteli2</Name> 
     127      <Importer>TextureImporter</Importer> 
     128      <Processor>TextureProcessor</Processor> 
     129    </Compile> 
     130  </ItemGroup> 
     131  <ItemGroup> 
     132    <Compile Include="palikka.png"> 
     133      <Name>palikka</Name> 
     134      <Importer>TextureImporter</Importer> 
     135      <Processor>TextureProcessor</Processor> 
     136    </Compile> 
     137  </ItemGroup> 
     138  <ItemGroup> 
     139    <Compile Include="palikka2.png"> 
     140      <Name>palikka2</Name> 
     141      <Importer>TextureImporter</Importer> 
     142      <Processor>TextureProcessor</Processor> 
     143    </Compile> 
     144  </ItemGroup> 
     145  <ItemGroup> 
     146    <Compile Include="kentta.png"> 
     147      <Name>kentta</Name> 
     148      <Importer>TextureImporter</Importer> 
     149      <Processor>TextureProcessor</Processor> 
     150    </Compile> 
     151  </ItemGroup> 
     152  <ItemGroup> 
     153    <Compile Include="kentta2.txt"> 
     154      <Name>kentta2</Name> 
     155      <Importer>TextFileImporter</Importer> 
     156      <Processor>TextFileContentProcessor</Processor> 
     157    </Compile> 
     158  </ItemGroup> 
     159  <ItemGroup> 
     160    <Compile Include="maaali.png"> 
     161      <Name>maaali</Name> 
    137162      <Importer>TextureImporter</Importer> 
    138163      <Processor>TextureProcessor</Processor> 
  • 2015/30/TomiM/Tasohyppelypeli/Tasohyppelypeli/TasohyppelypeliContent/kentta1.txt

    r6968 r6988  
    1              
     1############################################################################# 
     2                                                   ########################## 
     3                                                   pppp###################### 
     4               V       *    V  *        V  *      *##ppppppppppppppppppp*S1## 
     5         ####################################################################    
    26            
    37               
    4             
    5                                               
    6           
    7                             V   *                        
    8                         * ##########  V 
    9 *                     V#################### 
    10 #    S             #####             ***** 
    11 ##   *     N   S  ## S                #V 
    12  ##  ##   ###    #    #    #        ########****     # 
    13 V     # *  # *  V # * ## * #   *################# V  #    V   * 
    14 ################################################################# 
     8     ###     
     9       #                                                         SSS                                      
     10      S###                                                  V    #### 
     11      ####### V              V   *                   V   ##### 
     12      ############     * ##########     V         ######### 
     13*                     V########################   ############ 
     14#    S             ############################ 
     15##   *      N   S  ###############ppp#ppp 
     16 ##  ##   ###    ##                #ppp####    
     17 V    # *  # *  V # S S S  *** V*###########         V  #    V   *  
     18p################################################################## 
     19p################################################################### 
     20ppppppppppppppppppppppppppppppp1################################### 
     21#####################################################################p 
     22SSSppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp# 
     23###################################################################### 
  • 2015/30/TomiM/Tasohyppelypeli/Tasohyppelypeli/TasohyppelypeliContent/obj/x86/Debug/ContentPipeline.xml

    r6968 r6988  
    1212    </Item> 
    1313    <Item> 
    14       <Source>norsu.png</Source> 
    15       <Name>norsu</Name> 
    16       <Importer>TextureImporter</Importer> 
    17       <Processor>TextureProcessor</Processor> 
    18       <Options>None</Options> 
    19       <Output>C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\norsu.xnb</Output> 
    20       <Time>2015-07-22T09:51:56.0700364+03:00</Time> 
    21     </Item> 
    22     <Item> 
    23       <Source>tahti.png</Source> 
    24       <Name>tahti</Name> 
    25       <Importer>TextureImporter</Importer> 
    26       <Processor>TextureProcessor</Processor> 
    27       <Options>None</Options> 
    28       <Output>C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\tahti.xnb</Output> 
    29       <Time>2015-07-22T09:51:56.0710364+03:00</Time> 
    30     </Item> 
    31     <Item> 
    3214      <Source>kolikko.png</Source> 
    3315      <Name>kolikko</Name> 
     
    10890      <Options>None</Options> 
    10991      <Output>C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\kentta1.xnb</Output> 
    110       <Time>2015-07-23T11:48:20.8309042+03:00</Time> 
    111     </Item> 
    112     <Item> 
    113       <Source>kentta2.png</Source> 
    114       <Name>kentta2</Name> 
    115       <Importer>TextureImporter</Importer> 
    116       <Processor>TextureProcessor</Processor> 
    117       <Options>None</Options> 
    118       <Output>C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\kentta2.xnb</Output> 
    119       <Time>2015-07-23T11:26:14.6714042+03:00</Time> 
     92      <Time>2015-07-23T14:58:06.3293185+03:00</Time> 
    12093    </Item> 
    12194    <Item> 
     
    127100      <Output>C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\seteli.xnb</Output> 
    128101      <Time>2015-07-23T11:44:30.1477042+03:00</Time> 
     102    </Item> 
     103    <Item> 
     104      <Source>seteli2.png</Source> 
     105      <Name>seteli2</Name> 
     106      <Importer>TextureImporter</Importer> 
     107      <Processor>TextureProcessor</Processor> 
     108      <Options>None</Options> 
     109      <Output>C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\seteli2.xnb</Output> 
     110      <Time>2015-07-23T12:20:21.282647+03:00</Time> 
     111    </Item> 
     112    <Item> 
     113      <Source>palikka.png</Source> 
     114      <Name>palikka</Name> 
     115      <Importer>TextureImporter</Importer> 
     116      <Processor>TextureProcessor</Processor> 
     117      <Options>None</Options> 
     118      <Output>C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\palikka.xnb</Output> 
     119      <Time>2015-07-23T12:37:28.1670483+03:00</Time> 
     120    </Item> 
     121    <Item> 
     122      <Source>palikka2.png</Source> 
     123      <Name>palikka2</Name> 
     124      <Importer>TextureImporter</Importer> 
     125      <Processor>TextureProcessor</Processor> 
     126      <Options>None</Options> 
     127      <Output>C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\palikka2.xnb</Output> 
     128      <Time>2015-07-23T12:47:16.8128185+03:00</Time> 
     129    </Item> 
     130    <Item> 
     131      <Source>kentta.png</Source> 
     132      <Name>kentta</Name> 
     133      <Importer>TextureImporter</Importer> 
     134      <Processor>TextureProcessor</Processor> 
     135      <Options>None</Options> 
     136      <Output>C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\kentta.xnb</Output> 
     137      <Time>2015-07-23T13:39:43.2822185+03:00</Time> 
     138    </Item> 
     139    <Item> 
     140      <Source>kentta2.txt</Source> 
     141      <Name>kentta2</Name> 
     142      <Importer>TextFileImporter</Importer> 
     143      <Processor>TextFileContentProcessor</Processor> 
     144      <Options>None</Options> 
     145      <Output>C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\kentta2.xnb</Output> 
     146      <Time>2015-07-23T14:01:04.7560185+03:00</Time> 
     147    </Item> 
     148    <Item> 
     149      <Source>maaali.png</Source> 
     150      <Name>maaali</Name> 
     151      <Importer>TextureImporter</Importer> 
     152      <Processor>TextureProcessor</Processor> 
     153      <Options>None</Options> 
     154      <Output>C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\maaali.xnb</Output> 
     155      <Time>2015-07-23T14:32:14.9032185+03:00</Time> 
    129156    </Item> 
    130157    <BuildSuccessful>true</BuildSuccessful> 
Note: See TracChangeset for help on using the changeset viewer.