Changeset 8144


Ignore:
Timestamp:
2016-07-27 11:32:45 (3 years ago)
Author:
empaheik
Message:
 
Location:
2016/30/LukaH
Files:
5 added
5 deleted
13 edited

Legend:

Unmodified
Added
Removed
  • 2016/30/LukaH/Spikemania/Spikemania/Spikemania/Spikemania.cs

    r8125 r8144  
    1313    const int RUUDUN_KOKO = 40; 
    1414 
    15  
     15     
    1616    Vector spawni = Vector.Zero; 
    1717 
     
    2020    Image avaimenkuva = LoadImage("avain"); 
    2121    Image ovenkuva = LoadImage("ovi"); 
    22     Image pelaajanKuva = LoadImage("norsu"); 
     22    Image pelaajanKuva = LoadImage("pelaaja"); 
    2323    Image tahtiKuva = LoadImage("tahti"); 
    2424 
     
    2929        Gravity = new Vector(0, -1000); 
    3030 
     31        SmoothTextures = false; 
     32 
     33        LuoPistelaskuri(); 
    3134        LuoKentta(); 
    3235        LisaaNappaimet(); 
    3336 
    34         //Camera.Follow(pelaaja1); 
    35         //Camera.ZoomFactor = 1.2; 
    36         //Camera.StayInLevel = true; 
     37        Camera.Follow(pelaaja1); 
     38        Camera.ZoomFactor = 0.9; 
     39        Camera.StayInLevel = true; 
     40    } 
     41 
     42    IntMeter pisteLaskuri; 
     43 
     44    void LuoPistelaskuri() 
     45    { 
     46        pisteLaskuri = new IntMeter(0); 
     47        pisteLaskuri.MaxValue = 2; 
     48 
     49        Label pisteNaytto = new Label(); 
     50        pisteNaytto.X = Screen.Left + 100; 
     51        pisteNaytto.Y = Screen.Top - 100; 
     52        pisteNaytto.TextColor = Color.White; 
     53        pisteNaytto.Color = Color.Transparent; 
     54 
     55        pisteNaytto.BindTo(pisteLaskuri); 
     56        Add(pisteNaytto); 
    3757    } 
    3858 
     
    5171     
    5272    } 
     73 
    5374    void LisaaOvi(Vector paikka, double leveys, double korkeus) 
    5475    { 
     
    5778        Ovi.Position = paikka + new Vector(0, korkeus / 2); 
    5879        Ovi.Shape = Shape.Rectangle; 
     80        Ovi.Tag = "ovi"; 
    5981        Add(Ovi); 
    6082        Ovi.Image = ovenkuva; 
    6183    } 
     84 
    6285    void LisaaAvain(Vector paikka, double leveys, double korkeus) 
    6386    { 
     
    98121        //AddCollisionHandler(pelaaja1, "tahti", TormaaTahteen); 
    99122        AddCollisionHandler(pelaaja1, "Piikki", TormaaPiikkiin); 
     123        AddCollisionHandler(pelaaja1, "Avain", KeraaAvain); 
     124        AddCollisionHandler(pelaaja1, "ovi", Tormaaoveen); 
    100125        Add(pelaaja1); 
    101126 
    102127    } 
     128    void Tormaaoveen(PhysicsObject Pelaaja1, PhysicsObject ovi) 
     129    { 
     130        if (pisteLaskuri.Value == 2) 
     131        { 
     132            Exit(); 
     133        } 
     134    } 
     135 
    103136    void TormaaPiikkiin(PhysicsObject Pelaaja1, PhysicsObject Piikki) 
    104137    { 
    105138        Pelaaja1.Position = spawni; 
    106139    } 
    107     
    108140 
    109141    void LisaaNappaimet() 
     
    135167    } 
    136168 
    137     void TormaaTahteen(PhysicsObject hahmo, PhysicsObject tahti) 
     169    void KeraaAvain(PhysicsObject hahmo, PhysicsObject avain) 
    138170    { 
    139171        maaliAani.Play(); 
    140         MessageDisplay.Add("Keräsit tähden!"); 
    141         tahti.Destroy(); 
     172        MessageDisplay.Add("Keräsit Avaimen!"); 
     173        avain.Destroy(); 
     174        pisteLaskuri.Value += 1; 
    142175    } 
    143176} 
  • 2016/30/LukaH/Spikemania/Spikemania/Spikemania/Spikemania.csproj.Debug.cachefile

    r8125 r8144  
    22Content\norsu.xnb 
    33Content\tahti.xnb 
    4 Content\kentta1.xnb 
    5 Content\testi.xnb 
    64Content\Level1.xnb 
    75Content\ovi.xnb 
    86Content\avain.xnb 
    9 Content\kentta1.txt 
     7Content\pelaaja.xnb 
  • 2016/30/LukaH/Spikemania/Spikemania/Spikemania/obj/x86/Debug/ContentPipeline-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}.xml

    r8125 r8144  
    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\LukaH\Spikemania\Spikemania\Spikemania\bin\x86\Debug\Content\kentta1.xnb</Output> 
    38       <Time>2016-07-26T13:31:59.2284023+03:00</Time> 
    39     </Item> 
    40     <Item> 
    41       <Source>testi.txt</Source> 
    42       <Name>testi</Name> 
    43       <Importer>TextFileImporter</Importer> 
    44       <Processor>TextFileContentProcessor</Processor> 
    45       <Options>None</Options> 
    46       <Output>C:\MyTemp\LukaH\Spikemania\Spikemania\Spikemania\bin\x86\Debug\Content\testi.xnb</Output> 
    47       <Time>2016-07-26T13:31:59.2440024+03:00</Time> 
    48     </Item> 
    49     <Item> 
    5032      <Source>Level1.txt</Source> 
    5133      <Name>Level1</Name> 
     
    5436      <Options>None</Options> 
    5537      <Output>C:\MyTemp\LukaH\Spikemania\Spikemania\Spikemania\bin\x86\Debug\Content\Level1.xnb</Output> 
    56       <Time>2016-07-26T14:35:09.342363+03:00</Time> 
     38      <Time>2016-07-27T11:26:14.9582664+03:00</Time> 
    5739    </Item> 
    5840    <Item> 
     
    7355      <Output>C:\MyTemp\LukaH\Spikemania\Spikemania\Spikemania\bin\x86\Debug\Content\avain.xnb</Output> 
    7456      <Time>2016-07-26T14:56:00.0775716+03:00</Time> 
     57    </Item> 
     58    <Item> 
     59      <Source>pelaaja.png</Source> 
     60      <Name>pelaaja</Name> 
     61      <Importer>TextureImporter</Importer> 
     62      <Processor>TextureProcessor</Processor> 
     63      <Options>None</Options> 
     64      <Output>C:\MyTemp\LukaH\Spikemania\Spikemania\Spikemania\bin\x86\Debug\Content\pelaaja.xnb</Output> 
     65      <Time>2016-07-27T11:04:00.5084083+03:00</Time> 
    7566    </Item> 
    7667    <BuildSuccessful>true</BuildSuccessful> 
  • 2016/30/LukaH/Spikemania/Spikemania/Spikemania/obj/x86/Debug/Spikemania.csproj.FileListAbsolute.txt

    r8125 r8144  
    22C:\MyTemp\LukaH\Spikemania\Spikemania\Spikemania\bin\x86\Debug\Content\norsu.xnb 
    33C:\MyTemp\LukaH\Spikemania\Spikemania\Spikemania\bin\x86\Debug\Content\tahti.xnb 
    4 C:\MyTemp\LukaH\Spikemania\Spikemania\Spikemania\bin\x86\Debug\Content\kentta1.xnb 
    54C:\MyTemp\LukaH\Spikemania\Spikemania\Spikemania\bin\x86\Debug\Spikemania.exe 
    65C:\MyTemp\LukaH\Spikemania\Spikemania\Spikemania\bin\x86\Debug\Spikemania.pdb 
     
    1211C:\MyTemp\LukaH\Spikemania\Spikemania\Spikemania\obj\x86\Debug\Spikemania.pdb 
    1312C:\MyTemp\LukaH\Spikemania\Spikemania\Spikemania\bin\x86\Debug\Content\Level1.xnb 
    14 C:\MyTemp\LukaH\Spikemania\Spikemania\Spikemania\bin\x86\Debug\Content\kentta1.txt 
    15 C:\MyTemp\LukaH\Spikemania\Spikemania\Spikemania\bin\x86\Debug\Content\testi.xnb 
    1613C:\MyTemp\LukaH\Spikemania\Spikemania\Spikemania\bin\x86\Debug\Content\ovi.xnb 
    1714C:\MyTemp\LukaH\Spikemania\Spikemania\Spikemania\bin\x86\Debug\Content\avain.xnb 
     15C:\MyTemp\LukaH\Spikemania\Spikemania\Spikemania\bin\x86\Debug\Content\pelaaja.xnb 
  • 2016/30/LukaH/Spikemania/Spikemania/Spikemania/obj/x86/Debug/cachefile-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}-targetpath.txt

    r8125 r8144  
    22Content\norsu.xnb 
    33Content\tahti.xnb 
    4 Content\kentta1.xnb 
    5 Content\testi.xnb 
    64Content\Level1.xnb 
    75Content\ovi.xnb 
    86Content\avain.xnb 
    9 Content\kentta1.txt 
     7Content\pelaaja.xnb 
  • 2016/30/LukaH/Spikemania/Spikemania/SpikemaniaContent/Level1.txt

    r8125 r8144  
    33#######.......................# 
    44.......#p.....................# 
    5 ........#..................o..# 
     5........#..............pp..o..# 
    66.........#............######### 
    77.....................#........# 
    88..........#.....#...#.........# 
    9 ..N..p...#ppppppp#.......p..a.# 
     9..N..pp..#ppppppp#.......p..a.# 
    1010############################### 
  • 2016/30/LukaH/Spikemania/Spikemania/SpikemaniaContent/SpikemaniaContent.contentproj

    r8125 r8144  
    6161      <Processor>TextureProcessor</Processor> 
    6262    </Compile> 
    63     <Compile Include="kentta1.txt"> 
    64       <Name>kentta1</Name> 
    65       <Importer>TextFileImporter</Importer> 
    66       <Processor>TextFileContentProcessor</Processor> 
    67       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> 
    68     </Compile> 
    69   </ItemGroup> 
    70   <ItemGroup> 
    71     <Compile Include="testi.txt"> 
    72       <Name>testi</Name> 
    73       <Importer>TextFileImporter</Importer> 
    74       <Processor>TextFileContentProcessor</Processor> 
    75     </Compile> 
    7663  </ItemGroup> 
    7764  <ItemGroup> 
     
    9683    </Compile> 
    9784  </ItemGroup> 
     85  <ItemGroup> 
     86    <Compile Include="pelaaja.png"> 
     87      <Name>pelaaja</Name> 
     88      <Importer>TextureImporter</Importer> 
     89      <Processor>TextureProcessor</Processor> 
     90    </Compile> 
     91  </ItemGroup> 
    9892  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    9993  <!--  To modify your build process, add your task inside one of the targets below and uncomment it.  
Note: See TracChangeset for help on using the changeset viewer.