Changeset 8675 for 2017/24


Ignore:
Timestamp:
2017-06-14 15:02:43 (6 years ago)
Author:
npo17_23
Message:

Kenttä saatu peliin

Location:
2017/24/LeeviE
Files:
8 added
11 edited

Legend:

Unmodified
Added
Removed
  • 2017/24/LeeviE/Peli/Jump/Jump/Jump/Jump.cs

    r8652 r8675  
    1111    Image pelaajankuva = LoadImage("Tyyppi peliin cropattu"); 
    1212    Image platformi = LoadImage("Plat"); 
    13      double nopeusOikea = 200.0; 
    14     double nopeusVasen = -200.0; 
     13     double nopeusOikea = 700.0; 
     14    double nopeusVasen = -700.0; 
    1515    double hyppy = 1500.0; 
    1616 
     
    2929 
    3030    { 
     31         
    3132 
    3233        LuoKentta(); 
    33         Luolaatta(0.0, -100); 
     34        //Luolaatta(0.0, -100.0); 
     35        //Luolaatta(100.0, -200.0); 
    3436        
    35             pelaaja = new PlatformCharacter(50.0, 50.0); 
    36         pelaaja.Image = pelaajankuva; 
    37         SmoothTextures = false; 
    38  
    39         Add(pelaaja); 
     37       
    4038 
    4139 
    4240        Asetaohjaimet(); 
     41 
     42      
    4343 
    4444        Gravity = new Vector(0.0, -2200.0); 
     
    4848    } 
    4949 
     50    void LuoPelaaja(Vector paikka, double leveys, double korkeus) 
     51    { 
     52        pelaaja = new PlatformCharacter(50.0, 50.0); 
     53        pelaaja.Image = pelaajankuva; 
     54        SmoothTextures = false; 
     55        pelaaja.Position = paikka; 
     56         
     57        Add(pelaaja); 
     58 
     59    } 
    5060    void Asetaohjaimet() 
    5161    { 
     
    6272    void LuoKentta() 
    6373    { 
    64         PhysicsObject plat1 = new PhysicsObject(100.0, 20.0); 
    65         Add(plat1); 
    66         plat1.Image = platformi; 
     74        //PhysicsObject plat1 = new PhysicsObject(100.0, 20.0); 
     75        //Add(plat1); 
     76        //plat1.Image = platformi; 
     77        //plat1.MakeStatic(); 
    6778 
     79        TileMap ruudut = TileMap.FromLevelAsset("kentta1"); 
     80        ruudut.SetTileMethod('#', LuoPalikka); 
     81        ruudut.SetTileMethod('*', LuoTahti); 
     82        ruudut.SetTileMethod('!', LuoPelaaja); 
     83        ruudut.Execute( 100.0, 100.0); 
    6884 
    6985 
     
    7187 
    7288    } 
     89    void LuoPalikka(Vector paikka, double leveys, double korkeus) 
     90    { 
     91        PhysicsObject taso = PhysicsObject.CreateStaticObject(leveys, korkeus); 
     92        taso.Position = paikka; 
     93        taso.Shape = Shape.Rectangle; 
     94        taso.Color = Color.Gray; 
     95        taso.CollisionIgnoreGroup = 1; 
     96        Add(taso); 
    7397 
     98 
     99    } 
     100    void LuoTahti(Vector paikka, double leveys, double korkeus) 
     101    { 
     102        PhysicsObject tahti = PhysicsObject.CreateStaticObject(leveys, korkeus); 
     103        tahti.Position = paikka; 
     104        tahti.Shape = Shape.Rectangle; 
     105        tahti.Color = Color.Yellow; 
     106        Add(tahti);  
     107       
     108 
     109 
     110 
     111    } 
    74112    void AsetaNopeus(PlatformCharacter pelaaja, double nopeus) 
    75113    { 
     
    87125    } 
    88126 
    89     void Luolaatta(double x, double y) 
    90     { 
    91         PhysicsObject laatta1 = new PhysicsObject(1000.0, 10.0); 
    92         laatta1.MakeStatic(); 
    93         laatta1.Y = y; 
    94         laatta1.X = x; 
    95         Add(laatta1); 
    96         laatta1.Color = Color.Gray; 
     127    //void Luolaatta(double x, double y) 
     128    //{ 
     129    //    PhysicsObject laatta1 = new PhysicsObject(1000.0, 10.0); 
     130    //    laatta1.MakeStatic(); 
     131    //    laatta1.Y = y; 
     132    //    laatta1.X = x; 
     133    //    Add(laatta1); 
     134    //    laatta1.Color = Color.Gray; 
    97135 
    98         PhysicsObject laatta2 = new PhysicsObject(10.0, 1000.0); 
    99         laatta2.MakeStatic(); 
    100         Add(laatta2); 
    101         laatta2.X = 500; 
    102         laatta2.Y = 400; 
    103         laatta2.Color = Color.Gray; 
     136        //PhysicsObject laatta2 = new PhysicsObject(10.0, 1000.0); 
     137        //laatta2.MakeStatic(); 
     138        //Add(laatta2); 
     139        //laatta2.X = 500; 
     140        //laatta2.Y = 400; 
     141        //laatta2.Color = Color.Gray; 
    104142 
    105         PhysicsObject laatta3 = new PhysicsObject(10.0, 1000.0); 
    106         laatta3.MakeStatic(); 
    107         Add(laatta3); 
    108         laatta3.X = -500; 
    109         laatta3.Y = 400; 
    110         laatta3.Color = Color.Gray; 
     143        //PhysicsObject laatta3 = new PhysicsObject(10.0, 1000.0); 
     144        //laatta3.MakeStatic(); 
     145        //Add(laatta3); 
     146        //laatta3.X = -500; 
     147        //laatta3.Y = 400; 
     148        //laatta3.Color = Color.Gray; 
    111149    } 
    112150 
    113     } 
     151     
    114152 
    115153 
  • 2017/24/LeeviE/Peli/Jump/Jump/Jump/Jump.csproj.Debug.cachefile

    r8652 r8675  
    22Content\Tyyppi peliin cropattu.xnb 
    33Content\Plat.xnb 
     4Content\kentta1.xnb 
  • 2017/24/LeeviE/Peli/Jump/Jump/Jump/obj/x86/Debug/ContentPipeline-{2750B644-1BA7-4D9C-B766-2A8DD7E77FC1}.xml

    r8652 r8675  
    2828      <Output>C:\MyTemp\LeeviE\Peli\Jump\Jump\Jump\bin\x86\Debug\Content\Plat.xnb</Output> 
    2929      <Time>2017-06-14T12:47:07.0101534+03:00</Time> 
     30    </Item> 
     31    <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\LeeviE\Peli\Jump\Jump\Jump\bin\x86\Debug\Content\kentta1.xnb</Output> 
     38      <Time>2017-06-14T14:57:06.9173888+03:00</Time> 
    3039    </Item> 
    3140    <BuildSuccessful>true</BuildSuccessful> 
  • 2017/24/LeeviE/Peli/Jump/Jump/Jump/obj/x86/Debug/Jump.csproj.FileListAbsolute.txt

    r8652 r8675  
    1010C:\MyTemp\LeeviE\Peli\Jump\Jump\Jump\bin\x86\Debug\Content\Tyyppi peliin cropattu.xnb 
    1111C:\MyTemp\LeeviE\Peli\Jump\Jump\Jump\bin\x86\Debug\Content\Plat.xnb 
     12C:\MyTemp\LeeviE\Peli\Jump\Jump\Jump\bin\x86\Debug\Content\kentta1.xnb 
  • 2017/24/LeeviE/Peli/Jump/Jump/Jump/obj/x86/Debug/cachefile-{2750B644-1BA7-4D9C-B766-2A8DD7E77FC1}-targetpath.txt

    r8652 r8675  
    22Content\Tyyppi peliin cropattu.xnb 
    33Content\Plat.xnb 
     4Content\kentta1.xnb 
  • 2017/24/LeeviE/Peli/Jump/Jump/JumpContent/JumpContent.contentproj

    r8652 r8675  
    6666    </Compile> 
    6767  </ItemGroup> 
     68  <ItemGroup> 
     69    <Compile Include="kentta1.txt"> 
     70      <Name>kentta1</Name> 
     71      <Importer>TextFileImporter</Importer> 
     72      <Processor>TextFileContentProcessor</Processor> 
     73    </Compile> 
     74  </ItemGroup> 
    6875  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    6976  <!--  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.