- Timestamp:
- 2014-07-23 15:03:03 (9 years ago)
- Location:
- 2014/30/MikkoL/Gradiant/LM2
- Files:
-
- 6 added
- 1 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
2014/30/MikkoL/Gradiant/LM2/LM2/Gradiant.cs
r5557 r5597 49 49 class boss : PhysicsObject 50 50 { 51 public IntMeter health = new IntMeter( 20000, 0, 20000);51 public IntMeter health = new IntMeter(10, 0, 10); 52 52 public IntMeter ScoreValue = new IntMeter(100, 0, int.MaxValue); 53 53 public bool canShoot = false; … … 64 64 class bullet : PhysicsObject 65 65 { 66 public int damage ;66 public int damage = 5; 67 67 68 68 public bullet(double width, double height) … … 94 94 Vector stagespeed = new Vector(-500,0); 95 95 Vector cntr = new Vector(0, 0); 96 97 string currentlevel = "level_test"; 96 98 97 99 //Player … … 115 117 Image bullet_enemy_05 = LoadImage("bullet_enemy_05"); 116 118 Image bullet_enemy_06 = LoadImage("bullet_enemy_06"); 119 Image bullet_enemy_07 = LoadImage("bullet_enemy_07"); 117 120 //Enemies 118 121 Image enemy_ship_01 = LoadImage("enemy_ship_01"); … … 124 127 Image enemy_ship_04 = LoadImage("enemy_ship_04"); 125 128 Image enemy_ship_05 = LoadImage("enemy_ship_05"); 129 Image enemy_ship_06 = LoadImage("enemy_ship_06"); 126 130 //Bosses 127 131 Image boss_ship_01 = LoadImage("boss_ship_01"); … … 134 138 Image border_bottom = LoadImage("border_top"); 135 139 //Backgrounds 136 Image space_bg = LoadImage("space_bg");137 140 Image earth = LoadImage("earth"); 141 Image stage2_bg = LoadImage("stage2_bg"); 138 142 //Explosion 139 143 private Animation explosion_anim; … … 155 159 Image select_ship_gui = LoadImage("select_ship"); 156 160 161 //Misc 162 Image gradient = LoadImage("gradient"); 157 163 Image aj = LoadImage("aj-weed"); 158 164 … … 175 181 DoubleMeter drd_level = new DoubleMeter(0, 0, 5); 176 182 IntMeter drd_damageRatio = new IntMeter(1, 1, 20); 183 177 184 //drd types 178 185 //1: spreadshot … … 190 197 GameObject cursor; 191 198 GameObject select_ship; 199 200 GameObject black; 201 202 GameObject stage_clear; 203 204 GameObject bg; 205 GameObject bg2; 192 206 Timer cursor_blink; 193 207 double cursorpos = 0; 194 208 195 209 bool s001 = false; 210 bool s002 = false; 196 211 197 212 public override void Begin() … … 302 317 { 303 318 selectsfx.Play(); 304 ClearAll();305 319 MediaPlayer.Stop(); 306 307 CreateLevel("level_01"); 308 309 GameObject stage_01_start = new GameObject(405, 39); 310 stage_01_start.Position = cntr; 311 stage_01_start.Image = stage_1_start; 312 Add(stage_01_start, 3); 313 314 double i = 0; 315 Timer start = new Timer(); 316 start.Interval = 0.1; 317 start.Timeout += delegate 318 { 319 i++; 320 if (i >= 15) stage_01_start.Destroy(); 321 if (stage_01_start.IsVisible) stage_01_start.IsVisible = false; 322 else stage_01_start.IsVisible = true; 323 }; 324 start.Start(15); 325 Pause(); 326 ControllerOne.Listen(Button.Start, ButtonState.Pressed, start_01, null); 327 320 black = new GameObject(Screen.Width, Screen.Height); 321 black.Position = cntr; 322 black.Color = Color.Transparent; 323 black.FadeColorTo(Color.Black, 1); 324 Add(black, 2); 325 326 Timer wait = new Timer(); 327 wait.Interval = 1.5; 328 wait.Timeout += delegate 329 { 330 ClearAll(); 331 black = new GameObject(Screen.Width, Screen.Height); 332 black.Color = Color.Black; 333 Add(black, 2); 334 MediaPlayer.Stop(); 335 336 CreateLevel("level_test"); 337 black.Position = cntr; 338 339 GameObject stage_01_start = new GameObject(405, 39); 340 stage_01_start.Position = cntr; 341 stage_01_start.Image = stage_1_start; 342 Add(stage_01_start, 3); 343 344 double i = 0; 345 Timer start = new Timer(); 346 start.Interval = 0.1; 347 start.Timeout += delegate 348 { 349 i++; 350 if (i >= 15) stage_01_start.Destroy(); 351 if (stage_01_start.IsVisible) stage_01_start.IsVisible = false; 352 else stage_01_start.IsVisible = true; 353 }; 354 start.Start(15); 355 Pause(); 356 ControllerOne.Listen(Button.Start, ButtonState.Pressed, start_01, null); 357 }; 358 wait.Start(1); 328 359 329 360 setwpn_timer(); … … 333 364 if (!s001) 334 365 { 366 black.FadeColorTo(Color.Transparent, 1); 367 368 335 369 s001 = true; 336 370 Pause(); … … 339 373 } 340 374 } 375 void start_02() 376 { 377 if (!s002) 378 { 379 black.FadeColorTo(Color.Transparent, 1); 380 381 s002 = true; 382 Pause(); 383 MediaPlayer.Play("Macbeth"); 384 selectsfx.Play(); 385 } 386 } 341 387 342 388 //Stage creation … … 349 395 lvl.SetTileMethod('y', bordertop); 350 396 lvl.SetTileMethod('z', borderbottom); 397 lvl.SetTileMethod('@', filler); 351 398 lvl.SetTileMethod('%', frontBorder); 352 399 lvl.SetTileMethod('&', backBorder); … … 362 409 lvl.SetTileMethod('$', enemy_ship_4_bottom); 363 410 lvl.SetTileMethod('5', enemy_ship_5); 411 lvl.SetTileMethod('6', enemy_ship_6); 364 412 lvl.SetTileMethod('G', boss_ship_1); 365 413 lvl.Execute(35, 35); 366 414 367 Level.Background.Color = Color.LightGray; 368 GameObject bg = new GameObject(1280, 800); 415 Level.Background.Color = Color.Black; 416 417 bg = new GameObject(1280, 800); 369 418 bg.Position = cntr; 370 419 bg.Image = earth; 371 420 bg.MoveTo(cntr - new Vector(1280, 0), 900); 372 421 373 GameObjectbg2 = new GameObject(1280, 800);422 bg2 = new GameObject(1280, 800); 374 423 bg2.Position = cntr+new Vector(1280,0); 375 424 bg2.Image = earth; … … 400 449 Camera.Position = player.Position; 401 450 //Camera.ZoomFactor = 0.4; 451 } 452 void CreateNextLevel(string level) 453 { 454 //Gravity = new Vector(1000, 0); 455 456 TileMap lvl = TileMap.FromLevelAsset(level); 457 lvl.SetTileMethod('x', border); 458 lvl.SetTileMethod('y', bordertop); 459 lvl.SetTileMethod('z', borderbottom); 460 lvl.SetTileMethod('@', filler); 461 lvl.SetTileMethod('%', frontBorder); 462 lvl.SetTileMethod('&', backBorder); 463 lvl.SetTileMethod('#', bulletdes); 464 lvl.SetTileMethod('P', AddPlayer); 465 lvl.SetTileMethod('1', enemy_ship_1); 466 lvl.SetTileMethod('R', enemy_ship_1_red); 467 lvl.SetTileMethod('B', enemy_ship_1_bottom); 468 lvl.SetTileMethod('T', enemy_ship_1_top); 469 lvl.SetTileMethod('2', enemy_ship_2); 470 lvl.SetTileMethod('3', enemy_ship_3); 471 lvl.SetTileMethod('4', enemy_ship_4_top); 472 lvl.SetTileMethod('$', enemy_ship_4_bottom); 473 lvl.SetTileMethod('5', enemy_ship_5); 474 lvl.SetTileMethod('6', enemy_ship_6); 475 lvl.SetTileMethod('G', boss_ship_1); 476 lvl.Execute(35, 35); 477 478 479 AddControls(); 480 481 //Camera.ZoomFactor = 0.4; 402 482 //edgeBorders(); 403 483 } … … 405 485 void border(Vector position, double width, double height) 406 486 { 407 PhysicsObject border2 = PhysicsObject.CreateStaticObject(width*1.5, height);487 GameObject border2 = new GameObject(width, height); 408 488 border2.Position = position; 409 border2.Restitution = 0;410 border2.KineticFriction = 0;411 border2.StaticFriction = 0;412 border2.Color = Color. Black;489 //border2.Restitution = 0; 490 //border2.KineticFriction = 0; 491 //border2.StaticFriction = 0; 492 border2.Color = Color.White; 413 493 border2.Tag = "border"; 414 494 Add(border2, 1); 415 495 } 496 void filler(Vector position, double width, double height) 497 { 498 GameObject border2 = new GameObject(width, height); 499 border2.Position = position; 500 border2.Color = Color.Transparent; 501 border2.Tag = "filler"; 502 Add(border2, 1); 503 } 416 504 void bordertop(Vector position, double width, double height) 417 505 { 418 PhysicsObject border2 = PhysicsObject.CreateStaticObject(width * 1.5, height);506 PhysicsObject border2 = PhysicsObject.CreateStaticObject(width, height); 419 507 border2.Position = position; 420 border2.Restitution = 0;421 border2.KineticFriction = 0;422 border2.StaticFriction = 0;508 //border2.Restitution = 0; 509 //border2.KineticFriction = 0; 510 //border2.StaticFriction = 0; 423 511 border2.Color = Color.Black; 424 512 border2.Tag = "border"; … … 468 556 bulletdes border = new bulletdes(width, height); 469 557 border.Position = position; 470 border.Color = Color. Red;558 border.Color = Color.Black; 471 559 border.Restitution = 0; 472 560 border.Tag = "border"; 473 561 border.IgnoresCollisionResponse = true; 474 562 border.IgnoresPhysicsLogics = true; 475 Add(border );563 Add(border, 1); 476 564 } 477 565 void frontBorderCollision(PhysicsObject border, PhysicsObject target) … … 502 590 } 503 591 504 //Player related 592 //Player related 505 593 void AddPlayer(Vector pos, double width, double height) 506 594 { … … 573 661 Keyboard.Listen(Key.U, ButtonState.Pressed, cheat_upgrade, null); 574 662 Keyboard.Listen(Key.I, ButtonState.Pressed, cheat_damage, null); 663 Keyboard.Listen(Key.O, ButtonState.Pressed, cheat_spread, null); 575 664 Keyboard.Listen(Key.H, ButtonState.Pressed, cheat_fullhp, null); 576 665 … … 583 672 void cheat_upgrade() 584 673 { 674 drd_level.Value++; 675 676 if (drd_level.Value == 1) 677 { 678 if (drd_type == 0) droid(new Vector(-45, 0)); 679 else if (drd_type == 1) droid(new Vector(40, 0)); 680 } 681 else if (drd_level.Value == 2) 682 { 683 if (drd_type == 0) 684 { 685 droid(new Vector(-45, 30)); 686 droid(new Vector(-45, -30)); 687 } 688 else if (drd_type == 1) 689 { 690 droid(new Vector(-10, 35)); 691 droid(new Vector(-10, -35)); 692 } 693 } 694 else if (drd_level.Value == 3) 695 { 696 if (drd_type == 0) 697 { 698 droid(new Vector(-30, 30)); 699 droid(new Vector(-30, -30)); 700 droid(new Vector(-50, 0)); 701 } 702 else if (drd_type == 1) 703 { 704 droid(new Vector(40, 0)); 705 droid(new Vector(-10, 35)); 706 droid(new Vector(-10, -35)); 707 } 708 } 709 else if (drd_level.Value == 4) 710 { 711 if (drd_type == 0) 712 { 713 droid(new Vector(-30, 50)); 714 droid(new Vector(-30, -50)); 715 droid(new Vector(-50, 30)); 716 droid(new Vector(-50, -30)); 717 } 718 else if (drd_type == 1) 719 { 720 droid(new Vector(-30, 55)); 721 droid(new Vector(-30, -55)); 722 droid(new Vector(-10, 35)); 723 droid(new Vector(-10, -35)); 724 } 725 } 726 } 727 void cheat_damage() 728 { 729 wpn_damageRatio.Value++; 730 } 731 void cheat_spread() 732 { 585 733 wpn_spread.Value++; 586 }587 void cheat_damage()588 {589 wpn_damageRatio.Value++;590 734 } 591 735 void cheat_fullhp() … … 594 738 //MessageDisplay.Te 595 739 } 740 596 741 597 742 //Weapon system … … 748 893 749 894 projectile.damage = wpn_damageRatio.Value; 750 895 projectile.IgnoresCollisionResponse = true; 751 896 752 897 projectile.CollisionIgnoreGroup = 2; 753 projectile.MaximumLifetime = TimeSpan.FromSeconds(1.57);754 898 755 899 AddCollisionHandler<bullet, frontborder>(projectile, destroy); … … 764 908 { 765 909 droid drd = new droid(13,13); 766 drd.Shape = Shape.Circle;767 910 drd.IgnoresCollisionResponse = true; 768 911 drd.CollisionIgnoreGroup = 2; … … 778 921 move.Timeout += delegate 779 922 { 923 if (drd.IsDestroyed) move.Stop(); 924 780 925 if (drd.Position != player.Position + pos) 781 926 { … … 791 936 { 792 937 Timer drdshoot = new Timer(); 793 if (cursorpos == 0) drdshoot.Interval = drd_shootRate; 794 else if (cursorpos == 1) drdshoot.Interval = 0.05; 938 drdshoot.Interval = drd_shootRate; 795 939 if (cursorpos == 0) 796 940 { 797 941 drdshoot.Timeout += delegate 798 942 { 799 if (drd.IsDestroyed) drdshoot.Stop();800 943 if (ControllerOne.GetButtonState(Button.B) == ButtonState.Down) 801 944 { 945 if (drd.IsDestroyed) drdshoot.Stop(); 802 946 droidprojectile(drd.Position, new Vector(-400, RandomGen.NextDouble(100, 150)), new Vector(24, 13)); 803 947 droidprojectile(drd.Position, new Vector(-400, RandomGen.NextDouble(-150, -100)), new Vector(24, 13)); 804 } ;948 } 805 949 }; 806 950 } … … 809 953 drdshoot.Timeout += delegate 810 954 { 811 if (drd.IsDestroyed) drdshoot.Stop();812 955 if (ControllerOne.GetButtonState(Button.B) == ButtonState.Down) 813 956 { 814 droidlaser(drd.Position + new Vector(37, 0), new Vector(1400, 0), new Vector(70, 5)); 815 }; 957 if (drd.IsDestroyed) drdshoot.Stop(); 958 droidlaser(drd.Position + new Vector(37, 0), new Vector(1400, 0), new Vector(60, 5)); 959 } 816 960 }; 817 961 } … … 981 1125 enemyship.IgnoresCollisionResponse = true; 982 1126 enemyship.CollisionIgnoreGroup = 3; 983 enemyship.health.MaxValue = 35;1127 enemyship.health.MaxValue = 45; 984 1128 enemyship.Image = enemy_ship_02; 985 1129 … … 1241 1385 enemyship.IgnoresCollisionResponse = true; 1242 1386 enemyship.CollisionIgnoreGroup = 3; 1243 enemyship.health.MaxValue = 30;1387 enemyship.health.MaxValue = 45; 1244 1388 enemyship.Image = enemy_ship_05; 1245 1389 enemyship.explosion_scale = 70; … … 1277 1421 angle4 = UnlimitedAngle.FromDegrees(i + 270); 1278 1422 1279 enemy_shoot_3(enemyship.Position, angle.GetVector() * 400);1280 enemy_shoot_3(enemyship.Position, angle2.GetVector() * 400);1281 enemy_shoot_3(enemyship.Position, angle3.GetVector() * 400);1282 enemy_shoot_3(enemyship.Position, angle4.GetVector() * 400);1423 enemy_shoot_3(enemyship.Position, angle.GetVector() * 500); 1424 enemy_shoot_3(enemyship.Position, angle2.GetVector() * 500); 1425 enemy_shoot_3(enemyship.Position, angle3.GetVector() * 500); 1426 enemy_shoot_3(enemyship.Position, angle4.GetVector() * 500); 1283 1427 1284 1428 enemy_shootsfx.Play(); … … 1299 1443 1300 1444 wait.Start(1); 1445 } 1446 } 1447 void enemy_ship_6(Vector pos, double width, double height) 1448 { 1449 enemy enemyship = new enemy(82, 57); 1450 enemyship.Shape = Shape.Circle; 1451 enemyship.Position = pos; 1452 enemyship.IgnoresCollisionResponse = true; 1453 enemyship.CollisionIgnoreGroup = 3; 1454 enemyship.health.MaxValue = 100; 1455 enemyship.Image = enemy_ship_06; 1456 enemyship.explosion_scale = 70; 1457 1458 Add(enemyship, -1); 1459 enemyship.Hit(stagespeed); 1460 1461 1462 1463 1464 AddCollisionHandler<enemy, frontborder>(enemyship, enemy_ship_6_start_shooting); 1465 AddCollisionHandler<enemy, player>(enemyship, damagePlayerEnemyShip2); 1466 } 1467 void enemy_ship_6_start_shooting(enemy enemyship, frontborder border) 1468 { 1469 if (!enemyship.canShoot) 1470 { 1471 enemyship.canShoot = true; 1472 enemyship.LifetimeLeft = TimeSpan.FromSeconds(8.4); 1473 enemyship.Velocity = enemyship.Velocity / 3; 1474 1475 UnlimitedAngle angle = UnlimitedAngle.FromDegrees(0); 1476 UnlimitedAngle angle2 = UnlimitedAngle.FromDegrees(0); 1477 UnlimitedAngle angle3 = UnlimitedAngle.FromDegrees(0); 1478 UnlimitedAngle angle4 = UnlimitedAngle.FromDegrees(0); 1479 double i = 0; 1480 double c = 0; 1481 1482 Timer wait = new Timer(); 1483 Timer shoot = new Timer(); 1484 shoot.Interval = 0.1; 1485 shoot.Timeout += delegate 1486 { 1487 if (!enemyship.IsDestroyed) 1488 { 1489 c++; 1490 if (c >= 18) 1491 { 1492 c = 0; 1493 shoot.Stop(); 1494 wait.Start(1); 1495 } 1496 1497 i = i + 20; 1498 angle = UnlimitedAngle.FromDegrees(i); 1499 angle2 = UnlimitedAngle.FromDegrees(i + 90); 1500 angle3 = UnlimitedAngle.FromDegrees(i + 180); 1501 angle4 = UnlimitedAngle.FromDegrees(i + 270); 1502 1503 enemy_shoot_4(enemyship.Position, angle.GetVector() * 460); 1504 enemy_shoot_4(enemyship.Position, angle.GetVector() * 480); 1505 enemy_shoot_4(enemyship.Position, angle.GetVector() * 500); 1506 1507 enemy_shoot_4(enemyship.Position, angle2.GetVector() * 460); 1508 enemy_shoot_4(enemyship.Position, angle2.GetVector() * 480); 1509 enemy_shoot_4(enemyship.Position, angle2.GetVector() * 500); 1510 1511 enemy_shoot_4(enemyship.Position, angle3.GetVector() * 460); 1512 enemy_shoot_4(enemyship.Position, angle3.GetVector() * 480); 1513 enemy_shoot_4(enemyship.Position, angle3.GetVector() * 500); 1514 1515 enemy_shoot_4(enemyship.Position, angle4.GetVector() * 460); 1516 enemy_shoot_4(enemyship.Position, angle4.GetVector() * 480); 1517 enemy_shoot_4(enemyship.Position, angle4.GetVector() * 500); 1518 1519 1520 enemy_shootsfx.Play(); 1521 } 1522 else shoot.Stop(); 1523 }; 1524 1525 wait.Interval = 1.5; 1526 wait.Timeout += delegate 1527 { 1528 if (enemyship.IsDestroyed) wait.Stop(); 1529 shoot.Start(); 1530 }; 1531 1532 Timer start = new Timer(); 1533 start.Interval = 1; 1534 start.Timeout += delegate 1535 { 1536 if (!enemyship.IsDestroyed) 1537 { 1538 shoot.Start(); 1539 } 1540 else shoot.Stop(); 1541 }; 1542 1543 start.Start(1); 1301 1544 } 1302 1545 } … … 1310 1553 enemy_bullet.IgnoresGravity = true; 1311 1554 enemy_bullet.CollisionIgnoreGroup = 2; 1312 enemy_bullet.damage = 5;1313 enemy_bullet.MaximumLifetime = TimeSpan.FromSeconds(5);1314 1555 enemy_bullet.Image = bullet_enemy_05; 1315 1556 … … 1327 1568 enemy_bullet.IgnoresGravity = true; 1328 1569 enemy_bullet.CollisionIgnoreGroup = 2; 1329 enemy_bullet.damage = 5;1330 enemy_bullet.MaximumLifetime = TimeSpan.FromSeconds(5);1331 1570 enemy_bullet.Image = bullet_enemy_02; 1332 1571 … … 1352 1591 enemy_bullet.IgnoresGravity = true; 1353 1592 enemy_bullet.CollisionIgnoreGroup = 2; 1354 enemy_bullet.damage = 5;1355 enemy_bullet.MaximumLifetime = TimeSpan.FromSeconds(4);1356 1593 enemy_bullet.Image = bullet_enemy_01; 1357 1594 1358 1595 Add(enemy_bullet, 0); 1359 1596 enemy_bullet.Hit(dir); 1597 AddCollisionHandler<bullet, player>(enemy_bullet, damagePlayerBullet); 1598 AddCollisionHandler<bullet, bulletdes>(enemy_bullet, destroy); 1599 1600 } 1601 void enemy_shoot_4(Vector pos, Vector dir) 1602 { 1603 bullet enemy_bullet = new bullet(15, 35); 1604 1605 Add(enemy_bullet, 0); 1606 enemy_bullet.Shape = Shape.Circle; 1607 enemy_bullet.Position = pos; 1608 enemy_bullet.IgnoresCollisionResponse = true; 1609 enemy_bullet.IgnoresGravity = true; 1610 enemy_bullet.CollisionIgnoreGroup = 2; 1611 enemy_bullet.Image = bullet_enemy_07; 1612 enemy_bullet.Hit(dir); 1613 1614 enemy_bullet.Angle = enemy_bullet.Velocity.Angle + Angle.FromDegrees(45); 1360 1615 AddCollisionHandler<bullet, player>(enemy_bullet, damagePlayerBullet); 1361 1616 AddCollisionHandler<bullet, bulletdes>(enemy_bullet, destroy); … … 1508 1763 enemy_bullet.IgnoresGravity = true; 1509 1764 enemy_bullet.CollisionIgnoreGroup = 2; 1510 enemy_bullet.damage = 5;1511 enemy_bullet.MaximumLifetime = TimeSpan.FromSeconds(5);1512 1765 enemy_bullet.Image = bullet_enemy_06; 1513 1766 … … 1525 1778 enemy_bullet.IgnoresGravity = true; 1526 1779 enemy_bullet.CollisionIgnoreGroup = 2; 1527 enemy_bullet.damage = 5;1528 enemy_bullet.MaximumLifetime = TimeSpan.FromSeconds(5);1529 1780 enemy_bullet.Image = bullet_enemy_06; 1530 1781 … … 1550 1801 enemy_bullet.IgnoresGravity = true; 1551 1802 enemy_bullet.CollisionIgnoreGroup = 2; 1552 enemy_bullet.damage = 5;1553 enemy_bullet.MaximumLifetime = TimeSpan.FromSeconds(4);1554 1803 enemy_bullet.Image = bullet_enemy_06; 1555 1804 … … 1817 2066 fade.Start(); 1818 2067 1819 GameObjectstage_clear = new GameObject(290,39);2068 stage_clear = new GameObject(290,39); 1820 2069 stage_clear.Image = stage_1_clear; 1821 2070 stage_clear.Position = cntr; … … 1839 2088 MediaPlayer.Volume = 1; 1840 2089 MediaPlayer.IsRepeating = false; 2090 player.health.Value = player.health.MaxValue; 1841 2091 MediaPlayer.Play("Stage Clear"); 2092 2093 ControllerOne.Listen(Button.Start, ButtonState.Pressed, nextlevel, null); 1842 2094 }; 1843 2095 1844 2096 wait.Start(1); 1845 1846 2097 } 2098 1847 2099 hitsfx.Play(); 2100 } 2101 } 2102 void nextlevel() 2103 { 2104 if (currentlevel == "level_test") 2105 { 2106 SoundEffect.MasterVolume = 1; 2107 2108 selectsfx.Play(); 2109 stage_clear.Destroy(); 2110 MediaPlayer.Stop(); 2111 2112 black = new GameObject(Screen.Width,Screen.Height); 2113 black.Position = cntr; 2114 black.Color = Color.Transparent; 2115 2116 Add(black, 2); 2117 black.FadeColorTo(Color.Black, 1); 2118 2119 2120 Timer wait = new Timer(); 2121 wait.Interval = 1.5; 2122 wait.Timeout += delegate 2123 { 2124 bg.Image = stage2_bg; 2125 bg2.Image = stage2_bg; 2126 ClearControls(); 2127 2128 currentlevel = "level_02"; 2129 CreateNextLevel(currentlevel); 2130 2131 GameObject stage_02_start = new GameObject(405, 39); 2132 stage_02_start.Position = cntr; 2133 stage_02_start.Image = stage_2_start; 2134 Add(stage_02_start, 3); 2135 2136 double i = 0; 2137 Timer start = new Timer(); 2138 start.Interval = 0.1; 2139 start.Timeout += delegate 2140 { 2141 i++; 2142 if (i >= 15) stage_02_start.Destroy(); 2143 if (stage_02_start.IsVisible) stage_02_start.IsVisible = false; 2144 else stage_02_start.IsVisible = true; 2145 }; 2146 Pause(); 2147 start.Start(15); 2148 ControllerOne.Listen(Button.Start, ButtonState.Pressed, start_02, null); 2149 }; 2150 wait.Start(1); 1848 2151 } 1849 2152 } … … 1866 2169 explosion.Animation.Start(1); 1867 2170 } 1868 1869 2171 void explosion_animation2(PhysicsObject plr) 1870 2172 { … … 1881 2183 { 1882 2184 SoundEffect.MasterVolume = 0.2; 1883 MediaPlayer.Volume = 0.2; 2185 MediaPlayer.IsRepeating = false; 2186 MediaPlayer.Play("Player_down"); 2187 1884 2188 MultiSelectWindow gameover = new MultiSelectWindow("Game Over", "Quit"); 1885 2189 gameover.ItemSelected += select_gameover; -
2014/30/MikkoL/Gradiant/LM2/LM2Content/GradiantContent.contentproj
r5557 r5597 472 472 </Compile> 473 473 </ItemGroup> 474 <ItemGroup> 475 <Compile Include="Player_down.mp3"> 476 <Name>Player_down</Name> 477 <Importer>Mp3Importer</Importer> 478 <Processor>SongProcessor</Processor> 479 </Compile> 480 </ItemGroup> 481 <ItemGroup> 482 <Compile Include="gradient.png"> 483 <Name>gradient</Name> 484 <Importer>TextureImporter</Importer> 485 <Processor>TextureProcessor</Processor> 486 </Compile> 487 </ItemGroup> 488 <ItemGroup> 489 <Compile Include="enemy_ship_06.png"> 490 <Name>enemy_ship_06</Name> 491 <Importer>TextureImporter</Importer> 492 <Processor>TextureProcessor</Processor> 493 </Compile> 494 </ItemGroup> 495 <ItemGroup> 496 <Compile Include="bullet_enemy_07.png"> 497 <Name>bullet_enemy_07</Name> 498 <Importer>TextureImporter</Importer> 499 <Processor>TextureProcessor</Processor> 500 </Compile> 501 </ItemGroup> 502 <ItemGroup> 503 <Compile Include="level_02.txt"> 504 <Name>level_02</Name> 505 <Importer>TextFileImporter</Importer> 506 <Processor>TextFileContentProcessor</Processor> 507 </Compile> 508 </ItemGroup> 509 <ItemGroup> 510 <Compile Include="stage2_bg.png"> 511 <Name>stage2_bg</Name> 512 <Importer>TextureImporter</Importer> 513 <Processor>TextureProcessor</Processor> 514 </Compile> 515 </ItemGroup> 474 516 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 475 517 <!-- To modify your build process, add your task inside one of the targets below and uncomment it. -
2014/30/MikkoL/Gradiant/LM2/LM2Content/level_01.txt
r5487 r5597 1 %2 %3 %4 %5 %6 reuna %7 % T T T 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $8 % B B B B T TT9 % T T T B BB10 % B B B T TT11 &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&% T T T T B BB12 &xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx% B B B B T TT13 &xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx% T T T B BB14 &yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy% B B B T TT15 & % 1 1 R T T T 1 R T 1 B R B B R 1116 & % 1 R R 1 B B B R 1 B R R 1 T 1R 117 & % 1 1 1 1 R T T T 1 R 1 1 1 R 1 3 1R 118 & % R R R 1 B B B R 1 1 R R 1 1 2 5 5 1R 119 & % 1 1 1 1 R T 3 T T 1 R R T 1 1 R R 2 1R 120 & % 1 R R R R 1 B B B R 1 R B R 3 R 5 1 R 3 1R 121 & % 1 1 R 1 1 1 R T T 1 T R 1 1 1 R 1 1R 122 & % R 1 B B R B R 1 R R R 2 1 R 1R 123 & P % 1 R 1 3 2 2 3 1 1 51 5 T 1 1 1 5 5 3 2 2 3 5 3 3 5 15 G24 & % 1 R T T T R R 1 1B R R 2 1 1 11 R25 & % 1 1 R 1 R R 1 B B B 1 R R 1 1 R R 11 R26 & % 1 R 1 1 R T T TR R 1 R 3 R 5 R 1 3 11 R27 & % 1 R 1 R R 1 B 3 B 1 B 1 1 T 1 1 1 1 2 11 R28 & % R 1 1 R T T R T R R B R R R R 2 5 5 11 R29 & % 1 1 R R 1 B B 1 B 1 R 1 1 1 R 3 11 R30 & % 1 1 1 R T T R T R R R R 11 R31 & % R R 1 B B 1 B 1 T 1 1 1 11 R32 &zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz% T T T B R TR33 &xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx% B B B T BT34 &xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx% T T T B TB35 &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&% B B B T T BT36 % T T T B B TB37 % B B B T BT38 % T T T B TB39 % B B B T T BT40 % B B $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 441 reuna %42 %43 %44 %45 %1 % 2 % 3 % 4 % 5 % 6 reuna % 7 % T T 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 8 % B B B T T 9 #%# T T B B 10 #%# B B T T 11 #######################################%# T T T B B 12 #@#####################################%# B B B T T 13 #@#####################################%# T T B B 14 #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@%# B B T T 15 #@ %# 1 1 R T T T 1 R T B R B R 1 16 #@ %# 1 R R 1 B B B R 1 B R 1 T R 1 17 #@ %# 1 1 1 1 R T T T 1 R 1 1 R 1 3 R 1 18 #@ %# R R 1 B B B R 1 1 R 1 1 2 5 5 R 1 19 #@ %# 1 1 1 1 R T 3 T T 1 R R T 1 R R 2 R 1 20 #@ %# 1 R R R R 1 B B B R 1 R B 3 R 5 1 R 3 R 1 21 #@ %# 1 1 R 1 1 1 R T T 1 T R 1 1 R 1 R 1 22 #@ %# R 1 B B R B R 1 R R 2 1 R R 1 23 #@ P %# 1 R 1 3 2 2 3 1 1 51 5 T 1 1 5 5 3 2 2 3 5 3 3 5 5 G 24 #@ %# 1 R T T T R R 1 1B R 2 1 1 1 R 25 #@ %# 1 1 R 1 R R 1 B B B 1 R R 1 R R 1 R 26 #@ %# 1 R 1 1 R T T TR R 1 3 R 5 R 1 3 1 R 27 #@ %# 1 R 1 R R 1 B 3 B 1 B 1 1 T 1 1 1 2 1 R 28 #@ %# 1 1 R T T R T R R B R R R 2 5 5 1 R 29 #@ %# 1 1 R R 1 B B 1 B 1 R 1 1 R 3 1 R 30 #@ %# 1 1 1 R T T R T R R R 1 R 31 #@ %# R R 1 B B 1 B 1 T 1 1 1 R 32 #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@%# T T B R R 33 #@#####################################%# B B T T 34 #@#####################################%# T T B B 35 #######################################%# B B T T T 36 #%# T T B B B 37 #%# B B T T 38 % T T B B 39 % B B T T T 40 % B B $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 $ 4 41 reuna % 42 % 43 % 44 % 45 % -
2014/30/MikkoL/Gradiant/LM2/LM2Content/level_test.txt
r5553 r5597 10 10 #%# 11 11 #######################################%# 12 #& xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx%#13 #& xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx%#12 #&#####################################%# 13 #&#####################################%# 14 14 #&yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy%# 15 15 #& %# … … 31 31 #& %# 32 32 #&zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz%# 33 #& xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx%#34 #& xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx%#33 #&#####################################%# 34 #&#####################################%# 35 35 #######################################%# 36 36 #%#
Note: See TracChangeset
for help on using the changeset viewer.