Changeset 8897 for 2017


Ignore:
Timestamp:
2017-07-04 15:00:25 (6 years ago)
Author:
npo17_36
Message:
 
Location:
2017/27/JuusoM
Files:
9 added
13 edited

Legend:

Unmodified
Added
Removed
  • 2017/27/JuusoM/peli/peli/peli/obj/x86/Debug/ContentPipeline-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}.xml

    r8848 r8897  
    3636      <Options>None</Options> 
    3737      <Output>C:\MyTemp\JuusoM\peli\peli\peli\bin\x86\Debug\Content\kentta1.xnb</Output> 
    38       <Time>2017-07-03T11:33:06.5413448+03:00</Time> 
     38      <Time>2017-07-04T09:41:19.071971+03:00</Time> 
     39    </Item> 
     40    <Item> 
     41      <Source>police.png</Source> 
     42      <Name>police</Name> 
     43      <Importer>TextureImporter</Importer> 
     44      <Processor>TextureProcessor</Processor> 
     45      <Options>None</Options> 
     46      <Output>C:\MyTemp\JuusoM\peli\peli\peli\bin\x86\Debug\Content\police.xnb</Output> 
     47      <Time>2017-07-04T13:50:40.3567478+03:00</Time> 
     48    </Item> 
     49    <Item> 
     50      <Source>kentta.png</Source> 
     51      <Name>kentta</Name> 
     52      <Importer>TextureImporter</Importer> 
     53      <Processor>TextureProcessor</Processor> 
     54      <Options>None</Options> 
     55      <Output>C:\MyTemp\JuusoM\peli\peli\peli\bin\x86\Debug\Content\kentta.xnb</Output> 
     56      <Time>2017-07-04T14:21:05.0710531+03:00</Time> 
     57    </Item> 
     58    <Item> 
     59      <Source>gangster.png</Source> 
     60      <Name>gangster</Name> 
     61      <Importer>TextureImporter</Importer> 
     62      <Processor>TextureProcessor</Processor> 
     63      <Options>None</Options> 
     64      <Output>C:\MyTemp\JuusoM\peli\peli\peli\bin\x86\Debug\Content\gangster.xnb</Output> 
     65      <Time>2017-07-04T14:09:38.3775893+03:00</Time> 
    3966    </Item> 
    4067    <BuildSuccessful>true</BuildSuccessful> 
  • 2017/27/JuusoM/peli/peli/peli/obj/x86/Debug/cachefile-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}-targetpath.txt

    r8848 r8897  
    33Content\tahti.xnb 
    44Content\kentta1.xnb 
     5Content\police.xnb 
     6Content\kentta.xnb 
     7Content\gangster.xnb 
  • 2017/27/JuusoM/peli/peli/peli/obj/x86/Debug/peli.csproj.FileListAbsolute.txt

    r8848 r8897  
    1111C:\MyTemp\JuusoM\peli\peli\peli\obj\x86\Debug\peli.exe 
    1212C:\MyTemp\JuusoM\peli\peli\peli\obj\x86\Debug\peli.pdb 
     13C:\MyTemp\JuusoM\peli\peli\peli\bin\x86\Debug\Content\police.xnb 
     14C:\MyTemp\JuusoM\peli\peli\peli\bin\x86\Debug\Content\kentta.xnb 
     15C:\MyTemp\JuusoM\peli\peli\peli\bin\x86\Debug\Content\gangster.xnb 
  • 2017/27/JuusoM/peli/peli/peli/peli.cs

    r8848 r8897  
    99public class peli : PhysicsGame 
    1010{ 
    11      Vector nopeus = new Vector (200, 00); 
    12     Vector nopeus1 = new Vector(00, 200); 
     11     Vector nopeus = new Vector (8000, 00); 
     12    Vector nopeus1 = new Vector(00, 8000); 
    1313     
    14     //const double hyppyNopeus = 750; 
     14     
    1515    const int RUUDUN_KOKO = 40; 
    1616 
    1717    PhysicsObject pelaaja1; 
    1818 
    19     Image pelaajanKuva = LoadImage("norsu"); 
     19    Image pelaajanKuva = LoadImage("police"); 
    2020    Image tahtiKuva = LoadImage("tahti"); 
     21    Image gangsteri = LoadImage("gangster"); 
    2122 
    2223    SoundEffect maaliAani = LoadSoundEffect("maali"); 
     
    3536    void LuoKentta() 
    3637    { 
    37         
    38         TileMap kentta = TileMap.FromLevelAsset("kentta1"); 
    39         kentta.SetTileMethod('#', LisaaTaso); 
    40         kentta.SetTileMethod('*', LisaaTahti); 
    41         kentta.SetTileMethod('N', LisaaPelaaja); 
    42         kentta.Execute(RUUDUN_KOKO, RUUDUN_KOKO); 
    43         Level.CreateBorders(); 
    44         Level.Background.CreateGradient(Color.White, Color.SkyBlue); 
     38 
     39        ColorTileMap ruudut = ColorTileMap.FromLevelAsset("kentta"); 
     40 
     41        ruudut.SetTileMethod(Color.Black, LisaaTaso); 
     42        ruudut.SetTileMethod("4800FF", LisaaPelaaja); 
     43        ruudut.SetTileMethod("808080", LisaaGangsteri); 
     44 
     45        ruudut.Execute(20, 20); 
     46         
     47 
     48        Level.Background.CreateGradient(Color.AshGray, Color.AshGray); 
    4549        Gravity = new Vector(0.0, -800.0); 
    4650    } 
     
    5054        PhysicsObject taso = PhysicsObject.CreateStaticObject(leveys, korkeus); 
    5155        taso.Position = paikka; 
    52         taso.Color = Color.Green; 
     56        taso.Color = Color.Gray; 
     57        taso.Tag = "seina"; 
    5358        Add(taso); 
    5459    } 
    5560 
     61 
     62    void LisaaGangsteri(Vector paikka, double leveys, double korkeus) 
     63    { 
     64 
     65        PhysicsObject gangsta = new PhysicsObject(RUUDUN_KOKO / 2, RUUDUN_KOKO / 2); 
     66        gangsta.Position = paikka; 
     67        gangsta.Image = gangsteri; 
     68        gangsta.CanRotate = false; 
     69        gangsta.IgnoresGravity = true; 
     70        gangsta.LinearDamping = 0.7; 
     71 
     72 
     73 
     74        LabyrinthWandererBrain labyrinttiAivot = new LabyrinthWandererBrain(RUUDUN_KOKO); 
     75        labyrinttiAivot.Speed = 100.0; 
     76        labyrinttiAivot.LabyrinthWallTag = "seina"; 
     77 
     78        gangsta.Brain = labyrinttiAivot; 
     79        Add(gangsta); 
     80    } 
    5681    void LisaaTahti(Vector paikka, double leveys, double korkeus) 
    5782    { 
     83         
    5884        PhysicsObject tahti = PhysicsObject.CreateStaticObject(leveys, korkeus); 
    5985        tahti.IgnoresCollisionResponse = true; 
     
    7399        pelaaja1.CanRotate = false; 
    74100        pelaaja1.IgnoresGravity = true; 
     101        pelaaja1.LinearDamping = 0.7; 
    75102        Add(pelaaja1); 
    76103    } 
     
    82109 
    83110        Keyboard.Listen(Key.Left, ButtonState.Down, Liikuta, "Liikkuu vasemmalle", pelaaja1, -nopeus); 
    84         Keyboard.Listen(Key.Left, ButtonState.Released, Liikuta, "Liikkuu vasemmalle", pelaaja1, new Vector (0,0)); 
    85111 
    86112        Keyboard.Listen(Key.Right, ButtonState.Down, Liikuta, "Liikkuu vasemmalle", pelaaja1, nopeus); 
    87         Keyboard.Listen(Key.Right, ButtonState.Released, Liikuta, "Liikkuu vasemmalle", pelaaja1, new Vector(0, 0)); 
    88113 
    89114        Keyboard.Listen(Key.Up, ButtonState.Down, Hyppaa, "Pelaaja hyppää", pelaaja1, nopeus1); 
    90         Keyboard.Listen(Key.Up, ButtonState.Released, Hyppaa, "Pelaaja hyppää", pelaaja1, new Vector (0,0)); 
    91115 
    92116        Keyboard.Listen(Key.Down, ButtonState.Down, Hyppaa, "Pelaaja hyppää", pelaaja1, -nopeus1); 
    93         Keyboard.Listen(Key.Down, ButtonState.Released, Hyppaa, "Pelaaja hyppää", pelaaja1, new Vector(0, 0)); 
    94  
     117   
    95118        ControllerOne.Listen(Button.Back, ButtonState.Pressed, Exit, "Poistu pelistä"); 
    96  
    97119        ControllerOne.Listen(Button.DPadLeft, ButtonState.Down, Liikuta, "Pelaaja liikkuu vasemmalle", pelaaja1, nopeus); 
    98120        ControllerOne.Listen(Button.DPadRight, ButtonState.Down, Liikuta, "Pelaaja liikkuu oikealle", pelaaja1, nopeus); 
    99        // ControllerOne.Listen(Button.A, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", pelaaja1, hyppyNopeus); 
     121 
    100122 
    101123        PhoneBackButton.Listen(ConfirmExit, "Lopeta peli"); 
     
    104126    void Liikuta(PhysicsObject hahmo, Vector nopeus) 
    105127    { 
    106         hahmo.Move(nopeus); 
     128        if(nopeus.X < 0) 
     129            hahmo.TextureWrapSize = new Vector(-1, 1); 
     130        if (nopeus.X > 0) 
     131            hahmo.TextureWrapSize = new Vector(1, 1); 
     132        hahmo.Push(nopeus); 
    107133    } 
    108134 
    109135   void Hyppaa(PhysicsObject hahmo, Vector nopeus1) 
    110136   { 
    111        hahmo.Move(nopeus1); 
     137       hahmo.Push(nopeus1); 
    112138   } 
    113139 
  • 2017/27/JuusoM/peli/peli/peli/peli.csproj.Debug.cachefile

    r8848 r8897  
    33Content\tahti.xnb 
    44Content\kentta1.xnb 
     5Content\police.xnb 
     6Content\kentta.xnb 
     7Content\gangster.xnb 
  • 2017/27/JuusoM/peli/peli/peliContent/kentta1.txt

    r8848 r8897  
    1111   ##  ##  ##  ## 
    1212 
    13  *    *       *   * 
    14  ##  ##  ##  ##  ## 
    15  
     13 *    *       *   ******************* 
     14 ##  ##  ##  ##  ################### 
    1615        N 
    17 ###################### 
     16############################################## 
  • 2017/27/JuusoM/peli/peli/peliContent/peliContent.contentproj

    r8848 r8897  
    6767    </Compile> 
    6868  </ItemGroup> 
     69  <ItemGroup> 
     70    <Compile Include="police.png"> 
     71      <Name>police</Name> 
     72      <Importer>TextureImporter</Importer> 
     73      <Processor>TextureProcessor</Processor> 
     74    </Compile> 
     75  </ItemGroup> 
     76  <ItemGroup> 
     77    <Compile Include="kentta.png"> 
     78      <Name>kentta</Name> 
     79      <Importer>TextureImporter</Importer> 
     80      <Processor>TextureProcessor</Processor> 
     81    </Compile> 
     82  </ItemGroup> 
     83  <ItemGroup> 
     84    <Compile Include="gangster.png"> 
     85      <Name>gangster</Name> 
     86      <Importer>TextureImporter</Importer> 
     87      <Processor>TextureProcessor</Processor> 
     88    </Compile> 
     89  </ItemGroup> 
    6990  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    7091  <!--  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.