Changeset 6532


Ignore:
Timestamp:
2015-06-29 14:55:41 (4 years ago)
Author:
misakana
Message:

kenttä latautuu ruudulle

Location:
2015/27/SanteriK
Files:
7 added
2 edited

Legend:

Unmodified
Added
Removed
  • 2015/27/SanteriK/Hundreddays/Hundreddays/Hundreddays/Hundreddays.cs

    r6497 r6532  
    99public class Hundreddays : PhysicsGame 
    1010{ 
     11    Image wallimage = LoadImage("seinä"); 
     12 
     13    Image groundImage = LoadImage("lattia"); 
    1114    public override void Begin() 
    1215    { 
     16        LuoKentta(); 
    1317        // TODO: Kirjoita ohjelmakoodisi tähän 
    14  
    1518        PhoneBackButton.Listen(ConfirmExit, "Lopeta peli"); 
    1619        Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 
    1720    } 
     21    void LuoLattia(Vector paikka, double leveys, double korkeus) 
     22    { 
     23        GameObject lattia = new GameObject(leveys, korkeus); 
     24        lattia.Position = paikka; 
     25        Add(lattia); 
     26        lattia.Image = groundImage; 
     27 
     28    } 
     29 
     30    void LuoKentta() 
     31    { 
     32        ColorTileMap ruudut = ColorTileMap.FromLevelAsset("kenttä"); 
     33 
     34        //ruudut.SetTileMethod(Color.Green,  LuoPelaaja); 
     35        ruudut.SetTileMethod(Color.Black, LuoTaso); 
     36        ruudut.SetTileMethod(Color.Gray, LuoLattia); 
     37        ruudut.Execute(20, 20); 
     38        Camera.ZoomToLevel(); 
     39    } 
     40    void LuoTaso(Vector paikka, double leveys, double korkeus) 
     41    { 
     42        PhysicsObject taso = PhysicsObject.CreateStaticObject(leveys, korkeus); 
     43        taso.Position = paikka; 
     44        taso.Image = wallimage; 
     45        taso.CollisionIgnoreGroup = 1; 
     46        Add(taso); 
     47 
     48 
     49    } 
     50 
    1851} 
     52 
     53 
  • 2015/27/SanteriK/Hundreddays/Hundreddays/HundreddaysContent/HundreddaysContent.contentproj

    r6497 r6532  
    4545    <Reference Include="AnimationExtension" /> 
    4646  </ItemGroup> 
     47  <ItemGroup> 
     48    <Compile Include="kenttä.png"> 
     49      <Name>kenttä</Name> 
     50      <Importer>TextureImporter</Importer> 
     51      <Processor>TextureProcessor</Processor> 
     52    </Compile> 
     53  </ItemGroup> 
     54  <ItemGroup> 
     55    <Compile Include="lattia.png"> 
     56      <Name>lattia</Name> 
     57      <Importer>TextureImporter</Importer> 
     58      <Processor>TextureProcessor</Processor> 
     59    </Compile> 
     60    <Compile Include="seinä.png"> 
     61      <Name>seinä</Name> 
     62      <Importer>TextureImporter</Importer> 
     63      <Processor>TextureProcessor</Processor> 
     64    </Compile> 
     65  </ItemGroup> 
    4766  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    4867  <!--  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.