- Timestamp:
- 2015-06-29 14:55:41 (8 years ago)
- Location:
- 2015/27/SanteriK
- Files:
-
- 7 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
2015/27/SanteriK/Hundreddays/Hundreddays/Hundreddays/Hundreddays.cs
r6497 r6532 9 9 public class Hundreddays : PhysicsGame 10 10 { 11 Image wallimage = LoadImage("seinä"); 12 13 Image groundImage = LoadImage("lattia"); 11 14 public override void Begin() 12 15 { 16 LuoKentta(); 13 17 // TODO: Kirjoita ohjelmakoodisi tähän 14 15 18 PhoneBackButton.Listen(ConfirmExit, "Lopeta peli"); 16 19 Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 17 20 } 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 18 51 } 52 53 -
2015/27/SanteriK/Hundreddays/Hundreddays/HundreddaysContent/HundreddaysContent.contentproj
r6497 r6532 45 45 <Reference Include="AnimationExtension" /> 46 46 </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> 47 66 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 48 67 <!-- 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.