- Timestamp:
- 2014-10-18 15:06:40 (8 years ago)
- Location:
- 2014/koodauskerho/38/PietuR
- Files:
-
- 30 added
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
2014/koodauskerho/38/PietuR/Läpsylintu/Läpsylintu/Läpsylintu/Läpsylintu.cs
r5730 r5755 148 148 if (peliKaynnissa) 149 149 { 150 MessageDisplay.Add("Kuolit! :(");150 MessageDisplay.Add("Kuolit! ( ͡° ͜ʖ ͡°)"); 151 151 Keyboard.Disable(Key.Up); 152 152 liikutusajastin.Stop(); -
2014/koodauskerho/38/PietuR/Weaporage/Weaporage/Weaporage/Weaporage.cs
r5730 r5755 7 7 using Jypeli.Widgets; 8 8 9 class Pommi : PhysicsObject 10 { 11 public Pommi(double leveys, double korkeus) 12 : base(leveys, korkeus) 13 { 14 } 15 } 16 17 18 9 19 public class Weaporage : PhysicsGame 10 20 { … … 20 30 Image Vasarankuva = LoadImage("Vasara"); 21 31 Image Sauvankuva = LoadImage("Sauva"); 32 Image Pistoolinkuva = LoadImage("Pistooli"); 33 Image Luodinkuva = LoadImage("Luoti"); 34 Image Pomminkuva = LoadImage("Pommi1"); 35 private Image[] Pomminposaus = LoadImages("Pommi2", "Pommi3", "Pommi4", "Pommi5", "Pommi6"); 36 Image Rajahdyskuva = LoadImage("Rajahdys"); 37 Image Pallonkuva = LoadImage("Pallo"); 22 38 23 39 public override void Begin() … … 37 53 pelaaja3 = new Pelaaja(5); 38 54 pelaaja4 = new Pelaaja(5); 55 39 56 IsMouseVisible = true; 40 57 … … 136 153 void LisaaAseetPeliin(Vector asepaikka) 137 154 { 138 int asenumero = RandomGen.NextInt(1, 6);155 int asenumero = RandomGen.NextInt(1, 8); 139 156 if (asenumero == 1) 140 157 { … … 183 200 ase5.Tag = "ase"; 184 201 Add(ase5); 202 } 203 else if (asenumero == 6) 204 { 205 PhysicsObject ase6 = new PhysicsObject(60, 30); 206 ase6.Position = asepaikka; 207 ase6.Image = Pistoolinkuva; 208 ase6.Shape = Shape.FromImage(Pistoolinkuva); 209 ase6.Tag = "ase"; 210 Timer laukausaika = new Timer(); 211 laukausaika.Interval = 3; 212 laukausaika.Timeout += delegate 213 { 214 215 PhysicsObject Luoti = new PhysicsObject(15, 7); 216 Luoti.Position = ase6.Position; 217 Luoti.Image = Luodinkuva; 218 Luoti.Hit(ase6.Angle.GetVector() * 5000); 219 Luoti.LifetimeLeft = TimeSpan.FromSeconds(5); 220 Luoti.Tag = "ase"; 221 Add(Luoti); 222 }; 223 laukausaika.Start(); 224 Add(ase6); 225 } 226 else if (asenumero == 7) 227 { 228 Pommi ase7 = new Pommi(50, 50); 229 ase7.Position = asepaikka; 230 ase7.Image = Pomminkuva; 231 ase7.Shape = Shape.FromImage(Pomminkuva); 232 ase7.Tag = "ase"; 233 Add(ase7); 185 234 } 186 235 } … … 299 348 } 300 349 301 350 void Sytytapommi(PhysicsObject pommi) 351 { 352 pommi.Animation = new Animation(Pomminposaus); 353 pommi.Animation.FPS = 1; 354 pommi.Animation.Played += delegate 355 { 356 Explosion rajahdys = new Explosion(1000); 357 rajahdys.Position = pommi.Position; 358 rajahdys.Image = Rajahdyskuva; 359 rajahdys.Speed = 500; 360 Add(rajahdys); 361 posahdus(rajahdys); 362 pommi.Destroy(); 363 }; 364 pommi.Animation.Start(); 365 366 } 367 void posahdus(Explosion rajahdys) 368 { 369 PhysicsObject posaus = new PhysicsObject(500, 500); 370 posaus.Position = rajahdys.Position; 371 posaus.Shape = Shape.Circle; 372 posaus.LifetimeLeft = TimeSpan.FromSeconds(3); 373 posaus.Tag = "ase"; 374 Add(posaus); 375 376 } 302 377 void KeraaAseVasempaanKateen(PhysicsObject kasi, PhysicsObject ase, Pelaaja pelaaja) 303 378 { … … 305 380 { 306 381 pelaaja.vasenKasi = LiitaYhteen(kasi, ase, Vector.Zero); 382 383 if (ase is Pommi) 384 { 385 Sytytapommi(ase); 386 } 307 387 } 308 388 //ase.CollisionIgnoreGroup = kasi.CollisionIgnoreGroup; … … 315 395 { 316 396 pelaaja.oikeaKasi = LiitaYhteen(kasi, ase, Vector.Zero); 397 398 if (ase is Pommi) 399 { 400 Sytytapommi(ase); 401 } 317 402 } 318 403 //ase.CollisionIgnoreGroup = kasi.CollisionIgnoreGroup; -
2014/koodauskerho/38/PietuR/Weaporage/Weaporage/Weaporage/Weaporage.csproj.Debug.cachefile
r5730 r5755 4 4 Content\Vasara.xnb 5 5 Content\Sauva.xnb 6 Content\Pistooli.xnb 7 Content\Luoti.xnb 8 Content\Pommi1.xnb 9 Content\Pommi2.xnb 10 Content\Pommi3.xnb 11 Content\Pommi4.xnb 12 Content\Pommi5.xnb 13 Content\Pommi6.xnb 14 Content\Pallo.xnb 15 Content\Rajahdys.xnb -
2014/koodauskerho/38/PietuR/Weaporage/Weaporage/Weaporage/obj/x86/Debug/ContentPipeline-{06B8DCF8-84D5-47F5-8E6A-9758023E8CEC}.xml
r5730 r5755 46 46 <Output>C:\MyTemp\PietuR\Weaporage\Weaporage\Weaporage\bin\x86\Debug\Content\Sauva.xnb</Output> 47 47 <Time>2014-09-20T14:24:28.2178158+03:00</Time> 48 </Item> 49 <Item> 50 <Source>Pistooli.png</Source> 51 <Name>Pistooli</Name> 52 <Importer>TextureImporter</Importer> 53 <Processor>TextureProcessor</Processor> 54 <Options>None</Options> 55 <Output>C:\MyTemp\PietuR\Weaporage\Weaporage\Weaporage\bin\x86\Debug\Content\Pistooli.xnb</Output> 56 <Time>2014-10-18T11:19:55.4946015+03:00</Time> 57 </Item> 58 <Item> 59 <Source>Luoti.png</Source> 60 <Name>Luoti</Name> 61 <Importer>TextureImporter</Importer> 62 <Processor>TextureProcessor</Processor> 63 <Options>None</Options> 64 <Output>C:\MyTemp\PietuR\Weaporage\Weaporage\Weaporage\bin\x86\Debug\Content\Luoti.xnb</Output> 65 <Time>2014-10-18T12:24:39.0075077+03:00</Time> 66 </Item> 67 <Item> 68 <Source>Pommi1.png</Source> 69 <Name>Pommi1</Name> 70 <Importer>TextureImporter</Importer> 71 <Processor>TextureProcessor</Processor> 72 <Options>None</Options> 73 <Output>C:\MyTemp\PietuR\Weaporage\Weaporage\Weaporage\bin\x86\Debug\Content\Pommi1.xnb</Output> 74 <Time>2014-10-18T13:03:26.3242991+03:00</Time> 75 </Item> 76 <Item> 77 <Source>Pommi2.png</Source> 78 <Name>Pommi2</Name> 79 <Importer>TextureImporter</Importer> 80 <Processor>TextureProcessor</Processor> 81 <Options>None</Options> 82 <Output>C:\MyTemp\PietuR\Weaporage\Weaporage\Weaporage\bin\x86\Debug\Content\Pommi2.xnb</Output> 83 <Time>2014-10-18T13:03:26.3242991+03:00</Time> 84 </Item> 85 <Item> 86 <Source>Pommi3.png</Source> 87 <Name>Pommi3</Name> 88 <Importer>TextureImporter</Importer> 89 <Processor>TextureProcessor</Processor> 90 <Options>None</Options> 91 <Output>C:\MyTemp\PietuR\Weaporage\Weaporage\Weaporage\bin\x86\Debug\Content\Pommi3.xnb</Output> 92 <Time>2014-10-18T13:03:26.3242991+03:00</Time> 93 </Item> 94 <Item> 95 <Source>Pommi4.png</Source> 96 <Name>Pommi4</Name> 97 <Importer>TextureImporter</Importer> 98 <Processor>TextureProcessor</Processor> 99 <Options>None</Options> 100 <Output>C:\MyTemp\PietuR\Weaporage\Weaporage\Weaporage\bin\x86\Debug\Content\Pommi4.xnb</Output> 101 <Time>2014-10-18T13:03:26.3398993+03:00</Time> 102 </Item> 103 <Item> 104 <Source>Pommi5.png</Source> 105 <Name>Pommi5</Name> 106 <Importer>TextureImporter</Importer> 107 <Processor>TextureProcessor</Processor> 108 <Options>None</Options> 109 <Output>C:\MyTemp\PietuR\Weaporage\Weaporage\Weaporage\bin\x86\Debug\Content\Pommi5.xnb</Output> 110 <Time>2014-10-18T13:03:26.3398993+03:00</Time> 111 </Item> 112 <Item> 113 <Source>Pommi6.png</Source> 114 <Name>Pommi6</Name> 115 <Importer>TextureImporter</Importer> 116 <Processor>TextureProcessor</Processor> 117 <Options>None</Options> 118 <Output>C:\MyTemp\PietuR\Weaporage\Weaporage\Weaporage\bin\x86\Debug\Content\Pommi6.xnb</Output> 119 <Time>2014-10-18T13:03:26.3398993+03:00</Time> 120 </Item> 121 <Item> 122 <Source>Pallo.png</Source> 123 <Name>Pallo</Name> 124 <Importer>TextureImporter</Importer> 125 <Processor>TextureProcessor</Processor> 126 <Options>None</Options> 127 <Output>C:\MyTemp\PietuR\Weaporage\Weaporage\Weaporage\bin\x86\Debug\Content\Pallo.xnb</Output> 128 <Time>2014-10-18T14:38:24.3215518+03:00</Time> 129 </Item> 130 <Item> 131 <Source>Rajahdys.png</Source> 132 <Name>Rajahdys</Name> 133 <Importer>TextureImporter</Importer> 134 <Processor>TextureProcessor</Processor> 135 <Options>None</Options> 136 <Output>C:\MyTemp\PietuR\Weaporage\Weaporage\Weaporage\bin\x86\Debug\Content\Rajahdys.xnb</Output> 137 <Time>2014-10-18T14:38:24.3215518+03:00</Time> 48 138 </Item> 49 139 <BuildSuccessful>true</BuildSuccessful> -
2014/koodauskerho/38/PietuR/Weaporage/Weaporage/Weaporage/obj/x86/Debug/Weaporage.csproj.FileListAbsolute.txt
r5730 r5755 24 24 C:\MyTemp\npo\npo_pelit\2014\24\PietuR\Weaporage\Weaporage\Weaporage\obj\x86\Debug\Weaporage.pdb 25 25 C:\MyTemp\PietuR\Weaporage\Weaporage\Weaporage\bin\x86\Debug\Content\Sauva.xnb 26 C:\MyTemp\PietuR\Weaporage\Weaporage\Weaporage\bin\x86\Debug\Content\Pistooli.xnb 27 C:\MyTemp\PietuR\Weaporage\Weaporage\Weaporage\bin\x86\Debug\Content\Luoti.xnb 28 C:\MyTemp\PietuR\Weaporage\Weaporage\Weaporage\bin\x86\Debug\Content\Pommi1.xnb 29 C:\MyTemp\PietuR\Weaporage\Weaporage\Weaporage\bin\x86\Debug\Content\Pommi2.xnb 30 C:\MyTemp\PietuR\Weaporage\Weaporage\Weaporage\bin\x86\Debug\Content\Pommi3.xnb 31 C:\MyTemp\PietuR\Weaporage\Weaporage\Weaporage\bin\x86\Debug\Content\Pommi4.xnb 32 C:\MyTemp\PietuR\Weaporage\Weaporage\Weaporage\bin\x86\Debug\Content\Pommi5.xnb 33 C:\MyTemp\PietuR\Weaporage\Weaporage\Weaporage\bin\x86\Debug\Content\Pommi6.xnb 34 C:\MyTemp\PietuR\Weaporage\Weaporage\Weaporage\bin\x86\Debug\Content\Pallo.xnb 35 C:\MyTemp\PietuR\Weaporage\Weaporage\Weaporage\bin\x86\Debug\Content\Rajahdys.xnb -
2014/koodauskerho/38/PietuR/Weaporage/Weaporage/Weaporage/obj/x86/Debug/cachefile-{06B8DCF8-84D5-47F5-8E6A-9758023E8CEC}-targetpath.txt
r5730 r5755 4 4 Content\Vasara.xnb 5 5 Content\Sauva.xnb 6 Content\Pistooli.xnb 7 Content\Luoti.xnb 8 Content\Pommi1.xnb 9 Content\Pommi2.xnb 10 Content\Pommi3.xnb 11 Content\Pommi4.xnb 12 Content\Pommi5.xnb 13 Content\Pommi6.xnb 14 Content\Pallo.xnb 15 Content\Rajahdys.xnb -
2014/koodauskerho/38/PietuR/Weaporage/Weaporage/WeaporageContent/WeaporageContent.contentproj
r5730 r5755 74 74 </Compile> 75 75 </ItemGroup> 76 <ItemGroup> 77 <Compile Include="Pistooli.png"> 78 <Name>Pistooli</Name> 79 <Importer>TextureImporter</Importer> 80 <Processor>TextureProcessor</Processor> 81 </Compile> 82 </ItemGroup> 83 <ItemGroup> 84 <Compile Include="Luoti.png"> 85 <Name>Luoti</Name> 86 <Importer>TextureImporter</Importer> 87 <Processor>TextureProcessor</Processor> 88 </Compile> 89 </ItemGroup> 90 <ItemGroup> 91 <Compile Include="Pommi1.png"> 92 <Name>Pommi1</Name> 93 <Importer>TextureImporter</Importer> 94 <Processor>TextureProcessor</Processor> 95 </Compile> 96 <Compile Include="Pommi2.png"> 97 <Name>Pommi2</Name> 98 <Importer>TextureImporter</Importer> 99 <Processor>TextureProcessor</Processor> 100 </Compile> 101 <Compile Include="Pommi3.png"> 102 <Name>Pommi3</Name> 103 <Importer>TextureImporter</Importer> 104 <Processor>TextureProcessor</Processor> 105 </Compile> 106 <Compile Include="Pommi4.png"> 107 <Name>Pommi4</Name> 108 <Importer>TextureImporter</Importer> 109 <Processor>TextureProcessor</Processor> 110 </Compile> 111 <Compile Include="Pommi5.png"> 112 <Name>Pommi5</Name> 113 <Importer>TextureImporter</Importer> 114 <Processor>TextureProcessor</Processor> 115 </Compile> 116 <Compile Include="Pommi6.png"> 117 <Name>Pommi6</Name> 118 <Importer>TextureImporter</Importer> 119 <Processor>TextureProcessor</Processor> 120 </Compile> 121 </ItemGroup> 122 <ItemGroup> 123 <Compile Include="Pallo.png"> 124 <Name>Pallo</Name> 125 <Importer>TextureImporter</Importer> 126 <Processor>TextureProcessor</Processor> 127 </Compile> 128 <Compile Include="Rajahdys.png"> 129 <Name>Rajahdys</Name> 130 <Importer>TextureImporter</Importer> 131 <Processor>TextureProcessor</Processor> 132 </Compile> 133 </ItemGroup> 76 134 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 77 135 <!-- 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.