Changeset 6968 for 2015/30


Ignore:
Timestamp:
2015-07-23 11:49:13 (8 years ago)
Author:
tomikkon
Message:
 
Location:
2015/30/TomiM/Tasohyppelypeli
Files:
15 added
13 edited

Legend:

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

    r6934 r6968  
    1818    Image pelaajanKuva = LoadImage("tyyppi3"); 
    1919    Image tahtiKuva = LoadImage("kolikko"); 
     20    Image setelikuva = LoadImage("seteli"); 
    2021    Image vihollisenKuva = LoadImage("vihollinen"); 
    2122 
     
    2324 
    2425 
     26    private Image[] ukkelinKavely = LoadImages("tyyppi", "tyyppi2", "tyyppi4"); 
    2527 
    2628 
     
    3638        LuoPistelaskuri(); 
    3739 
    38         RandomMoverBrain satunnaisAivot = new RandomMoverBrain(100); 
    39         satunnaisAivot.ChangeMovementSeconds = 1; 
    40         vihollinen.Brain = satunnaisAivot; 
    41         satunnaisAivot.WanderRadius = 20; 
    4240 
    4341 
     
    5351    { 
    5452 
    55         Level.AmbientLight = 0.3; 
    56  
    57         Light valo = new Light(); 
    58         valo.Intensity = 0.8; 
    59         valo.Distance = 1200; 
    60         valo.Position = valo.Position; 
    61         Add(valo); 
    62  
    63         Smoke savu = new Smoke(); 
    64         savu.Position = valo.Position; 
    65         Add(savu); 
    66         Wind = new Vector( 0, 0); 
     53 
     54 
     55 
    6756 
    6857        Level.CreateBottomBorder(); 
     
    7362        kentta.SetTileMethod('*', LisaaTahti); 
    7463        kentta.SetTileMethod('V', LisaaVihollinen); 
     64        kentta.SetTileMethod('S', LisaaSeteli); 
     65 
    7566 
    7667        kentta.SetTileMethod('N', LisaaPelaaja); 
     
    119110        pelaaja1.CanRotate = false; 
    120111 
    121         pelaaja1.Weapon = new PlasmaCannon(20, 5); 
    122         pelaaja1.Weapon.Ammo.Value = 1000; 
    123          
    124          
    125         
    126          
    127  
     112 
     113 
     114        pelaaja1.Animation = new Animation(ukkelinKavely); 
     115 
     116        pelaaja1.Animation.Start(); 
     117        pelaaja1.Animation.FPS = 5; 
    128118    } 
    129119    void LisaaVihollinen(Vector paikka, double leveys, double korkeus) 
     
    135125        Add(vihollinen); 
    136126        vihollinen.Tag = "pahis"; 
    137  
     127        PlatformWandererBrain tasoAivot = new PlatformWandererBrain(); 
     128        tasoAivot.Speed = 100; 
     129 
     130        vihollinen.Brain = tasoAivot; 
     131        tasoAivot.FallsOffPlatforms = false; 
    138132 
    139133 
     
    191185 
    192186        pelaaja1.Destroy(); 
     187 
     188        AloitaAlusta(); 
     189 
     190 
     191 
     192 
     193    } 
     194    void AloitaAlusta() 
     195    { 
    193196        ClearAll(); 
    194197        LuoKentta(); 
    195198        LisaaNappaimet(); 
     199        Gravity = new Vector(0, -1000); 
     200 
     201 
    196202        LuoPistelaskuri(); 
    197203 
     204 
     205 
     206 
    198207        Camera.Follow(pelaaja1); 
    199  
    200  
    201         Gravity = new Vector(0, -1000); 
    202  
    203  
    204  
    205  
    206  
    207  
    208     } 
    209     void AloitaAlusta() 
    210     { 
    211         ClearAll(); 
    212         LuoKentta(); 
    213         LisaaNappaimet(); 
    214  
     208        Camera.ZoomFactor = 1.2; 
     209        Camera.StayInLevel = true; 
    215210 
    216211    }IntMeter pisteLaskuri; 
     
    228223 
    229224        IntMeter keratytEsineet = new IntMeter(0); 
    230          
    231          
     225 
     226 
    232227 
    233228        pisteNaytto.BindTo(pisteLaskuri); 
    234229        Add(pisteNaytto); 
    235230 
    236         pisteNaytto.IntFormatString = "Kolikoita: {0:D1}"; 
     231        pisteNaytto.IntFormatString = "rahaa: {0:D1}"; 
    237232 
    238233    } 
     
    242237 
    243238    } 
    244 } 
    245  
     239    void LisaaSeteli(Vector paikka, double leveys, double korkeus) 
     240    { 
     241        PhysicsObject seteli = PhysicsObject.CreateStaticObject(leveys, korkeus); 
     242        seteli .IgnoresCollisionResponse = true; 
     243        seteli.Position = paikka; 
     244        seteli.Image = setelikuva; 
     245        seteli.Tag = "seteli"; 
     246        Add(seteli); 
     247 
     248 
     249 
     250    } 
     251 
     252}     
    246253 
    247254 
  • 2015/30/TomiM/Tasohyppelypeli/Tasohyppelypeli/Tasohyppelypeli/Tasohyppelypeli.csproj.Debug.cachefile

    r6906 r6968  
    22Content\norsu.xnb 
    33Content\tahti.xnb 
    4 Content\kentta1.xnb 
    54Content\kolikko.xnb 
    65Content\tyyppi3.xnb 
    76Content\vihollinen.xnb 
     7Content\tyyppi.xnb 
     8Content\tyyppi4.xnb 
     9Content\tyyppi2.xnb 
     10Content\tyyppi5.xnb 
     11Content\tyyppi6.xnb 
     12Content\kentta1.xnb 
     13Content\kentta2.xnb 
     14Content\seteli.xnb 
  • 2015/30/TomiM/Tasohyppelypeli/Tasohyppelypeli/Tasohyppelypeli/obj/x86/Debug/Tasohyppelypeli.csproj.FileListAbsolute.txt

    r6906 r6968  
    22C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\norsu.xnb 
    33C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\tahti.xnb 
    4 C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\kentta1.xnb 
    54C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Tasohyppelypeli.exe 
    65C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Tasohyppelypeli.pdb 
     
    1413C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\tyyppi3.xnb 
    1514C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\vihollinen.xnb 
     15C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\tyyppi.xnb 
     16C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\tyyppi4.xnb 
     17C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\tyyppi2.xnb 
     18C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\tyyppi5.xnb 
     19C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\tyyppi6.xnb 
     20C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\kentta1.xnb 
     21C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\kentta2.xnb 
     22C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\seteli.xnb 
  • 2015/30/TomiM/Tasohyppelypeli/Tasohyppelypeli/Tasohyppelypeli/obj/x86/Debug/cachefile-{CA2FFE4F-20E6-425C-B09B-578352278E8F}-targetpath.txt

    r6906 r6968  
    22Content\norsu.xnb 
    33Content\tahti.xnb 
    4 Content\kentta1.xnb 
    54Content\kolikko.xnb 
    65Content\tyyppi3.xnb 
    76Content\vihollinen.xnb 
     7Content\tyyppi.xnb 
     8Content\tyyppi4.xnb 
     9Content\tyyppi2.xnb 
     10Content\tyyppi5.xnb 
     11Content\tyyppi6.xnb 
     12Content\kentta1.xnb 
     13Content\kentta2.xnb 
     14Content\seteli.xnb 
  • 2015/30/TomiM/Tasohyppelypeli/Tasohyppelypeli/TasohyppelypeliContent/TasohyppelypeliContent.contentproj

    r6906 r6968  
    6161      <Processor>TextureProcessor</Processor> 
    6262    </Compile> 
    63     <Compile Include="kentta1.txt"> 
    64       <Name>kentta1</Name> 
    65       <Importer>TextFileImporter</Importer> 
    66       <Processor>TextFileContentProcessor</Processor> 
    67     </Compile> 
    6863  </ItemGroup> 
    6964  <ItemGroup> 
     
    8883    </Compile> 
    8984  </ItemGroup> 
     85  <ItemGroup> 
     86    <Compile Include="tyyppi.png"> 
     87      <Name>tyyppi</Name> 
     88      <Importer>TextureImporter</Importer> 
     89      <Processor>TextureProcessor</Processor> 
     90    </Compile> 
     91  </ItemGroup> 
     92  <ItemGroup> 
     93    <Compile Include="tyyppi4.png"> 
     94      <Name>tyyppi4</Name> 
     95      <Importer>TextureImporter</Importer> 
     96      <Processor>TextureProcessor</Processor> 
     97    </Compile> 
     98  </ItemGroup> 
     99  <ItemGroup> 
     100    <Compile Include="tyyppi2.png"> 
     101      <Name>tyyppi2</Name> 
     102      <Importer>TextureImporter</Importer> 
     103      <Processor>TextureProcessor</Processor> 
     104    </Compile> 
     105  </ItemGroup> 
     106  <ItemGroup> 
     107    <Compile Include="tyyppi5.png"> 
     108      <Name>tyyppi5</Name> 
     109      <Importer>TextureImporter</Importer> 
     110      <Processor>TextureProcessor</Processor> 
     111    </Compile> 
     112  </ItemGroup> 
     113  <ItemGroup> 
     114    <Compile Include="tyyppi6.png"> 
     115      <Name>tyyppi6</Name> 
     116      <Importer>TextureImporter</Importer> 
     117      <Processor>TextureProcessor</Processor> 
     118    </Compile> 
     119  </ItemGroup> 
     120  <ItemGroup> 
     121    <Compile Include="kentta1.txt"> 
     122      <Name>kentta1</Name> 
     123      <Importer>TextFileImporter</Importer> 
     124      <Processor>TextFileContentProcessor</Processor> 
     125    </Compile> 
     126  </ItemGroup> 
     127  <ItemGroup> 
     128    <Compile Include="kentta2.png"> 
     129      <Name>kentta2</Name> 
     130      <Importer>TextureImporter</Importer> 
     131      <Processor>TextureProcessor</Processor> 
     132    </Compile> 
     133  </ItemGroup> 
     134  <ItemGroup> 
     135    <Compile Include="seteli.png"> 
     136      <Name>seteli</Name> 
     137      <Importer>TextureImporter</Importer> 
     138      <Processor>TextureProcessor</Processor> 
     139    </Compile> 
     140  </ItemGroup> 
    90141  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    91142  <!--  To modify your build process, add your task inside one of the targets below and uncomment it.  
  • 2015/30/TomiM/Tasohyppelypeli/Tasohyppelypeli/TasohyppelypeliContent/kentta1.txt

    r6934 r6968  
    88                        * ##########  V 
    99*                     V#################### 
    10 #                  #####             ***** 
    11 ##   V     N      ##                  #V 
     10#    S             #####             ***** 
     11##   *     N   S  ## S                #V 
    1212 ##  ##   ###    #    #    #        ########****     # 
    13 *     # *  # *  V # * ## * #   *################# V  #    V   * 
     13V     # *  # *  V # * ## * #   *################# V  #    V   * 
    1414################################################################# 
  • 2015/30/TomiM/Tasohyppelypeli/Tasohyppelypeli/TasohyppelypeliContent/obj/x86/Debug/ContentPipeline.xml

    r6934 r6968  
    3030    </Item> 
    3131    <Item> 
    32       <Source>kentta1.txt</Source> 
    33       <Name>kentta1</Name> 
    34       <Importer>TextFileImporter</Importer> 
    35       <Processor>TextFileContentProcessor</Processor> 
    36       <Options>None</Options> 
    37       <Output>C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\kentta1.xnb</Output> 
    38       <Time>2015-07-22T14:38:39.4380144+03:00</Time> 
    39     </Item> 
    40     <Item> 
    4132      <Source>kolikko.png</Source> 
    4233      <Name>kolikko</Name> 
     
    6455      <Output>C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\vihollinen.xnb</Output> 
    6556      <Time>2015-07-22T12:28:58.4467364+03:00</Time> 
     57    </Item> 
     58    <Item> 
     59      <Source>tyyppi.png</Source> 
     60      <Name>tyyppi</Name> 
     61      <Importer>TextureImporter</Importer> 
     62      <Processor>TextureProcessor</Processor> 
     63      <Options>None</Options> 
     64      <Output>C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\tyyppi.xnb</Output> 
     65      <Time>2015-07-23T10:34:25.9361042+03:00</Time> 
     66    </Item> 
     67    <Item> 
     68      <Source>tyyppi4.png</Source> 
     69      <Name>tyyppi4</Name> 
     70      <Importer>TextureImporter</Importer> 
     71      <Processor>TextureProcessor</Processor> 
     72      <Options>None</Options> 
     73      <Output>C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\tyyppi4.xnb</Output> 
     74      <Time>2015-07-23T10:59:10.3225042+03:00</Time> 
     75    </Item> 
     76    <Item> 
     77      <Source>tyyppi2.png</Source> 
     78      <Name>tyyppi2</Name> 
     79      <Importer>TextureImporter</Importer> 
     80      <Processor>TextureProcessor</Processor> 
     81      <Options>None</Options> 
     82      <Output>C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\tyyppi2.xnb</Output> 
     83      <Time>2015-07-23T10:55:16.5603042+03:00</Time> 
     84    </Item> 
     85    <Item> 
     86      <Source>tyyppi5.png</Source> 
     87      <Name>tyyppi5</Name> 
     88      <Importer>TextureImporter</Importer> 
     89      <Processor>TextureProcessor</Processor> 
     90      <Options>None</Options> 
     91      <Output>C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\tyyppi5.xnb</Output> 
     92      <Time>2015-07-23T10:47:22.0473042+03:00</Time> 
     93    </Item> 
     94    <Item> 
     95      <Source>tyyppi6.png</Source> 
     96      <Name>tyyppi6</Name> 
     97      <Importer>TextureImporter</Importer> 
     98      <Processor>TextureProcessor</Processor> 
     99      <Options>None</Options> 
     100      <Output>C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\tyyppi6.xnb</Output> 
     101      <Time>2015-07-23T10:53:49.6769042+03:00</Time> 
     102    </Item> 
     103    <Item> 
     104      <Source>kentta1.txt</Source> 
     105      <Name>kentta1</Name> 
     106      <Importer>TextFileImporter</Importer> 
     107      <Processor>TextFileContentProcessor</Processor> 
     108      <Options>None</Options> 
     109      <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> 
     120    </Item> 
     121    <Item> 
     122      <Source>seteli.png</Source> 
     123      <Name>seteli</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\seteli.xnb</Output> 
     128      <Time>2015-07-23T11:44:30.1477042+03:00</Time> 
    66129    </Item> 
    67130    <BuildSuccessful>true</BuildSuccessful> 
Note: See TracChangeset for help on using the changeset viewer.