Changeset 3034


Ignore:
Timestamp:
2012-06-14 15:09:52 (11 years ago)
Author:
eefadjuk
Message:

Talletus.

Location:
2012/24/EeroF/LabTank
Files:
11 added
14 edited

Legend:

Unmodified
Added
Removed
  • 2012/24/EeroF/LabTank/LabTank/LabTank/LabTank.cs

    r3003 r3034  
    99public class LabTank : PhysicsGame 
    1010{ 
    11     const double nopeus = 200; 
    12     const double hyppyNopeus = 200; 
     11    const double kaantyy = 20; 
     12    const double nopeus = 500; 
     13    const double hyppyNopeus = 500; 
    1314    const int RUUDUN_KOKO = 40; 
    1415     
    1516    PhysicsObject pelaaja1; 
    1617 
    17     Image pelaajanKuva = LoadImage("norsu"); 
     18 
     19    Image pelaajanKuva = LoadImage("pelaaja"); 
    1820    Image tahtiKuva = LoadImage("tahti"); 
     21    Image tasonKuva = LoadImage("taso"); 
     22    Image taustanKuva = LoadImage("tausta"); 
    1923 
    2024    SoundEffect maaliAani = LoadSoundEffect("maali"); 
     
    3741        kentta.SetTileMethod('#', lisaaTaso); 
    3842        kentta.SetTileMethod('*', lisaaTahti); 
    39         kentta.SetTileMethod('N', lisaaPelaaja); 
     43        kentta.SetTileMethod('P', lisaaPelaaja); 
     44       // kentta.SetTileMethod('A', lisaaMinitorni); 
    4045        kentta.Execute(RUUDUN_KOKO, RUUDUN_KOKO); 
    4146        Level.CreateBorders(); 
    42         Level.Background.CreateGradient(Color.White, Color.SkyBlue); 
     47        Level.Background.CreateGradient(Color.Black , Color.White); 
     48        Level.Background.Image = taustanKuva; 
    4349    } 
    4450 
     
    4854        taso.Position = paikka; 
    4955        taso.Color = Color.Green; 
     56 
    5057        Add(taso); 
    5158    } 
     
    6370    void lisaaPelaaja(Vector paikka, double leveys, double korkeus) 
    6471    { 
    65         pelaaja1 = new PhysicsObject(leveys, korkeus); 
     72        pelaaja1 = new PhysicsObject (leveys, korkeus); 
     73        pelaaja1.CanRotate = false; 
     74 
    6675        pelaaja1.Position = paikka; 
    67         pelaaja1.Mass = 4.0; 
     76        pelaaja1.Mass = 100.0; 
    6877        pelaaja1.Image = pelaajanKuva; 
    6978        AddCollisionHandler(pelaaja1, kasittelePelaajanTormays); 
     
    7786        Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 
    7887 
    79        // Keyboard.Listen(Key.Left, ButtonState.Down, liikuta, "Liikkuu vasemmalle", pelaaja1, -nopeus); 
    80        // Keyboard.Listen(Key.Right, ButtonState.Down, liikuta, "Liikkuu vasemmalle", pelaaja1, nopeus); 
    81         Keyboard.Listen(Key.Up, ButtonState.Down, hyppaa, "Liikkuu ylös", pelaaja1, hyppyNopeus); 
    82         Keyboard.Listen(Key.Down, ButtonState.Down, hyppaa, "Liikkuu alas", pelaaja1, -hyppyNopeus); 
     88        Keyboard.Listen(Key.A, ButtonState.Down, liikuta, "Liikkuu vasemmalle", pelaaja1, -nopeus); 
     89        Keyboard.Listen(Key.D, ButtonState.Down, liikuta, "Liikkuu vasemmalle", pelaaja1, nopeus); 
     90        Keyboard.Listen(Key.W, ButtonState.Down, hyppaa, "Liikkuu ylös", pelaaja1, hyppyNopeus); 
     91        Keyboard.Listen(Key.S, ButtonState.Down, hyppaa, "Liikkuu alas", pelaaja1, -hyppyNopeus); 
     92        Keyboard.Listen(Key.Up, ButtonState.Down, kaanna, "Kääntyy", pelaaja1, kaantyy); 
     93 
     94 
    8395 
    8496        ControllerOne.Listen(Button.Back, ButtonState.Pressed, Exit, "Poistu pelistä"); 
    8597 
    8698 
    87         //ControllerOne.Listen(Button.DPadLeft, ButtonState.Down, liikuta, "Pelaaja liikkuu vasemmalle", pelaaja1, -nopeus); 
    88         //ControllerOne.Listen(Button.DPadRight, ButtonState.Down, liikuta, "Pelaaja liikkuu oikealle", pelaaja1, nopeus); 
     99        ControllerOne.Listen(Button.DPadLeft, ButtonState.Down, liikuta, "Pelaaja liikkuu vasemmalle", pelaaja1, -nopeus); 
     100        ControllerOne.Listen(Button.DPadRight, ButtonState.Down, liikuta, "Pelaaja liikkuu oikealle", pelaaja1, nopeus); 
    89101        ControllerOne.Listen(Button.DPadUp, ButtonState.Down, hyppaa, "Pelaaja liikkuu ylös", pelaaja1, hyppyNopeus); 
    90102        ControllerOne.Listen(Button.DPadDown, ButtonState.Down, hyppaa, "Pelaaja liikkuu alas", pelaaja1, -hyppyNopeus); 
     
    93105    } 
    94106 
    95     void liikuta(PlatformCharacter hahmo, double nopeus) 
     107    void liikuta(PhysicsObject hahmo, double nopeus) 
    96108    { 
    97         hahmo.Walk(nopeus); 
     109        hahmo.Velocity = new Vector (nopeus, 0); 
    98110    } 
    99111 
     
    101113    { 
    102114        hahmo.Velocity = new Vector(0, nopeus); 
     115 
    103116    } 
    104117 
     
    108121        { 
    109122            maaliAani.Play(); 
    110             MessageDisplay.Add("Keräsit tähden!"); 
    111             kohde.Destroy(); 
     123            MessageDisplay.Add("Voitit tason!"); 
     124          // kohde.Destroy(); 
    112125        } 
    113126    } 
     127  void lisaaMinitorni (Vector paikka, double y, double x ) 
     128{ 
     129 
    114130} 
     131  void kaanna(PhysicsObject hahmo, double kaantyy) 
     132  {  
     133   
     134  } 
     135 
     136} 
  • 2012/24/EeroF/LabTank/LabTank/LabTank/LabTank.csproj.Debug.cachefile

    r3003 r3034  
    33Content\tahti.xnb 
    44Content\kentta1.xnb 
     5Content\pelaaja.xnb 
     6Content\tausta.xnb 
     7Content\Tykkitorni.xnb 
     8Content\Minitankki.xnb 
     9Content\Taso.xnb 
    510Content\kentta1.txt 
  • 2012/24/EeroF/LabTank/LabTank/LabTank/bin/x86/Debug/Content/kentta1.txt

    r3003 r3034  
    11 
    2  
    3  
    4  
    5  
    6  
    7  
    8  
    9  
    10  
    11  
    12  
    13  
    14  
    15  
    16  
    17  
    18  
    19  
    20  
    21  
    22  
    23  
    24  
    25        
    26  
    27           N 
    282################################################################################### 
     3#                                                                                 # 
     4#                                                                                 # 
     5########     ###############################################################   #### 
     6########     #           #                                                        # 
     7########     #           #                                                        # 
     8########     #           #                                                        # 
     9########     #           #                                                        # 
     10########     #           #                                                        # 
     11########     #                                                                    # 
     12########     #                                                                    # 
     13########     #                                                                    # 
     14########     #                                                                    # 
     15### ####     #                                                                    # 
     16###*####     #                                                                    # 
     17########     #                                                                    # 
     18########     #                                                                    # 
     19########     #                                                                    # 
     20########     #                                                                    # 
     21########     #                                                                    # 
     22########     #                                                                    # 
     23########     ##################################################################   # 
     24########                                                                      #   # 
     25#                                                                             #   # 
     26###########################################################################   ##### 
     27#                                                                                 # 
     28# P                                                                               # 
     29################################################################################### 
  • 2012/24/EeroF/LabTank/LabTank/LabTank/obj/x86/Debug/ContentPipeline-{93849E76-CF87-4581-B77C-74DA2F8B7CEC}.xml

    r3003 r3034  
    3636      <Options>None</Options> 
    3737      <Output>C:\MyTemp\EeroF\LabTank\LabTank\LabTank\bin\x86\Debug\Content\kentta1.xnb</Output> 
    38       <Time>2012-06-13T14:04:06.4020513+03:00</Time> 
     38      <Time>2012-06-14T14:36:02.6196895+03:00</Time> 
     39    </Item> 
     40    <Item> 
     41      <Source>pelaaja.png</Source> 
     42      <Name>pelaaja</Name> 
     43      <Importer>TextureImporter</Importer> 
     44      <Processor>TextureProcessor</Processor> 
     45      <Options>None</Options> 
     46      <Output>C:\MyTemp\EeroF\LabTank\LabTank\LabTank\bin\x86\Debug\Content\pelaaja.xnb</Output> 
     47      <Time>2012-06-13T13:55:27.7722513+03:00</Time> 
     48    </Item> 
     49    <Item> 
     50      <Source>tausta.png</Source> 
     51      <Name>tausta</Name> 
     52      <Importer>TextureImporter</Importer> 
     53      <Processor>TextureProcessor</Processor> 
     54      <Options>None</Options> 
     55      <Output>C:\MyTemp\EeroF\LabTank\LabTank\LabTank\bin\x86\Debug\Content\tausta.xnb</Output> 
     56      <Time>2012-06-13T13:20:31.9089818+03:00</Time> 
     57    </Item> 
     58    <Item> 
     59      <Source>Tykkitorni.png</Source> 
     60      <Name>Tykkitorni</Name> 
     61      <Importer>TextureImporter</Importer> 
     62      <Processor>TextureProcessor</Processor> 
     63      <Options>None</Options> 
     64      <Output>C:\MyTemp\EeroF\LabTank\LabTank\LabTank\bin\x86\Debug\Content\Tykkitorni.xnb</Output> 
     65      <Time>2012-06-14T10:50:15.1267769+03:00</Time> 
     66    </Item> 
     67    <Item> 
     68      <Source>Minitankki.png</Source> 
     69      <Name>Minitankki</Name> 
     70      <Importer>TextureImporter</Importer> 
     71      <Processor>TextureProcessor</Processor> 
     72      <Options>None</Options> 
     73      <Output>C:\MyTemp\EeroF\LabTank\LabTank\LabTank\bin\x86\Debug\Content\Minitankki.xnb</Output> 
     74      <Time>2012-06-14T10:55:42.8520189+03:00</Time> 
     75    </Item> 
     76    <Item> 
     77      <Source>Taso.png</Source> 
     78      <Name>Taso</Name> 
     79      <Importer>TextureImporter</Importer> 
     80      <Processor>TextureProcessor</Processor> 
     81      <Options>None</Options> 
     82      <Output>C:\MyTemp\EeroF\LabTank\LabTank\LabTank\bin\x86\Debug\Content\Taso.xnb</Output> 
     83      <Time>2012-06-14T11:54:10.08295+03:00</Time> 
    3984    </Item> 
    4085    <BuildSuccessful>true</BuildSuccessful> 
     
    5398      <Assembly> 
    5499        <Key>C:\Program Files (x86)\Jypeli\lib\ContentExtensions\TextFileContentExtension.dll</Key> 
    55         <Value>2012-04-23T14:23:36+03:00</Value> 
     100        <Value>2012-06-13T10:59:54+03:00</Value> 
    56101      </Assembly> 
    57102      <Assembly> 
  • 2012/24/EeroF/LabTank/LabTank/LabTank/obj/x86/Debug/LabTank.csproj.FileListAbsolute.txt

    r3003 r3034  
    1212C:\MyTemp\EeroF\LabTank\LabTank\LabTank\bin\x86\Debug\Content\kentta1.xnb 
    1313C:\MyTemp\EeroF\LabTank\LabTank\LabTank\bin\x86\Debug\Content\kentta1.txt 
     14C:\MyTemp\EeroF\LabTank\LabTank\LabTank\bin\x86\Debug\Content\pelaaja.xnb 
     15C:\MyTemp\EeroF\LabTank\LabTank\LabTank\bin\x86\Debug\Content\tausta.xnb 
     16C:\MyTemp\EeroF\LabTank\LabTank\LabTank\bin\x86\Debug\Content\Tykkitorni.xnb 
     17C:\MyTemp\EeroF\LabTank\LabTank\LabTank\bin\x86\Debug\Content\Minitankki.xnb 
     18C:\MyTemp\EeroF\LabTank\LabTank\LabTank\bin\x86\Debug\Content\Taso.xnb 
  • 2012/24/EeroF/LabTank/LabTank/LabTank/obj/x86/Debug/cachefile-{93849E76-CF87-4581-B77C-74DA2F8B7CEC}-targetpath.txt

    r3003 r3034  
    33Content\tahti.xnb 
    44Content\kentta1.xnb 
     5Content\pelaaja.xnb 
     6Content\tausta.xnb 
     7Content\Tykkitorni.xnb 
     8Content\Minitankki.xnb 
     9Content\Taso.xnb 
    510Content\kentta1.txt 
  • 2012/24/EeroF/LabTank/LabTank/LabTankContent/LabTankContent.contentproj

    r3003 r3034  
    6969    </Compile> 
    7070  </ItemGroup> 
     71  <ItemGroup> 
     72    <Compile Include="pelaaja.png"> 
     73      <Name>pelaaja</Name> 
     74      <Importer>TextureImporter</Importer> 
     75      <Processor>TextureProcessor</Processor> 
     76    </Compile> 
     77    <Compile Include="tausta.png"> 
     78      <Name>tausta</Name> 
     79      <Importer>TextureImporter</Importer> 
     80      <Processor>TextureProcessor</Processor> 
     81    </Compile> 
     82  </ItemGroup> 
     83  <ItemGroup> 
     84    <Compile Include="Tykkitorni.png"> 
     85      <Name>Tykkitorni</Name> 
     86      <Importer>TextureImporter</Importer> 
     87      <Processor>TextureProcessor</Processor> 
     88    </Compile> 
     89  </ItemGroup> 
     90  <ItemGroup> 
     91    <Compile Include="Minitankki.png"> 
     92      <Name>Minitankki</Name> 
     93      <Importer>TextureImporter</Importer> 
     94      <Processor>TextureProcessor</Processor> 
     95    </Compile> 
     96  </ItemGroup> 
     97  <ItemGroup> 
     98    <Compile Include="Taso.png"> 
     99      <Name>Taso</Name> 
     100      <Importer>TextureImporter</Importer> 
     101      <Processor>TextureProcessor</Processor> 
     102    </Compile> 
     103  </ItemGroup> 
    71104  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    72105  <!--  To modify your build process, add your task inside one of the targets below and uncomment it.  
  • 2012/24/EeroF/LabTank/LabTank/LabTankContent/kentta1.txt

    r3003 r3034  
    11 
    2  
    3  
    4  
    5  
    6  
    7  
    8  
    9  
    10  
    11  
    12  
    13  
    14  
    15  
    16  
    17  
    18  
    19  
    20  
    21  
    22  
    23  
    24  
    25        
    26  
    27           N 
    282################################################################################### 
     3#                                                                                 # 
     4#                                                                                 # 
     5########     ###############################################################   #### 
     6########     #           #                                                        # 
     7########     #           #                                                        # 
     8########     #           #                                                        # 
     9########     #           #                                                        # 
     10########     #           #                                                        # 
     11########     #                                                                    # 
     12########     #                                                                    # 
     13########     #                                                                    # 
     14########     #                                                                    # 
     15### ####     #                                                                    # 
     16###*####     #                                                                    # 
     17########     #                                                                    # 
     18########     #                                                                    # 
     19########     #                                                                    # 
     20########     #                                                                    # 
     21########     #                                                                    # 
     22########     #                                                                    # 
     23########     ##################################################################   # 
     24########                                                                      #   # 
     25#                                                                             #   # 
     26###########################################################################   ##### 
     27#                                                                                 # 
     28# P                                                                               # 
     29################################################################################### 
Note: See TracChangeset for help on using the changeset viewer.