- Timestamp:
- 2012-06-07 16:13:56 (11 years ago)
- Location:
- 2012/23/RamiP/YAG2DSSBase/YAG2DSS
- Files:
-
- 4 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
2012/23/RamiP/YAG2DSSBase/YAG2DSS/YAG2DSS/ALTKEngine/ALTKConstants.cs
r2811 r2841 17 17 public static int WindowHeight; 18 18 19 public static double JypeliToXNARatioX = 1.12; 20 public static double JypeliToXNARatioY = 1.12; 21 19 22 public static bool bMusicEnabled = true; 20 23 public static bool bSoundEnabled = true; -
2012/23/RamiP/YAG2DSSBase/YAG2DSS/YAG2DSS/ALTKEngine/StaticAnimHandler.cs
r2830 r2841 195 195 minion_explosion_smokering.TimeEntirelyVisible = 1; 196 196 minion_explosion_smokering.Texture = ALTKHandler.Loader.loadTexture("minion_explosion_smokering"); 197 198 StaticAnimationType asteroid_hit_dust = new StaticAnimationType("ASTEROID_EXPLOSION_DUST"); 199 asteroid_hit_dust.DisappearingRate = 12.0; 200 asteroid_hit_dust.InitialVisibilityRate = 19.0; 201 asteroid_hit_dust.TimeEntirelyVisible = 1; 202 asteroid_hit_dust.Texture = ALTKHandler.Loader.loadTexture("asteroid_explosion_staticanim"); 203 204 StaticAnimationType asteroid_explosion_dust = new StaticAnimationType("ASTEROID_EXPLOSION_DUST"); 205 asteroid_explosion_dust.DisappearingRate = 8.0; 206 asteroid_explosion_dust.InitialVisibilityRate = 19.0; 207 asteroid_explosion_dust.TimeEntirelyVisible = 1; 208 asteroid_explosion_dust.Texture = ALTKHandler.Loader.loadTexture("asteroid_explosion_staticanim"); 209 210 StaticAnimationType player_explosion = new StaticAnimationType("PLAYER_DEATH_EXPLOSION"); 211 player_explosion.DisappearingRate = 2.0; 212 player_explosion.InitialVisibilityRate = 12.0; 213 player_explosion.TimeEntirelyVisible = 250; 214 player_explosion.Texture = ALTKHandler.Loader.loadTexture("player_explosion_staticanim"); 197 215 198 216 StaticAnimTypes.Add(genExplosion); … … 215 233 StaticAnimTypes.Add(minion_explosion_staticanim); 216 234 StaticAnimTypes.Add(minion_explosion_smokering); 235 StaticAnimTypes.Add(asteroid_hit_dust); // 19 236 StaticAnimTypes.Add(asteroid_explosion_dust); 237 StaticAnimTypes.Add(player_explosion); 217 238 } 218 239 -
2012/23/RamiP/YAG2DSSBase/YAG2DSS/YAG2DSS/ALTKHandler.cs
r2822 r2841 52 52 Cursor = new Cursor(Game); 53 53 Cursor.Initialize(); 54 Cursor.Visible = false; 54 55 Game.Components.Add(Cursor); 55 56 … … 94 95 } 95 96 97 public static Vector2 AdjustJypeliVectorToXna(double x, double y) 98 { 99 return CreateXNAVectorFromDoubles(x * ALTKConstants.JypeliToXNARatioX, y * ALTKConstants.JypeliToXNARatioY); 100 } 101 96 102 public static Vector2 CreateXNAVectorFromDoubles(double x, double y) 97 103 { -
2012/23/RamiP/YAG2DSSBase/YAG2DSS/YAG2DSS/YAG2DSS.cs
r2830 r2841 29 29 Timer EnergianLataaja; 30 30 Timer Vaikeuttaja; 31 Timer Konekivaari1; 32 Timer Konekivaari2; 33 Timer Triplefire1; 34 Timer Triplefire2; 35 36 ExplosionSystem PlayerHitES; 37 ExplosionSystem PlayerDeathES; 38 ExplosionSystem PlayerDeathESL; 39 ExplosionSystem PlayerDeathES2; 31 40 32 41 ExplosionSystem WormholeExplosionES; … … 35 44 ExplosionSystem MinionExplosionES; 36 45 ExplosionSystem MinionExplosionES2; 46 47 ExplosionSystem AsteroidExplosionES; 48 ExplosionSystem AsteroidExplosionES2; 37 49 38 50 double MadonreikaPosX = 0.0; … … 61 73 //PhoneBackButton.Listen(ConfirmExit, "Lopeta peli"); 62 74 Keyboard.Listen(Key.Escape, ButtonState.Pressed, ShowExit, "Lopeta peli"); 63 WormholeExplosion(); 75 Explotions(); 76 } 77 78 void Explotions() 79 { 80 PlayerHitES = new ExplosionSystem(Image.FromStream(File.OpenRead(ALTKConstants.TexturePath + "player_explosion.png")), 800); 81 PlayerHitES.ScaleAmount = 0.0002; 82 PlayerHitES.MaxRotationSpeed = 1000.0; 83 PlayerHitES.BlendMode = BlendMode.Alpha; 84 PlayerHitES.MinScale = 2.5; 85 PlayerHitES.MaxScale = 5.0; 86 PlayerHitES.Shape = Shape.Circle; 87 PlayerHitES.MinRotationSpeed = 500.0; 88 PlayerHitES.AlphaAmount = 1.0; 89 PlayerHitES.MinAcceleration = 3.0; 90 PlayerHitES.MaxAcceleration = 6.0; 91 PlayerHitES.MinVelocity = 10.0; 92 PlayerHitES.MaxVelocity = 20.0; 93 PlayerHitES.MinLifetime = PlayerHitES.MinLifetime * 0.8; 94 PlayerHitES.MaxLifetime = PlayerHitES.MaxLifetime * 0.8; 95 Add(PlayerHitES); 96 97 PlayerDeathES = new ExplosionSystem(Image.FromStream(File.OpenRead(ALTKConstants.TexturePath + "player_explosion.png")), 8000); 98 PlayerDeathES.ScaleAmount = 0.0002; 99 PlayerDeathES.MaxRotationSpeed = 1000.0; 100 PlayerDeathES.BlendMode = BlendMode.Alpha; 101 PlayerDeathES.MinScale = 2.0; 102 PlayerDeathES.MaxScale = 4.0; 103 PlayerDeathES.Shape = Shape.Circle; 104 PlayerDeathES.MinRotationSpeed = 500.0; 105 PlayerDeathES.AlphaAmount = 1.0; 106 PlayerDeathES.MinAcceleration = 3.0; 107 PlayerDeathES.MaxAcceleration = 6.0; 108 PlayerDeathES.MaxVelocity = 100.0; 109 PlayerDeathES.MinLifetime = 5.9; 110 PlayerDeathES.MaxLifetime = 6.0; 111 Add(PlayerDeathES); 112 113 PlayerDeathESL = new ExplosionSystem(Image.FromStream(File.OpenRead(ALTKConstants.TexturePath + "player_explosion.png")), 16000); 114 PlayerDeathESL.ScaleAmount = 0.0002; 115 PlayerDeathESL.MaxRotationSpeed = 1000.0; 116 PlayerDeathESL.BlendMode = BlendMode.Alpha; 117 PlayerDeathESL.MinScale = 1.5; 118 PlayerDeathESL.MaxScale = 3.0; 119 PlayerDeathESL.Shape = Shape.Circle; 120 PlayerDeathESL.MinRotationSpeed = 500.0; 121 PlayerDeathESL.AlphaAmount = 1.0; 122 PlayerDeathESL.MinAcceleration = 1.5; 123 PlayerDeathESL.MaxAcceleration = 3.0; 124 PlayerDeathESL.MaxVelocity = 50.0; 125 PlayerDeathESL.MinLifetime = 5.9; 126 PlayerDeathESL.MaxLifetime = 6.0; 127 Add(PlayerDeathESL); 128 129 PlayerDeathES2 = new ExplosionSystem(Image.FromStream(File.OpenRead(ALTKConstants.TexturePath + "player_explosion.png")), 2800); 130 PlayerDeathES2.ScaleAmount = 0.0002; 131 PlayerDeathES2.MaxRotationSpeed = 1000.0; 132 PlayerDeathES2.BlendMode = BlendMode.Alpha; 133 PlayerDeathES2.MinScale = 64.0; 134 PlayerDeathES2.MaxScale = 128.0; 135 PlayerDeathES2.Shape = Shape.Circle; 136 PlayerDeathES2.MinRotationSpeed = 500.0; 137 PlayerDeathES2.AlphaAmount = 0.8; 138 PlayerDeathES2.MinAcceleration = 0.75; 139 PlayerDeathES2.MaxAcceleration = 0.75; 140 PlayerDeathES2.MaxVelocity = 12.5; 141 PlayerDeathES2.MinLifetime = 5.9; 142 PlayerDeathES2.MaxLifetime = 6.0; 143 Add(PlayerDeathES2); 64 144 65 145 MinionExplosionES = new ExplosionSystem(Image.FromStream(File.OpenRead(ALTKConstants.TexturePath + "minion_explosion.png")), 5000); … … 72 152 MinionExplosionES.Shape = Shape.Circle; 73 153 MinionExplosionES.MinRotationSpeed = 500.0; 74 //MinionExplosionES.AlphaAmount = 0.75;75 154 MinionExplosionES.MinAcceleration = 12.0; 76 155 MinionExplosionES.MaxAcceleration = 24.0; … … 97 176 MinionExplosionES2.MinLifetime = MinionExplosionES2.MinLifetime * 0.65; 98 177 Add(MinionExplosionES2); 99 } 100 101 void WormholeExplosion() 102 { 178 179 AsteroidExplosionES = new ExplosionSystem(Image.FromStream(File.OpenRead(ALTKConstants.TexturePath + "asteroid_explosion.png")), 2000); 180 AsteroidExplosionES.ScaleAmount = 0.0002; 181 AsteroidExplosionES.MaxRotationSpeed = 800.0; 182 AsteroidExplosionES.BlendMode = BlendMode.Alpha; 183 AsteroidExplosionES.MinScale = 4.0; 184 AsteroidExplosionES.MaxScale = 8.0; 185 AsteroidExplosionES.Shape = Shape.Circle; 186 AsteroidExplosionES.MinRotationSpeed = 350.0; 187 AsteroidExplosionES.AlphaAmount = 0.8; 188 AsteroidExplosionES.MinAcceleration = 6.0; 189 AsteroidExplosionES.MaxAcceleration = 12.0; 190 AsteroidExplosionES.MinVelocity = 36.75; 191 AsteroidExplosionES.MaxVelocity = 55.25; 192 AsteroidExplosionES.MaxLifetime = AsteroidExplosionES.MaxLifetime * 0.425; 193 AsteroidExplosionES.MinLifetime = AsteroidExplosionES.MinLifetime * 0.425; 194 Add(AsteroidExplosionES); 195 196 AsteroidExplosionES2 = new ExplosionSystem(Image.FromStream(File.OpenRead(ALTKConstants.TexturePath + "asteroid_explosion.png")), 800); 197 AsteroidExplosionES2.ScaleAmount = 0.0002; 198 AsteroidExplosionES2.MaxRotationSpeed = 800.0; 199 AsteroidExplosionES2.BlendMode = BlendMode.Alpha; 200 AsteroidExplosionES2.MinScale = 10.0; 201 AsteroidExplosionES2.MaxScale = 18.0; 202 AsteroidExplosionES2.Shape = Shape.Circle; 203 AsteroidExplosionES2.MinRotationSpeed = 350.0; 204 AsteroidExplosionES2.AlphaAmount = 0.8; 205 AsteroidExplosionES2.MinAcceleration = 1.5; 206 AsteroidExplosionES2.MaxAcceleration = 3.0; 207 AsteroidExplosionES2.MinVelocity = 8.75; 208 AsteroidExplosionES2.MaxVelocity = 20.25; 209 AsteroidExplosionES2.MaxLifetime = AsteroidExplosionES2.MaxLifetime * 1.8; 210 AsteroidExplosionES2.MinLifetime = AsteroidExplosionES2.MinLifetime * 1.8; 211 Add(AsteroidExplosionES2); 103 212 104 213 WormholeExplosionES = new ExplosionSystem(Image.FromStream(File.OpenRead(ALTKConstants.TexturePath + "wormhole_explosion.png")), 5000); … … 214 323 Vaikeuttaja.Interval = 5.0; 215 324 Vaikeuttaja.Timeout += new Action(Vaikeuttaja_Timeout); 216 217 //EnergianLataaja = new Timer(); 218 //EnergianLataaja.Interval = 5.0; 219 //EnergianLataaja.Timeout += new Action(EnergianLataaja_Timeout); 220 //EnergianLataaja.Start(); 325 Vaikeuttaja.Start(); 326 327 EnergianLataaja = new Timer(); 328 EnergianLataaja.Interval = 5.0; 329 EnergianLataaja.Timeout += new Action(EnergianLataaja_Timeout); 330 EnergianLataaja.Start(); 331 332 Konekivaari1 = new Timer(); 333 Konekivaari1.Interval = 0.05; 334 Konekivaari1.Timeout += new Action(Konekivaari1_Timeout); 335 336 Konekivaari2 = new Timer(); 337 Konekivaari2.Interval = 0.05; 338 Konekivaari2.Timeout += new Action(Konekivaari2_Timeout); 339 340 Triplefire1 = new Timer(); 341 Triplefire1.Interval = 0.2; 342 } 343 344 void Konekivaari1_Timeout() 345 { 346 if (Keyboard.GetKeyState(Key.RightShift) == ButtonState.Down) 347 LuoPelaajanAmmus(0); 348 } 349 350 351 void Konekivaari2_Timeout() 352 { 353 if (Keyboard.GetKeyState(Key.LeftShift) == ButtonState.Down) 354 LuoPelaajanAmmus(1); 221 355 } 222 356 … … 230 364 } 231 365 232 //void EnergianLataaja_Timeout() 233 //{ 234 // if (; 235 //} 366 void EnergianLataaja_Timeout() 367 { 368 if (ALTKHandler.HealthBars[0].Value < 100 && 369 !Pelaaja[0].IsDestroyed) 370 ALTKHandler.HealthBars[0].Value = ALTKHandler.HealthBars[0].Value + 1; 371 372 if (ALTKHandler.HealthBars[1].Value < 100 && 373 !Pelaaja[1].IsDestroyed) 374 ALTKHandler.HealthBars[1].Value = ALTKHandler.HealthBars[1].Value + 1; 375 } 236 376 237 377 void TuhoaAsteroidi_Timeout() … … 292 432 { 293 433 int tagi = (int)kohde.Tag; 294 int ammuksenTagi = (int)PelaajanAmmus.Tag; 295 434 int ammuksenTagi = (int)PelaajanAmmus.Tag; 435 296 436 if (tagi == 5) 297 437 { … … 303 443 if (ammuksenTagi == 1) 304 444 { 305 LisaaPisteita(0, Convert.ToInt32 445 LisaaPisteita(0, Convert.ToInt32(10 * Pelaajan1Kerroin)); 306 446 } 307 447 else 308 448 { 309 LisaaPisteita(1, Convert.ToInt32 449 LisaaPisteita(1, Convert.ToInt32(10 * Pelaajan1Pisteet)); 310 450 } 311 451 } … … 313 453 { 314 454 kohde.MaxVelocity = kohde.MaxVelocity - 1.0; 455 456 WormholeExplosionES.AddEffect(PelaajanAmmus.Position, 150); 457 WormholeExplosionES2.AddEffect(PelaajanAmmus.Position, 5); 458 459 if (ammuksenTagi == 1) 460 { 461 LisaaPisteita(0, Convert.ToInt32 (2 * Pelaajan1Kerroin)); 462 } 463 else 464 { 465 LisaaPisteita(1, Convert.ToInt32(2 * Pelaajan2Kerroin)); 466 } 467 315 468 if (kohde.MaxVelocity < 1) 316 469 { … … 319 472 ALTKHandler.StaticAnimHandler.AddStaticAnim(15, ALTKHandler.CreateXNAVectorFromDoubles(kohde.X * 1.12, kohde.Y * 1.12)); 320 473 kohde.Destroy(); 321 }322 }323 else if (tagi == 123)324 {325 kohde.Mass = (Math.Abs((kohde.Left - kohde.Right) * (kohde.Top - kohde.Bottom))) / 20;326 kohde.Size = kohde.Size * 0.84;327 328 if (kohde.Mass < 20)329 {330 474 if (ammuksenTagi == 1) 331 475 { 332 LisaaPisteita(0, Convert.ToInt32((1 / kohde.Mass) * 500 * Pelaajan1Kerroin)); 333 if (kohde.Mass < 20) 334 { 335 kohde.Destroy(); 336 LisaaKerrointa(0, 0.5); 337 } 476 LisaaPisteita(0, Convert.ToInt32(13 * Pelaajan1Kerroin)); 338 477 } 339 478 else 340 479 { 341 LisaaPisteita(1, Convert.ToInt32((1 / kohde.Mass) * 500 * Pelaajan2Kerroin)); 342 if (kohde.Mass < 20) 343 { 344 kohde.Destroy(); 345 LisaaKerrointa(1, 0.5); 346 } 480 LisaaPisteita(1, Convert.ToInt32(13 * Pelaajan2Kerroin)); 347 481 } 348 482 } 349 else if (tagi == 11) 350 { 351 ALTKHandler.HealthBars[0].Value = ALTKHandler.HealthBars[0].Value - 5; 352 if (ALTKHandler.HealthBars[0].Value < 1) 483 } 484 else if (tagi == 123) 485 { 486 kohde.Mass = (Math.Abs((kohde.Left - kohde.Right) * (kohde.Top - kohde.Bottom))) / 20; 487 kohde.Size = kohde.Size * 0.84; 488 489 AsteroidHitEffect(PelaajanAmmus.Position); 490 491 if (ammuksenTagi == 1) 492 { 493 LisaaPisteita(0, Convert.ToInt32((1 / kohde.Mass) * 500 * Pelaajan1Kerroin)); 494 495 if (kohde.Mass < 20) 353 496 { 354 PelaajanTuhoaja(); 497 TuhoaAsteroidiEfekti(kohde.Position); 498 LisaaKerrointa(0, 0.5); 355 499 } 356 500 } 357 else if (tagi == 12) 358 { 359 ALTKHandler.HealthBars[1].Value = ALTKHandler.HealthBars[1].Value - 5; 501 else 502 { 503 LisaaPisteita(1, Convert.ToInt32((1 / kohde.Mass) * 500 * Pelaajan2Kerroin)); 504 505 if (kohde.Mass < 20) 506 { 507 TuhoaAsteroidiEfekti(kohde.Position); 508 LisaaKerrointa(1, 0.5); 509 } 510 } 511 } 512 else if (tagi == 11) 513 { 514 ALTKHandler.HealthBars[0].Value = ALTKHandler.HealthBars[0].Value - 5; 515 if (ALTKHandler.HealthBars[0].Value < 1) 516 { 360 517 PelaajanTuhoaja(); 361 362 } 363 else if (tagi == 8) 364 { 365 MinionExplosionES.AddEffect(kohde.Position, 200); 366 kohde.Destroy(); 367 } 518 } 519 } 520 else if (tagi == 12) 521 { 522 ALTKHandler.HealthBars[1].Value = ALTKHandler.HealthBars[1].Value - 5; 523 PelaajanTuhoaja(); 524 525 } 526 else if (tagi == 8) 527 { 528 MinionExplosionES.AddEffect(kohde.Position, 200); 529 kohde.Destroy(); 368 530 } 369 531 … … 385 547 ALTKHandler.StaticAnimHandler.AddStaticAnim(17, ALTKHandler.CreateXNAVectorFromDoubles(kohde.X * 1.12, kohde.Y * 1.12)); 386 548 ALTKHandler.StaticAnimHandler.AddStaticAnim(18, ALTKHandler.CreateXNAVectorFromDoubles(kohde.X * 1.12, kohde.Y * 1.12)); 549 550 PlayerHitES.AddEffect(kohde.Position, 150); 387 551 ALTKHandler.HealthBars[0].Value = ALTKHandler.HealthBars[0].Value - 20; 388 552 minioni.Destroy(); … … 397 561 ALTKHandler.StaticAnimHandler.AddStaticAnim(17, ALTKHandler.CreateXNAVectorFromDoubles(kohde.X * 1.12, kohde.Y * 1.12)); 398 562 ALTKHandler.StaticAnimHandler.AddStaticAnim(18, ALTKHandler.CreateXNAVectorFromDoubles(kohde.X * 1.12, kohde.Y * 1.12)); 563 564 PlayerHitES.AddEffect(kohde.Position, 150); 399 565 ALTKHandler.HealthBars[1].Value = ALTKHandler.HealthBars[1].Value - 20; 400 566 minioni.Destroy(); … … 417 583 { 418 584 kohde.Destroy(); 585 AsteroidHitEffect(asteroidi.Position); 419 586 asteroidi.Mass = (Math.Abs((asteroidi.Left - asteroidi.Right) * (asteroidi.Top - asteroidi.Bottom))) / 20; 420 587 asteroidi.Size = asteroidi.Size * 0.86; … … 422 589 if (asteroidi.Mass < 20) 423 590 { 591 TuhoaAsteroidiEfekti(asteroidi.Position); 424 592 asteroidi.Destroy(); 425 593 LisaaKerrointa(0, 0.5); … … 429 597 { 430 598 kohde.Destroy(); 599 AsteroidHitEffect(asteroidi.Position); 431 600 asteroidi.Mass = (Math.Abs((asteroidi.Left - asteroidi.Right) * (asteroidi.Top - asteroidi.Bottom))) / 20; 432 601 asteroidi.Size = asteroidi.Size * 0.86; … … 434 603 if (asteroidi.Mass < 20) 435 604 { 605 TuhoaAsteroidiEfekti(asteroidi.Position); 436 606 asteroidi.Destroy(); 437 607 LisaaKerrointa(1, 0.5); … … 454 624 { 455 625 } 626 } 627 628 private void AsteroidHitEffect(Vector position) 629 { 630 AsteroidExplosionES.AddEffect(position, 200); 631 ALTKHandler.StaticAnimHandler.AddStaticAnim(19, 632 ALTKHandler.CreateXNAVectorFromDoubles(position.X * ALTKConstants.JypeliToXNARatioX, position.Y * ALTKConstants.JypeliToXNARatioY)); 633 } 634 635 private void TuhoaAsteroidiEfekti(Vector paikka) 636 { 637 AsteroidExplosionES.AddEffect(paikka, 400); 638 AsteroidExplosionES2.AddEffect(paikka, 200); 639 ALTKHandler.StaticAnimHandler.AddStaticAnim(20, 640 ALTKHandler.CreateXNAVectorFromDoubles(paikka.X * ALTKConstants.JypeliToXNARatioX, paikka.Y * ALTKConstants.JypeliToXNARatioY)); 456 641 } 457 642 … … 514 699 } 515 700 701 void AjaLuoPelaajan2Ammus() 702 { 703 LuoPelaajanAmmus(1); 704 } 705 516 706 void AjaLuoMinioninAmmus() 517 707 { … … 527 717 } 528 718 } 529 }530 531 void AjaLuoPelaajan2Ammus()532 {533 LuoPelaajanAmmus(1);534 719 } 535 720 … … 611 796 { 612 797 Asteroidi[asteroidiId].Destroy(); 798 613 799 Asteroidi.RemoveAt(asteroidiId); 614 800 asteroidiId--; … … 695 881 { 696 882 int tagi = (int)kohde.Tag; 883 884 if (tagi == 1) 885 { 886 LisaaPisteita(0, Convert.ToInt32 ( 2 * Pelaajan1Kerroin)); 887 } 888 if (tagi == 2) 889 { 890 LisaaPisteita(1, Convert.ToInt32 ( 2 * Pelaajan2Kerroin)); 891 } 697 892 if (tagi == 11) 698 893 { 699 894 ALTKHandler.HealthBars[0].Value = ALTKHandler.HealthBars[0].Value - 17; 895 PlayerHitES.AddEffect(kohde.Position, 150); 700 896 PelaajanTuhoaja(); 701 897 } … … 703 899 { 704 900 ALTKHandler.HealthBars[1].Value = ALTKHandler.HealthBars[1].Value - 17; 901 PlayerHitES.AddEffect(kohde.Position, 150); 705 902 PelaajanTuhoaja(); 706 903 } … … 733 930 void PelaajanTuhoaja() 734 931 { 735 // if (ALTKHandler.HealthBars[0].Value < 1) 736 // { 737 // ALTKHandler.StaticAnimHandler.AddStaticAnim("GEN_EXPLOSION", 738 // new Microsoft.Xna.Framework.Vector2(Convert.ToSingle(Pelaaja[0].X), Convert.ToSingle(Pelaaja[0].Y))); 739 // Pelaaja[0].Destroy(); 740 // } 741 742 // if (ALTKHandler.HealthBars[1].Value < 1) 743 // { 744 // ALTKHandler.StaticAnimHandler.AddStaticAnim("GEN_EXPLOSION", 745 // new Microsoft.Xna.Framework.Vector2(Convert.ToSingle(Pelaaja[1].X), Convert.ToSingle(Pelaaja[1].Y))); 746 // Pelaaja[1].Destroy(); 747 // } 932 if (ALTKHandler.HealthBars[0].Value < 1 && !Pelaaja[0].IsDestroyed) 933 { 934 ALTKHandler.StaticAnimHandler.AddStaticAnim(21, 935 ALTKHandler.AdjustJypeliVectorToXna(Pelaaja[0].X, Pelaaja[0].Y)); 936 937 PlayerDeathES.AddEffect(Pelaaja[0].Position, 2000); 938 PlayerDeathESL.AddEffect(Pelaaja[0].Position, 4000); 939 PlayerDeathES2.AddEffect(Pelaaja[0].Position, 1400); 940 941 Pelaaja[0].Destroy(); 942 } 943 944 if (ALTKHandler.HealthBars[1].Value < 1 && !Pelaaja[1].IsDestroyed) 945 { 946 ALTKHandler.StaticAnimHandler.AddStaticAnim(21, 947 ALTKHandler.AdjustJypeliVectorToXna(Pelaaja[1].X, Pelaaja[1].Y)); 948 949 PlayerDeathES.AddEffect(Pelaaja[1].Position, 2000); 950 PlayerDeathESL.AddEffect(Pelaaja[1].Position, 4000); 951 PlayerDeathES2.AddEffect(Pelaaja[1].Position, 1400); 952 953 Pelaaja[1].Destroy(); 954 } 748 955 749 956 } … … 759 966 { 760 967 ALTKHandler.HealthBars[0].Value = ALTKHandler.HealthBars[0].Value - 10 ; 968 PlayerHitES.AddEffect(kohde.Position, 150); 761 969 PelaajanTuhoaja(); 762 970 } … … 764 972 { 765 973 ALTKHandler.HealthBars[1].Value = ALTKHandler.HealthBars[1].Value - 10; 974 PlayerHitES.AddEffect(kohde.Position, 150); 766 975 PelaajanTuhoaja(); 767 976 } … … 769 978 tagi == 2) 770 979 { 980 MinionExplosionES.AddEffect(kohde.Position, 200); 771 981 kohde.Destroy(); 772 982 } … … 801 1011 Pelaajan2Kerroin = Pelaajan2Kerroin + kerroin; 802 1012 } 1013 803 1014 void AsetaNappaimet() 804 1015 { … … 854 1065 } 855 1066 1067 void PowerUps(PhysicsObject PowerUp, PhysicsObject kohde) 1068 { 1069 int arvo = RandomGen.NextInt(10); 1070 int pelaaja = (int)kohde.Tag; 1071 1072 if (arvo == 1) 1073 { 1074 //Energiaboosti 1075 PhysicsObject Energia10 = PhysicsObject.CreateStaticObject (25, 25, Shape.Hexagon); 1076 Energia10.Color = Color.Green; 1077 Energia10.CollisionIgnoreGroup = 5; 1078 Add(Energia10); 1079 if (pelaaja == 11) 1080 { 1081 if (ALTKHandler.HealthBars[0].Value < 80) 1082 { 1083 ALTKHandler.HealthBars[0].Value = Convert.ToInt32(ALTKHandler.HealthBars[0].Value + 20); 1084 Energia10.Destroy(); 1085 } 1086 else 1087 { 1088 ALTKHandler.HealthBars[0].Value = 100; 1089 } 1090 Energia10.Destroy(); 1091 } 1092 else if (pelaaja == 22) 1093 { 1094 if (ALTKHandler.HealthBars[1].Value < 80) 1095 { 1096 ALTKHandler.HealthBars[1].Value = Convert.ToInt32(ALTKHandler.HealthBars[1].Value + 20); 1097 } 1098 else 1099 { 1100 ALTKHandler.HealthBars[1].Value = 100; 1101 } 1102 Energia10.Destroy(); 1103 } 1104 1105 } 1106 else if (arvo == 3) 1107 { 1108 //Konekivääri 1109 PhysicsObject Konekivaari = PhysicsObject.CreateStaticObject(25, 25); 1110 Konekivaari.Color = Color.Blue; 1111 Add(Konekivaari); 1112 1113 if (pelaaja == 11) 1114 { 1115 Konekivaari1.Start(200); 1116 Konekivaari.Destroy(); 1117 } 1118 else if (pelaaja == 12) 1119 { 1120 Konekivaari1.Start(200); 1121 Konekivaari.Destroy(); 1122 } 1123 1124 } 1125 else if (arvo == 4) 1126 { 1127 //Triplefire 1128 PhysicsObject TripleFire = PhysicsObject.CreateStaticObject(25, 25, Shape.Triangle); 1129 1130 if (pelaaja == 11) 1131 { 1132 Triplefire1.Start(50); 1133 TripleFire.Destroy(); 1134 } 1135 else if (pelaaja == 22) 1136 { 1137 Triplefire2.Start(50); 1138 TripleFire.Destroy(); 1139 } 1140 } 1141 else if (arvo == 5) 1142 { 1143 //Full restore 1144 } 1145 else 1146 { 1147 } 1148 } 1149 856 1150 void Reset() 857 1151 { … … 866 1160 } 867 1161 868 869 870 1162 #region XNA / ALTK-Based Code 871 1163 … … 885 1177 { 886 1178 base.Update(gameTime); 887 888 //for (int minioniId = 0; minioniId < Minioni.Count; minioniId++)889 //{890 // MinioninLiike(Minioni[minioniId]);891 //}892 893 //ALTKHandler.MessageDisplay.AddItem("Trololollolollololoo, lololololooo...");894 1179 895 1180 if (Kursori.Position.X > ALTKConstants.WindowWidth / 2.0) … … 906 1191 ALTK.Cursor.SecPosY = Convert.ToInt32(ALTK.ALTKConstants.WindowHeight - ((ALTKConstants.WindowHeight / 2) + Kursori.Position.Y * 1.12)); 907 1192 908 //ALTK.Cursor.PosX = Convert.ToInt32((ALTKConstants.WindowWidth / 2) + Kursori.Position.X);909 //ALTK.Cursor.PosY = ALTK.Cursor910 911 //MessageDisplay.Clear();912 //MessageDisplay.Add(Convert.ToString(ALTK.Cursor.SecPosX + "; " + ALTK.Cursor.SecPosY));913 914 //if (Keyboard.GetKeyState(Key.Up) == ButtonState.Down)915 //{916 // Vector impulssi = Vector.FromLengthAndAngle(2.0, po.Angle);917 // po.Hit(impulssi);918 //}919 920 //if (Keyboard.GetKeyState(Key.Left) == ButtonState.Down)921 //{922 // po.Angle = Angle.FromDegrees(po.Angle.Degrees - 5.0);923 //}924 925 //if (Keyboard.GetKeyState(Key.Right) == ButtonState.Down)926 //{927 // po.Angle = Angle.FromDegrees(po.Angle.Degrees + 5.0);928 //}929 930 //if (Keyboard.GetKeyState(Key.Down) == ButtonState.Down)931 //{932 // if (po.Velocity.Angle == po.Angle)933 // {934 // Vector impulssi = Vector.FromLengthAndAngle(-2.0, po.Angle);935 // po.Hit(impulssi);936 // }937 //}938 939 1193 if (ALTK.GameHandler.DoUpdate) 940 1194 { … … 963 1217 ALTKHandler.StaticAnimHandler.AddStaticAnim("GALAXY", new Microsoft.Xna.Framework.Vector2(0, 0)); 964 1218 ALTKHandler.StaticAnimHandler.AddStaticAnim("GALAXY_BLUE", new Microsoft.Xna.Framework.Vector2(0, 0)); 965 ALTKHandler.StaticAnimHandler.AddStaticAnim("GALAXY_RED", new Microsoft.Xna.Framework.Vector2( 0,0));1219 ALTKHandler.StaticAnimHandler.AddStaticAnim("GALAXY_RED", new Microsoft.Xna.Framework.Vector2(200, 100)); 966 1220 ALTKHandler.StaticAnimHandler.AddStaticAnim("GALAXY_WHITE", new Microsoft.Xna.Framework.Vector2(0, 0)); 967 1221 968 1222 ALTKHandler.StaticAnimHandler.AddStaticAnim("STARSMOKE", new Microsoft.Xna.Framework.Vector2(200, -250)); 969 1223 ALTKHandler.StaticAnimHandler.AddStaticAnim("STARSMOKE_BLUE", new Microsoft.Xna.Framework.Vector2(400, 250)); 970 ALTKHandler.StaticAnimHandler.AddStaticAnim("STARSMOKE_RED", new Microsoft.Xna.Framework.Vector2(-200, -200)); 971 ALTKHandler.StaticAnimHandler.AddStaticAnim("STARSMOKE_WHITE", new Microsoft.Xna.Framework.Vector2(-250, 300)); 1224 ALTKHandler.StaticAnimHandler.AddStaticAnim("STARSMOKE_RED", new Microsoft.Xna.Framework.Vector2(-350, -200)); 1225 ALTKHandler.StaticAnimHandler.AddStaticAnim("STARSMOKE_WHITE", new Microsoft.Xna.Framework.Vector2(-300, 250)); 1226 972 1227 } 973 1228 -
2012/23/RamiP/YAG2DSSBase/YAG2DSS/YAG2DSSContent/YAG2DSSContent.contentproj
r2830 r2841 257 257 </None> 258 258 </ItemGroup> 259 <ItemGroup> 260 <None Include="Textures\asteroid_explosion.png"> 261 <Name>asteroid_explosion</Name> 262 <Importer>TextureImporter</Importer> 263 <Processor>TextureProcessor</Processor> 264 <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> 265 </None> 266 <None Include="Textures\asteroid_explosion_staticanim.png"> 267 <Name>asteroid_explosion_staticanim</Name> 268 <Importer>TextureImporter</Importer> 269 <Processor>TextureProcessor</Processor> 270 <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> 271 </None> 272 <None Include="Textures\player_explosion.png"> 273 <Name>player_explosion</Name> 274 <Importer>TextureImporter</Importer> 275 <Processor>TextureProcessor</Processor> 276 <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> 277 </None> 278 <None Include="Textures\player_explosion_staticanim.png"> 279 <Name>player_explosion_staticanim</Name> 280 <Importer>TextureImporter</Importer> 281 <Processor>TextureProcessor</Processor> 282 <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> 283 </None> 284 </ItemGroup> 259 285 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 260 286 <!-- 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.