- Timestamp:
- 2011-08-02 21:53:17 (12 years ago)
- Location:
- 2011/26/OssiV
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
2011/26/OssiV/dall of dude 2d.cs
r2452 r2517 17 17 const int RUUDUN_KOKO = 40; 18 18 IntMeter pisteLaskuri; 19 19 IntMeter ammusLaskuri; 20 20 PlatformCharacter pelaaja1; 21 21 PlatformCharacter pelaaja2; … … 32 32 Image maalinkuva = LoadImage("maali2"); 33 33 Image kaupankuva = LoadImage("kauppa"); 34 Image bossinkuva = LoadImage("bossi"); 35 36 34 37 35 38 List<Pahis> pahikset; … … 40 43 { 41 44 42 // Gravity = new Vector(0, -1000); 45 43 46 Valikko(); 44 47 if (DataStorage.Exists("pisteet.xml")) … … 61 64 kentta['H'] = lisaaMaali; 62 65 kentta['K'] = luoKauppa; 63 66 kentta['B'] = luoBossi; 64 67 65 68 kentta.Insert(RUUDUN_KOKO, RUUDUN_KOKO); … … 230 233 } 231 234 232 IntMeter LuoPisteLaskuri(double x, double y) 233 { 234 IntMeter laskuri = new IntMeter(0); 235 laskuri.MaxValue = 10; 236 Label naytto = new Label(); 237 naytto.BindTo(laskuri); 238 naytto.X = x; 239 naytto.Y = y; 240 naytto.TextColor = Color.White; 241 naytto.BorderColor = Level.BackgroundColor; 242 naytto.Color = Level.BackgroundColor; 243 Add(naytto); 244 return laskuri; 245 } 235 246 236 247 237 PhysicsObject lisaaHaivePalikka() … … 358 348 { 359 349 pisteLaskuri = new IntMeter(0); 360 350 361 351 Label pisteNaytto = new Label(); 362 352 pisteNaytto.X = Screen.Left + 100; … … 422 412 void naytaPisteet() 423 413 { 414 424 415 HighScoreWindow topIkkuna = new HighScoreWindow("Dall of Dude 2D", 425 416 "Parhaat pisteet", … … 428 419 topIkkuna.Closed += TallennaPisteet; 429 420 Add(topIkkuna); 430 431 421 } 432 422 void TallennaPisteet(Window sender) … … 512 502 pelaaja2.Weapon = new LaserGun(60, 20); 513 503 pelaaja2.Weapon.ProjectileCollision += AmmusOsui; 514 504 515 505 516 506 } … … 621 611 Keyboard.Listen(Key.D2, ButtonState.Pressed, vaihdaPlasmaCannoniin, "plasmatykki"); 622 612 Keyboard.Listen(Key.D1, ButtonState.Pressed, vaihdaRynkkyyn, "rynnäkkökivääri"); 623 //Keyboard.Listen(Key.D7, ButtonState.Pressed, vaihdaLaserPyssyyn, null); 624 } 625 } 626 void lisaaPisteita() 627 { 628 pisteLaskuri.Value = pisteLaskuri.Value += 1000000; 629 } 630 } 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 public class Pahis : PhysicsObject 647 { 648 public int Elamat { get; set; } 649 650 public Pahis(double width, double height) 651 : base(width, height) 652 { 653 654 } 655 656 657 } 658 659 660 661 662 663 613 Keyboard.Listen(Key.D7, ButtonState.Pressed, vaihdaLaserPyssyyn, null); 614 } 615 } 616 void lisaaPisteita() 617 { 618 pisteLaskuri.Value = pisteLaskuri.Value += 1000000; 619 } 620 PhysicsObject luoBossi() 621 { 622 Pahis bossi = new Pahis(50, 50); 623 624 bossi.Shape = Shape.FromImage(bossinkuva); 625 bossi.Elamat = 30; 626 bossi.Mass = 100; 627 bossi.Restitution = 1.0; 628 bossi.Image = bossinkuva; 629 bossi.CanRotate = true; 630 Add(bossi); 631 return bossi; 632 } 633 634 635 636 } 637 638 639 640 public class Pahis : PhysicsObject 641 { 642 public int Elamat { get; set; } 643 644 public Pahis(double width, double height) 645 : base(width, height) 646 { 647 648 } 649 650 651 } 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673
Note: See TracChangeset
for help on using the changeset viewer.