- Timestamp:
- 2013-06-27 13:00:19 (10 years ago)
- Location:
- 2013/26/AkseliT/Jump Game/Jump Game
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
2013/26/AkseliT/Jump Game/Jump Game/Jump Game/Jump_Game.cs
r4257 r4259 9 9 public class Jump_Game : PhysicsGame 10 10 { 11 int kenttaNro = 1;11 int kenttaNro = 6; 12 12 PhysicsObject piikki = new PhysicsObject(20, 20); 13 Image pomminkuva = LoadImage("pommi"); 13 14 14 15 Image piikinkuva = LoadImage("piikki"); … … 39 40 else if (kenttaNro == 4) LuoKentta("Kentta4"); 40 41 else if (kenttaNro == 5) LuoKentta("kentta5"); 41 else if (kenttaNro > 5) Exit(); 42 else if (kenttaNro == 6) LuoKentta("kentta6"); 43 else if (kenttaNro > 6) Exit(); 42 44 LuoOhjaimet(); 43 45 } … … 60 62 ruudut.SetTileMethod("FFD800", LuoTahti); 61 63 ruudut.SetTileMethod("808080", LuoPiikki); 64 ruudut.SetTileMethod("1900FF", LuoPommi); 62 65 ruudut.Execute(20, 20); 63 66 Camera.ZoomToLevel(); 64 Level.BackgroundColor = Color.Black; 67 Level.BackgroundColor = Color.DarkAzure; 68 65 69 Level.CreateBorders(false); 66 70 Gravity = new Vector(0, -500); … … 83 87 Begin(); 84 88 }); 89 AddCollisionHandler(pelaaja, "pommi", delegate(PhysicsObject olio, PhysicsObject pommi) 90 { 91 Explosion rajahdys = new Explosion(100); 92 rajahdys.Position = pommi.Position; 93 Add(rajahdys); 94 pommi.Destroy(); 95 }); 85 96 } 86 97 … … 147 158 } 148 159 149 160 void LuoPommi(Vector paikka, double leveys, double korkeus) 161 { 162 PhysicsObject pommi = new PhysicsObject(10, 10); 163 pommi.Image = pomminkuva; 164 pommi.Position = paikka; 165 pommi.Tag = "pommi"; 166 Add(pommi); 167 } 150 168 151 169 } 170 152 171 -
2013/26/AkseliT/Jump Game/Jump Game/Jump GameContent/Jump GameContent.contentproj
r4257 r4259 115 115 </Compile> 116 116 </ItemGroup> 117 <ItemGroup> 118 <Compile Include="kentta6.png"> 119 <Name>kentta6</Name> 120 <Importer>TextureImporter</Importer> 121 <Processor>TextureProcessor</Processor> 122 </Compile> 123 </ItemGroup> 124 <ItemGroup> 125 <Compile Include="pommi.png"> 126 <Name>pommi</Name> 127 <Importer>TextureImporter</Importer> 128 <Processor>TextureProcessor</Processor> 129 </Compile> 130 </ItemGroup> 117 131 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 118 132 <!-- 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.