- Timestamp:
- 2012-06-08 11:05:28 (11 years ago)
- Location:
- 2012/23/HannesM
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
2012/23/HannesM/Pong/Pong/Pong/Pong.cs
r2784 r2873 9 9 public class Pong : PhysicsGame 10 10 { 11 Vector nopeusYlos = new Vector(0, 200);12 Vector nopeusAlas = new Vector(0, - 200);11 Vector nopeusYlos = new Vector(0, 300); 12 Vector nopeusAlas = new Vector(0, -300); 13 13 14 14 PhysicsObject pallo; -
2012/23/HannesM/The Game of Rooms/The Game of Rooms/The Game of Rooms/The_Game_of_Rooms.cs
r2857 r2873 12 12 PlatformCharacter pelaaja; 13 13 bool onTikkaat = false; 14 DoubleMeter ammusmittari;14 IntMeter AmmusLaskuri; 15 15 16 16 public override void Begin() … … 55 55 ruudut.Execute(); 56 56 57 Laskuri(); 58 57 59 Level.BackgroundColor = Color.White; 58 60 … … 93 95 AddCollisionHandler(pelaaja, "pöö", PelaajaAuts); 94 96 AddCollisionHandler(pelaaja, "Enu", Elamapakki); 97 AddCollisionHandler(pelaaja, "Ammuu", ammusPakki); 95 98 96 99 Keyboard.Listen(Key.A, ButtonState.Down, … … 298 301 vihu.Shape = Shape.Octagon; 299 302 vihu.Image = LoadImage("The Room Enemy"); 303 vihu.IgnoresGravity = true; 300 304 vihu.Tag = "pöö"; 301 305 … … 320 324 ammuspaketti.Shape = Shape.Diamond; 321 325 ammuspaketti.Image = LoadImage("Ammuksia"); 326 ammuspaketti.Tag = "Ammuu"; 322 327 Add(ammuspaketti); 323 328 } … … 366 371 void Ammu() 367 372 { 373 if (AmmusLaskuri.Value < 1) return; 374 368 375 Projectile ammus = new Projectile(4.0, 4.0, Color.Black); 369 376 ammus.Y = pelaaja.Y + 9; … … 374 381 AddCollisionHandler(ammus, ammuksentormays); 375 382 Add(ammus); 383 AmmusLaskuri.Value--; 376 384 Vector ase = new Vector(pelaaja.FacingDirection.Vector.X * 10000.0, 0.0); 377 385 ammus.Hit(ase); … … 407 415 } 408 416 409 void ammusmittari()410 {411 ammusMittari = new DoubleMeter(5);412 ammusMittari.MaxValue = 5;413 ProgressBar ammusMittari = new ProgressBar(100, 10);414 ammusMittari.BindTo(ammusMittari);415 Add(ammusMittari);416 417 ammusPalkki.X = Screen.Left -100;418 ammusPalkki.Y = Screen.Top + -100;419 ammusPalkki.Angle = Angle.RightAngle;420 ammusPalkki.BarColor = Color.Red;421 ammusPalkki.BorderColor = Color.Black;422 ammusPalkki.Angle = Angle.FromDegrees(90);423 ammusMittari.LowerLimit += AmmuksetLoppui;424 }425 426 void VahennaAmmuksia()427 {428 ammusmittari.Value--;429 }430 431 void AmmuksetLoppui(double mittarinArvo)432 {433 MessageDisplay.Add("No more bullets!");434 }435 436 417 void ElamaLoppui(double mittarinarvo) 437 418 { … … 460 441 } 461 442 443 void ammusPakki(PhysicsObject pelaaja, PhysicsObject Ammuu) 444 { 445 if (AmmusLaskuri.Value > 19) return; 446 447 AmmusLaskuri.Value = AmmusLaskuri.Value +3; 448 Ammuu.Destroy(); 449 } 450 462 451 void Laitakiipeaan() 463 452 { … … 475 464 476 465 } 466 467 void Laskuri() 468 { 469 AmmusLaskuri = new IntMeter(6, 0, 20); 470 471 Label ammusNaytto = new Label(); 472 ammusNaytto.X = Screen.Left + 100; 473 ammusNaytto.Y = Screen.Top - 100; 474 ammusNaytto.TextColor = Color.White; 475 ammusNaytto.Color = Color.Red; 476 477 ammusNaytto.BindTo(AmmusLaskuri); 478 Add (ammusNaytto); 479 } 480 477 481 } 478 482
Note: See TracChangeset
for help on using the changeset viewer.