- Timestamp:
- 2017-07-07 11:03:09 (6 years ago)
- Location:
- 2017/27/EinoS/FireFight_Demo
- Files:
-
- 4 added
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
2017/27/EinoS/FireFight_Demo/FireFight_Demo/FireFight_Demo/FireFight_Demo.cs
r8980 r8988 25 25 PhysicsObject alareuna; 26 26 PhysicsObject ylareuna; 27 AssaultRifle pelaajan1Ase;28 AssaultRifle pelaajan2Ase;29 27 Image pelaaja1kuva = LoadImage("IdleBO1"); 30 28 Image pelaaja2kuva = LoadImage("IdleRO1"); 29 Image kentta1bg = LoadImage("Kenttä1BG"); 31 30 Image titlelogo = LoadImage("FireFightLogo"); 32 31 Image ammusKuva = LoadImage("Luoti1"); … … 34 33 Image hylsyKuva = LoadImage("Hylsy"); 35 34 Image hylsyKuva2 = LoadImage("Hylsy2"); 35 Image osuma = LoadImage("HIT"); 36 36 Timer suuliekkitimer; 37 37 Explosion ammus1rajahdys; 38 Explosion ammus2rajahdys; 38 39 39 40 int kenttanro = 1; … … 44 45 int pelaaja1hypyt = 1; 45 46 int pelaaja2hypyt = 1; 47 int sairaannopee = 500; 46 48 IntMeter pelaaja1pisteet; 47 49 IntMeter pelaaja2pisteet; … … 53 55 int pelaaja1suunta = 2; 54 56 int pelaaja2suunta = 2; 55 56 57 public override void Begin() 57 58 { … … 139 140 //Camera.ZoomFactor = 1; 140 141 //Camera.Follow(pelaaja1, pelaaja2); 141 //Camera.StayInLevel = true;142 Camera.StayInLevel = true; 142 143 Camera.ZoomTo(-1500, -1500, 1500, 500); 143 144 } … … 161 162 ylareuna.Tag = "ylareuna"; 162 163 Level.CreateHorizontalBorders(1, false, Color.Azure); 164 Level.Background.Image = kentta1bg; 165 Level.Background.FitToLevel(); 163 166 } 164 167 void Kontrollit() … … 179 182 Keyboard.Listen(Key.D, ButtonState.Down, SuunnanVaihdosRO, "null"); 180 183 Keyboard.Listen(Key.A, ButtonState.Down, SuunnanVaihdosRV, "null"); 181 182 } 183 184 } 184 185 void Pelaaja1Hyppaa(PlatformCharacter hahmo, double nopeus) 185 186 { … … 199 200 200 201 } 201 202 202 void SuunnanVaihdosBO() 203 203 { … … 216 216 pelaaja2suunta = 1; 217 217 } 218 219 218 void Poistasuuliekkiajastin() 220 219 … … 225 224 226 225 } 227 228 229 230 226 void Pelaaja1Ammu() 231 227 { 232 233 228 hylsy = new PhysicsObject(35, 22); 234 229 ammus = new PhysicsObject(77, 20); 235 230 suuliekki = new PhysicsObject(180, 80); 236 231 suuliekki2 = new PhysicsObject(180, 80); 237 232 238 233 suuliekki.IgnoresExplosions = true; … … 241 236 suuliekki.CanRotate = false; 242 237 suuliekkixd = LoadAnimation("suuliekkix"); 238 suuliekki2.IgnoresExplosions = true; 239 suuliekki2.IgnoresCollisionResponse = true; 240 suuliekki2.IgnoresGravity = true; 241 suuliekki2.CanRotate = false; 243 242 244 243 hylsy.RotateImage = true; … … 249 248 if (pelaaja1suunta == 2) 250 249 { 251 252 250 ammus.Shape = Shape.Circle; 253 251 ammus.IgnoresExplosions = true; … … 260 258 ammus.Y = pelaaja1.Y + 74; 261 259 ammus.Hit(lähtönopeusO); 260 AddCollisionHandler(ammus, "pelaaja2", Ammus1Osuu); 262 261 263 262 hylsy.X = pelaaja1.X + 62; … … 271 270 suuliekki.Animation.Start(1); 272 271 273 274 272 Add(suuliekki); 275 276 273 Add(hylsy); 277 278 274 Add(ammus); 279 280 275 suuliekkitimer.Start(1); 281 276 } 282 277 if (pelaaja1suunta == 1) 283 278 { 284 285 279 ammus.Shape = Shape.Circle; 286 280 ammus.IgnoresExplosions = true; … … 293 287 ammus.Tag = "9mmB"; 294 288 ammus.Hit(lähtönopeusV); 289 AddCollisionHandler(ammus, "pelaaja2", Ammus1Osuu); 295 290 296 291 hylsy.X = pelaaja1.X + -62; … … 298 293 hylsy.Hit(ejectV); 299 294 hylsy.Image = hylsyKuva2; 300 301 302 295 suuliekki2.X = pelaaja1.X - 200; 296 suuliekki2.Y = pelaaja1.Y + 74; 297 suuliekki2.Animation = new Animation(suuliekkixd); 298 suuliekki2.Animation.Start(1); 299 300 Add(suuliekki2); 303 301 Add(hylsy); 304 305 302 Add(ammus); 306 } 307 308 309 /*/Vector suunta = (pelaaja2.Position - pelaaja1.Position).Normalize(); 310 ase.Angle = suunta.Angle; 311 PhysicsObject ammus = ase.Shoot();/*/ 312 303 suuliekkitimer.Start(1); 304 } 305 306 } 307 void Ammus1Osuu(PhysicsObject ammus, PhysicsObject pelaaja2) 308 { 309 ammus1rajahdys = new Explosion(300); 310 ammus1rajahdys.Image = osuma; 311 ammus1rajahdys.Speed = sairaannopee*4; 312 ammus1rajahdys.Force = 1000; 313 ammus1rajahdys.Position = ammus.Position; 314 Add(ammus1rajahdys); 315 ammus.Destroy(); 313 316 } 314 317 void Pelaaja2Ammu() 315 318 { 316 317 318 319 hylsy2 = new PhysicsObject(35, 22); 319 320 320 hylsy2.RotateImage = true; 321 321 hylsy2.CanRotate = true; 322 322 hylsy2.AngularVelocity = 10; 323 323 hylsy2.IgnoresCollisionResponse = true; 324 325 324 if (pelaaja2suunta == 2) 326 327 328 329 325 { 330 326 ammus2 = new PhysicsObject(77, 20); 331 332 333 334 327 ammus2.Shape = Shape.Circle; 335 328 ammus2.IgnoresCollisionResponse = true; … … 342 335 ammus2.Y = pelaaja2.Y + 74; 343 336 ammus2.Hit(lähtönopeusO); 337 AddCollisionHandler(ammus2, "pelaaja1", Ammus2Osuu); 344 338 345 339 hylsy2 = new PhysicsObject(35, 22); … … 357 351 358 352 Add(ammus2); 359 360 361 353 } 362 354 if (pelaaja2suunta == 1) … … 375 367 ammus2.Y = pelaaja2.Y + 74; 376 368 ammus2.Hit(lähtönopeusV); 369 AddCollisionHandler(ammus2, "pelaaja1", Ammus2Osuu); 377 370 378 371 hylsy2 = new PhysicsObject(35, 22); … … 399 392 PhysicsObject ammus = ase.Shoot();/*/ 400 393 } 394 void Ammus2Osuu(PhysicsObject ammus, PhysicsObject pelaaja1) 395 { 396 ammus2rajahdys = new Explosion(300); 397 ammus2rajahdys.Image = osuma; 398 ammus2rajahdys.Speed = sairaannopee*4; 399 ammus2rajahdys.Force = 1000; 400 ammus2rajahdys.Position = ammus.Position; 401 Add(ammus2rajahdys); 402 ammus.Destroy(); 403 } 401 404 void Poistasuuliekki() 402 405 { 403 404 406 suuliekki.Destroy(); 405 } 406 407 408 409 void AmmusTuhoutuu(PhysicsObject ammus, PhysicsObject kohde) 410 { 411 Explosion ammusrajahdys = new Explosion(45); 412 ammusrajahdys.IsVisible = false; 413 ammusrajahdys.Force = 1000; 414 ammusrajahdys.Speed = 200; 415 ammusrajahdys.Position = ammus.Position; 416 Add(ammusrajahdys); 417 ammus.Destroy(); 418 407 suuliekki2.Destroy(); 408 suuliekki.Destroy(); 409 suuliekki2.Destroy(); 410 419 411 } 420 412 void Liikuta(PlatformCharacter hahmo, double nopeus) … … 432 424 taso.MakeOneWay(); 433 425 taso.MakeStatic(); 434 426 taso.IsVisible = false; 435 427 436 428 Add(taso); … … 454 446 AddCollisionHandler(pelaaja1, "taso", TuplaHyppy); 455 447 AddCollisionHandler(pelaaja1, "alareuna", Pelaaja1Kuolee); 448 //pelaaja1.IgnoresCollisionWith(pelaaja2); 456 449 pelaaja1.MaintainMomentum = true; 457 450 pelaaja1.Tag = "pelaaja1"; … … 459 452 Add(pelaaja1); 460 453 461 pelaajan1Ase = new AssaultRifle(120, 40);462 pelaajan1Ase.FireRate = 16;463 pelaajan1Ase.ProjectileCollision = AmmusTuhoutuu;464 pelaajan1Ase.AmmoIgnoresExplosions = true;465 pelaajan1Ase.Image = null;466 pelaajan1Ase.Color = new Color(0, 0, 0, 0);467 pelaaja1.Add(pelaajan1Ase);468 454 } 469 455 void LisaaToinenPelaaja(Vector paikka, double leveys, double korkeus) … … 474 460 AddCollisionHandler(pelaaja2, "taso", TuplaHyppy); 475 461 AddCollisionHandler(pelaaja2, "alareuna", Pelaaja2Kuolee); 462 //pelaaja2.IgnoresCollisionWith(pelaaja1); 476 463 pelaaja2.MaintainMomentum = true; 477 464 pelaaja2.Tag = "pelaaja2"; … … 479 466 Add(pelaaja2); 480 467 481 pelaajan2Ase = new AssaultRifle(60, 20);482 pelaajan2Ase.FireRate = 16;483 pelaajan2Ase.ProjectileCollision = AmmusTuhoutuu;484 pelaajan2Ase.AmmoIgnoresExplosions = true;485 pelaajan2Ase.Image = null;486 pelaajan2Ase.Color = new Color(0, 0, 0, 0);487 pelaaja2.Add(pelaajan2Ase);488 468 } 489 469 void LisaaAse(Vector paikka, double leveys, double korkeus) … … 514 494 515 495 pelaaja2pisteet.Value += 1; 496 pelaaja1.IsVisible = false; 497 //ClearControls(); 498 Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 516 499 Timer.SingleShot(3.0, delegate 517 500 { 518 501 Kontrollit(); 519 502 pelaaja1.AbsolutePosition = spawn1; 520 503 pelaaja1.IsVisible = true; 521 504 }); 522 505 } … … 525 508 526 509 pelaaja1pisteet.Value += 1; 510 pelaaja2.IsVisible = false; 511 //ClearControls(); 512 Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 527 513 Timer.SingleShot(3.0, delegate 528 514 { 529 515 Kontrollit(); 530 516 pelaaja2.AbsolutePosition = spawn2; 531 517 pelaaja2.IsVisible = true; 532 518 }); 533 519 } -
2017/27/EinoS/FireFight_Demo/FireFight_Demo/FireFight_Demo/FireFight_Demo.csproj.Debug.cachefile
r8980 r8988 8 8 Content\Luoti1.xnb 9 9 Content\Hylsy2.xnb 10 Content\HIT.xnb 11 Content\KenttÀ1BG.xnb 10 12 Content\suuliekkix.xnb 11 13 Content\suuliekkix\Suuliekki1_0.xnb -
2017/27/EinoS/FireFight_Demo/FireFight_Demo/FireFight_Demo/obj/x86/Debug/ContentPipeline-{3BA35D07-BDD1-435A-9851-B5DBFA346F1D}.xml
r8980 r8988 9 9 <Options>None</Options> 10 10 <Output>C:\MyTemp\EinoS\FireFight_Demo\FireFight_Demo\FireFight_Demo\bin\x86\Debug\Content\1.xnb</Output> 11 <Time>2017-07-0 6T09:24:26.3132704+03:00</Time>11 <Time>2017-07-07T10:26:29.8326639+03:00</Time> 12 12 </Item> 13 13 <Item> … … 18 18 <Options>None</Options> 19 19 <Output>C:\MyTemp\EinoS\FireFight_Demo\FireFight_Demo\FireFight_Demo\bin\x86\Debug\Content\PlayerPrototype.xnb</Output> 20 <Time>2017-07-0 4T13:17:30.4694577+03:00</Time>20 <Time>2017-07-05T09:31:15.4993094+03:00</Time> 21 21 </Item> 22 22 <Item> … … 27 27 <Options>None</Options> 28 28 <Output>C:\MyTemp\EinoS\FireFight_Demo\FireFight_Demo\FireFight_Demo\bin\x86\Debug\Content\IdleBO1.xnb</Output> 29 <Time>2017-07-05T 14:11:07.4020029+03:00</Time>29 <Time>2017-07-05T09:31:15.1514834+03:00</Time> 30 30 </Item> 31 31 <Item> … … 36 36 <Options>None</Options> 37 37 <Output>C:\MyTemp\EinoS\FireFight_Demo\FireFight_Demo\FireFight_Demo\bin\x86\Debug\Content\IdleRO1.xnb</Output> 38 <Time>2017-07-05T 14:11:07.4020029+03:00</Time>38 <Time>2017-07-05T09:31:16.6987094+03:00</Time> 39 39 </Item> 40 40 <Item> … … 45 45 <Options>None</Options> 46 46 <Output>C:\MyTemp\EinoS\FireFight_Demo\FireFight_Demo\FireFight_Demo\bin\x86\Debug\Content\FireFightLogo.xnb</Output> 47 <Time>2017-07-0 6T09:24:26.29767+03:00</Time>47 <Time>2017-07-05T14:22:38.1391582+03:00</Time> 48 48 </Item> 49 49 <Item> … … 54 54 <Options>None</Options> 55 55 <Output>C:\MyTemp\EinoS\FireFight_Demo\FireFight_Demo\FireFight_Demo\bin\x86\Debug\Content\Hylsy.xnb</Output> 56 <Time>2017-07-0 6T12:37:14.4813769+03:00</Time>56 <Time>2017-07-07T09:13:51.6626184+03:00</Time> 57 57 </Item> 58 58 <Item> … … 63 63 <Options>None</Options> 64 64 <Output>C:\MyTemp\EinoS\FireFight_Demo\FireFight_Demo\FireFight_Demo\bin\x86\Debug\Content\Luoti2.xnb</Output> 65 <Time>2017-07-0 6T13:01:46.0546901+03:00</Time>65 <Time>2017-07-07T09:13:51.6002172+03:00</Time> 66 66 </Item> 67 67 <Item> … … 72 72 <Options>None</Options> 73 73 <Output>C:\MyTemp\EinoS\FireFight_Demo\FireFight_Demo\FireFight_Demo\bin\x86\Debug\Content\Luoti1.xnb</Output> 74 <Time>2017-07-0 6T13:02:28.3174655+03:00</Time>74 <Time>2017-07-07T09:13:51.6002172+03:00</Time> 75 75 </Item> 76 76 <Item> … … 81 81 <Options>None</Options> 82 82 <Output>C:\MyTemp\EinoS\FireFight_Demo\FireFight_Demo\FireFight_Demo\bin\x86\Debug\Content\Hylsy2.xnb</Output> 83 <Time>2017-07-06T13:00:41.3689854+03:00</Time> 83 <Time>2017-07-07T09:13:51.6626184+03:00</Time> 84 </Item> 85 <Item> 86 <Source>HIT.png</Source> 87 <Name>HIT</Name> 88 <Importer>TextureImporter</Importer> 89 <Processor>TextureProcessor</Processor> 90 <Options>None</Options> 91 <Output>C:\MyTemp\EinoS\FireFight_Demo\FireFight_Demo\FireFight_Demo\bin\x86\Debug\Content\HIT.xnb</Output> 92 <Time>2017-07-07T09:58:56.010389+03:00</Time> 93 </Item> 94 <Item> 95 <Source>Kenttä1BG.png</Source> 96 <Name>Kenttä1BG</Name> 97 <Importer>TextureImporter</Importer> 98 <Processor>TextureProcessor</Processor> 99 <Options>None</Options> 100 <Output>C:\MyTemp\EinoS\FireFight_Demo\FireFight_Demo\FireFight_Demo\bin\x86\Debug\Content\Kenttä1BG.xnb</Output> 101 <Time>2017-07-07T10:19:48.5559808+03:00</Time> 84 102 </Item> 85 103 <Item> … … 90 108 <Options>None</Options> 91 109 <Output>C:\MyTemp\EinoS\FireFight_Demo\FireFight_Demo\FireFight_Demo\bin\x86\Debug\Content\suuliekkix.xnb</Output> 92 <Time>2017-07-0 6T13:34:59.9866248+03:00</Time>110 <Time>2017-07-07T09:13:51.6002172+03:00</Time> 93 111 <Request>C:\MyTemp\EinoS\FireFight_Demo\FireFight_Demo\FireFight_Demo\bin\x86\Debug\Content\suuliekkix\Suuliekki1_0.xnb</Request> 94 112 <Request>C:\MyTemp\EinoS\FireFight_Demo\FireFight_Demo\FireFight_Demo\bin\x86\Debug\Content\suuliekkix\Suuliekki2_0.xnb</Request> … … 101 119 <Options>None</Options> 102 120 <Output>C:\MyTemp\EinoS\FireFight_Demo\FireFight_Demo\FireFight_Demo\bin\x86\Debug\Content\suuliekkix\Suuliekki1_0.xnb</Output> 103 <Time>2017-07-0 5T10:02:59.9463283+03:00</Time>121 <Time>2017-07-07T09:13:51.693819+03:00</Time> 104 122 </Item> 105 123 <Item> … … 109 127 <Options>None</Options> 110 128 <Output>C:\MyTemp\EinoS\FireFight_Demo\FireFight_Demo\FireFight_Demo\bin\x86\Debug\Content\suuliekkix\Suuliekki2_0.xnb</Output> 111 <Time>2017-07-0 5T10:16:10.4730246+03:00</Time>129 <Time>2017-07-07T09:13:51.693819+03:00</Time> 112 130 </Item> 113 131 <Item> … … 117 135 <Options>None</Options> 118 136 <Output>C:\MyTemp\EinoS\FireFight_Demo\FireFight_Demo\FireFight_Demo\bin\x86\Debug\Content\suuliekkix\Suuliekki3_0.xnb</Output> 119 <Time>2017-07-0 5T11:55:21.5052406+03:00</Time>137 <Time>2017-07-07T09:13:51.7094193+03:00</Time> 120 138 </Item> 121 139 <BuildSuccessful>true</BuildSuccessful> … … 166 184 <Assembly> 167 185 <Key>C:\Windows\Microsoft.Net\assembly\GAC_32\Microsoft.Xna.Framework.Content.Pipeline\v4.0_4.0.0.0__842cf8be1de50553\Microsoft.Xna.Framework.Content.Pipeline.dll</Key> 168 <Value>2017-06-0 8T04:39:22.7305161+03:00</Value>186 <Value>2017-06-07T16:10:32.9188971+03:00</Value> 169 187 </Assembly> 170 188 </Assemblies> -
2017/27/EinoS/FireFight_Demo/FireFight_Demo/FireFight_Demo/obj/x86/Debug/FireFight_Demo.csproj.FileListAbsolute.txt
r8980 r8988 1 C:\MyTemp\EinoS\FireFight_Demo\FireFight_Demo\FireFight_Demo\obj\x86\Debug\FireFight_Demo.csprojResolveAssemblyReference.cache2 1 C:\MyTemp\EinoS\FireFight_Demo\FireFight_Demo\FireFight_Demo\obj\x86\Debug\Microsoft.Xna.Framework.RuntimeProfile.txt 3 2 C:\MyTemp\EinoS\FireFight_Demo\FireFight_Demo\FireFight_Demo\bin\x86\Debug\FireFight_Demo.exe … … 20 19 C:\MyTemp\EinoS\FireFight_Demo\FireFight_Demo\FireFight_Demo\bin\x86\Debug\Content\suuliekkix\Suuliekki2_0.xnb 21 20 C:\MyTemp\EinoS\FireFight_Demo\FireFight_Demo\FireFight_Demo\bin\x86\Debug\Content\suuliekkix\Suuliekki3_0.xnb 21 C:\MyTemp\EinoS\FireFight_Demo\FireFight_Demo\FireFight_Demo\bin\x86\Debug\Content\HIT.xnb 22 C:\MyTemp\EinoS\FireFight_Demo\FireFight_Demo\FireFight_Demo\bin\x86\Debug\Content\KenttÀ1BG.xnb 23 C:\MyTemp\EinoS\FireFight_Demo\FireFight_Demo\FireFight_Demo\bin\x86\Debug\FireFight_Demo.exe.CodeAnalysisLog.xml 24 C:\MyTemp\EinoS\FireFight_Demo\FireFight_Demo\FireFight_Demo\bin\x86\Debug\FireFight_Demo.exe.lastcodeanalysissucceeded -
2017/27/EinoS/FireFight_Demo/FireFight_Demo/FireFight_Demo/obj/x86/Debug/cachefile-{3BA35D07-BDD1-435A-9851-B5DBFA346F1D}-targetpath.txt
r8980 r8988 8 8 Content\Luoti1.xnb 9 9 Content\Hylsy2.xnb 10 Content\HIT.xnb 11 Content\KenttÀ1BG.xnb 10 12 Content\suuliekkix.xnb 11 13 Content\suuliekkix\Suuliekki1_0.xnb -
2017/27/EinoS/FireFight_Demo/FireFight_Demo/FireFight_DemoContent/1.txt
r8939 r8988 1 ........................................ 2 ........................................ 3 ........................................ 4 ........................................ 5 ........................................ 6 ........................................ 7 ..........M................N............ 8 ................PPPPPP.................. 9 ........................................ 10 .........PPPPP..........PPPPP........... 11 ........................................ 12 ........................................ 13 ........................................ 14 ............PPPPP..PPPP................. 15 ........................................ 16 ........................PPP............. 1 17 ........................................ 2 18 ........................................ … … 8 24 ........................................ 9 25 ........................................ 10 ........................................11 ................PP......................12 ........................................13 ........................................14 ...............PPP......................15 ........................................16 .......P................................17 ..............PPPP......................18 ...........M..............N.............19 ........................................20 .......PPPPPPPPPPPPPPPPPPPPPPPPPPP......21 ........................................22 ........................................23 ........................................24 ........................................25 ........................................ -
2017/27/EinoS/FireFight_Demo/FireFight_Demo/FireFight_DemoContent/FireFight_DemoContent.contentproj
r8980 r8988 113 113 </Compile> 114 114 </ItemGroup> 115 <ItemGroup> 116 <Compile Include="HIT.png"> 117 <Name>HIT</Name> 118 <Importer>TextureImporter</Importer> 119 <Processor>TextureProcessor</Processor> 120 </Compile> 121 </ItemGroup> 122 <ItemGroup> 123 <Compile Include="Kenttä1BG.png"> 124 <Name>Kenttä1BG</Name> 125 <Importer>TextureImporter</Importer> 126 <Processor>TextureProcessor</Processor> 127 </Compile> 128 </ItemGroup> 115 129 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 116 130 <!-- 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.