- Timestamp:
- 2015-07-22 11:44:38 (8 years ago)
- Location:
- 2015/30/NoelV/peli0.0.0.3/turhakepeli
- Files:
-
- 42 edited
Legend:
- Unmodified
- Added
- Removed
-
2015/30/NoelV/peli0.0.0.3/turhakepeli/turhakepeli/turhakepeli/turhakepeli.cs
r6878 r6901 13 13 IntMeter vihollistenMaara = new IntMeter(0, 0, 0); 14 14 IntMeter ampumisLaskuri = new IntMeter(0, 0, 10); 15 PhysicsObject pelaaja;15 public PhysicsObject pelaaja; 16 16 PhysicsObject turhake; 17 17 PhysicsObject muuri; … … 53 53 Image LaatikkoYla3 = LoadImage("laatikkoYla3"); 54 54 55 bool saakoAmpua = true; 56 55 57 56 58 … … 75 77 { 76 78 //SetWindowSize(1900, 1060, false); 77 IsFullScreen = true;79 IsFullScreen = false; 78 80 AloitaPeli(); 79 81 … … 119 121 Keyboard.Listen(Key.A, ButtonState.Released, Liiku, null, Vector.Zero); 120 122 Keyboard.Listen(Key.Space, ButtonState.Pressed, Hyokkaa, null); 121 Keyboard.Listen(Key.LeftShift, ButtonState.Down, Lataa, null); 122 Keyboard.Listen(Key.LeftShift, ButtonState.Released, Ammu, null); 123 //Keyboard.Listen(Key.LeftShift, ButtonState.Down, Lataa, null); 124 //Keyboard.Listen(Key.LeftShift, ButtonState.Released, Ammu, null); 125 Keyboard.Listen(Key.Up, ButtonState.Down, LuoAmmus, null, new Vector(0, 100000)); 126 Keyboard.Listen(Key.Down, ButtonState.Down, LuoAmmus, null, new Vector(0, -100000)); 127 Keyboard.Listen(Key.Left, ButtonState.Down, LuoAmmus, null, new Vector(-100000, 0)); 128 Keyboard.Listen(Key.Right, ButtonState.Down, LuoAmmus, null, new Vector(100000, 0)); 129 130 131 132 133 123 134 124 135 125 136 Keyboard.Listen(Key.Escape, ButtonState.Pressed, KysyPoistumista, "Lopeta peli"); 126 137 } 127 void Ammu() 128 { 129 130 } 138 139 140 141 void LuoAmmus(Vector suunta) 142 { 143 if (saakoAmpua == true) 144 { 145 PhysicsObject ammus = new PhysicsObject(10.0, 10.0); 146 ammus.Position = pelaaja.Position; 147 ammus.Tag = "ammus"; 148 ammus.Push(suunta); 149 ammus.CollisionIgnoreGroup = 5; 150 ammus.CanRotate = false; 151 ammus.Lifetime = 152 Add(ammus); 153 154 AddCollisionHandler(ammus, "vihu", HyokkausOsuu); 155 AddCollisionHandler(ammus, "laatikko", HyokkausOsuu); 156 AddCollisionHandler(ammus, "potionLaatikko", HyokkausOsuu); 157 AddCollisionHandler(ammus, "manaLaatikko", HyokkausOsuu); 158 159 saakoAmpua = false; 160 161 Timer.SingleShot(0.5, delegate { saakoAmpua = true; }); 162 163 } 164 165 } 166 131 167 void Lataa() 132 168 { … … 503 539 hitbox.X = pelaaja.X; 504 540 hitbox.Color = Color.Transparent; 541 hitbox.CollisionIgnoreGroup = 5; 505 542 //hitbox.Image = hyokkauksenKuva; 506 543 //hitbox.CollisionIgnoreGroup = 1; … … 656 693 { 657 694 laatikko laatikko = new laatikko(paikka, leveys, 30, alaOsanKuva, ylaOsanKuva, "laatikko"); 658 659 660 695 661 696 //laatikko.Tag = "laatikko"; 662 697 Add(laatikko); 663 664 AxleJoint liitos = new AxleJoint(laatikko);665 Add(liitos);666 698 } 667 699 private void LuoManaLaatikko(Vector paikka, double leveys, double korkeus) … … 780 812 void HyokkausOsuu(PhysicsObject hyokkaus, PhysicsObject kohde) 781 813 { 814 782 815 if (kohde.Tag.Equals("vihu")) 783 816 { … … 799 832 OsuManaLaatikkoon(kohde as laatikko); 800 833 834 } 835 836 //tuhoa jos ammus 837 if (hyokkaus.Tag.Equals("ammus")) 838 { 839 hyokkaus.Destroy(); 801 840 } 802 841 … … 1182 1221 : base(leveys, korkeus) 1183 1222 { 1223 this.MakeStatic(); 1184 1224 this.Position = paikka; 1185 1225 this.CanRotate = false; … … 1193 1233 1194 1234 Timer kerroksenVaihtaja = new Timer(); 1195 kerroksenVaihtaja.Interval = 0.001; 1196 1197 1198 1235 kerroksenVaihtaja.Interval = 3; 1236 kerroksenVaihtaja.Timeout += delegate 1237 { 1238 if (((turhakepeli)Game.Instance).pelaaja != null) 1239 { 1240 1241 if (((turhakepeli)Game.Instance).pelaaja.Position.Y < this.Position.Y) 1242 { 1243 this.TuhoaLaatikko(); 1244 ((turhakepeli)Game.Instance).Add(this, 3); 1245 ((turhakepeli)Game.Instance).Add(this.ylaOsa, 3); 1246 } 1247 else 1248 { 1249 this.TuhoaLaatikko(); 1250 ((turhakepeli)Game.Instance).Add(this, 3); 1251 ((turhakepeli)Game.Instance).Add(this.ylaOsa, 3); 1252 } 1253 } 1254 }; 1255 //kerroksenVaihtaja.Start(); 1199 1256 } 1200 1257 public void VaihdaKuva(Image alaOsanUusiKuva, Image ylaOsanUusiKuva) -
2015/30/NoelV/peli0.0.0.3/turhakepeli/turhakepeli/turhakepeliContent/obj/x86/Debug/ContentPipeline.xml
r6878 r6901 9 9 <Options>None</Options> 10 10 <Output>C:\MyTemp\NoelV\peli0.0.0.3\turhakepeli\turhakepeli\turhakepeli\bin\x86\Debug\Content\kentta.xnb</Output> 11 <Time>2015-07-21T11:29: 48.3054038+03:00</Time>11 <Time>2015-07-21T11:29:50+03:00</Time> 12 12 </Item> 13 13 <Item> … … 63 63 <Options>None</Options> 64 64 <Output>C:\MyTemp\NoelV\peli0.0.0.3\turhakepeli\turhakepeli\turhakepeli\bin\x86\Debug\Content\maa.xnb</Output> 65 <Time>2015-0 4-19T20:09:40+03:00</Time>65 <Time>2015-07-21T19:12:38+03:00</Time> 66 66 </Item> 67 67 <Item> … … 72 72 <Options>None</Options> 73 73 <Output>C:\MyTemp\NoelV\peli0.0.0.3\turhakepeli\turhakepeli\turhakepeli\bin\x86\Debug\Content\ala.xnb</Output> 74 <Time>2015-0 5-08T21:03:22+03:00</Time>74 <Time>2015-07-21T16:49:44+03:00</Time> 75 75 </Item> 76 76 <Item> … … 81 81 <Options>None</Options> 82 82 <Output>C:\MyTemp\NoelV\peli0.0.0.3\turhakepeli\turhakepeli\turhakepeli\bin\x86\Debug\Content\Sivu.xnb</Output> 83 <Time>2015-0 5-08T20:57:34+03:00</Time>83 <Time>2015-07-21T17:18:28+03:00</Time> 84 84 </Item> 85 85 <Item> … … 90 90 <Options>None</Options> 91 91 <Output>C:\MyTemp\NoelV\peli0.0.0.3\turhakepeli\turhakepeli\turhakepeli\bin\x86\Debug\Content\oikeaYla.xnb</Output> 92 <Time>2015-0 5-15T19:02:22+03:00</Time>92 <Time>2015-07-21T17:18:36+03:00</Time> 93 93 </Item> 94 94 <Item> … … 108 108 <Options>None</Options> 109 109 <Output>C:\MyTemp\NoelV\peli0.0.0.3\turhakepeli\turhakepeli\turhakepeli\bin\x86\Debug\Content\oikeaAla.xnb</Output> 110 <Time>2015-0 5-15T18:59:36+03:00</Time>110 <Time>2015-07-21T18:05:38+03:00</Time> 111 111 </Item> 112 112 <Item> … … 117 117 <Options>None</Options> 118 118 <Output>C:\MyTemp\NoelV\peli0.0.0.3\turhakepeli\turhakepeli\turhakepeli\bin\x86\Debug\Content\vasenAla.xnb</Output> 119 <Time>2015-0 5-15T18:51:56+03:00</Time>119 <Time>2015-07-21T18:05:38+03:00</Time> 120 120 </Item> 121 121 <Item> … … 126 126 <Options>None</Options> 127 127 <Output>C:\MyTemp\NoelV\peli0.0.0.3\turhakepeli\turhakepeli\turhakepeli\bin\x86\Debug\Content\vasenYla.xnb</Output> 128 <Time>2015-0 5-15T19:04:24+03:00</Time>128 <Time>2015-07-21T17:18:36+03:00</Time> 129 129 </Item> 130 130 <Item> … … 171 171 <Options>None</Options> 172 172 <Output>C:\MyTemp\NoelV\peli0.0.0.3\turhakepeli\turhakepeli\turhakepeli\bin\x86\Debug\Content\enkka.xnb</Output> 173 <Time>2015-0 3-26T22:39:22+02:00</Time>173 <Time>2015-07-21T18:18:58+03:00</Time> 174 174 </Item> 175 175 <Item> … … 360 360 <Options>None</Options> 361 361 <Output>C:\MyTemp\NoelV\peli0.0.0.3\turhakepeli\turhakepeli\turhakepeli\bin\x86\Debug\Content\YlempiOikeaAla.xnb</Output> 362 <Time>2015-0 5-15T18:57:42+03:00</Time>362 <Time>2015-07-21T18:11:06+03:00</Time> 363 363 </Item> 364 364 <Item> … … 369 369 <Options>None</Options> 370 370 <Output>C:\MyTemp\NoelV\peli0.0.0.3\turhakepeli\turhakepeli\turhakepeli\bin\x86\Debug\Content\YlempiOikeaYla.xnb</Output> 371 <Time>2015-0 5-15T19:01:08+03:00</Time>371 <Time>2015-07-21T18:11:06+03:00</Time> 372 372 </Item> 373 373 <Item> … … 378 378 <Options>None</Options> 379 379 <Output>C:\MyTemp\NoelV\peli0.0.0.3\turhakepeli\turhakepeli\turhakepeli\bin\x86\Debug\Content\YlempiVasenAla.xnb</Output> 380 <Time>2015-0 5-15T18:53:58+03:00</Time>380 <Time>2015-07-21T18:11:06+03:00</Time> 381 381 </Item> 382 382 <Item> … … 387 387 <Options>None</Options> 388 388 <Output>C:\MyTemp\NoelV\peli0.0.0.3\turhakepeli\turhakepeli\turhakepeli\bin\x86\Debug\Content\YlempiVasenYla.xnb</Output> 389 <Time>2015-0 5-15T19:03:36+03:00</Time>389 <Time>2015-07-21T18:11:06+03:00</Time> 390 390 </Item> 391 391 <Item> … … 396 396 <Options>None</Options> 397 397 <Output>C:\MyTemp\NoelV\peli0.0.0.3\turhakepeli\turhakepeli\turhakepeli\bin\x86\Debug\Content\YlempiKeski.xnb</Output> 398 <Time>2015-0 5-08T22:20:44+03:00</Time>398 <Time>2015-07-21T18:11:28+03:00</Time> 399 399 </Item> 400 400 <Item> … … 441 441 <Options>None</Options> 442 442 <Output>C:\MyTemp\NoelV\peli0.0.0.3\turhakepeli\turhakepeli\turhakepeli\bin\x86\Debug\Content\laatikkoAla.xnb</Output> 443 <Time>2015-07-21T11:06:4 2.3282038+03:00</Time>443 <Time>2015-07-21T11:06:44+03:00</Time> 444 444 </Item> 445 445 <Item> … … 450 450 <Options>None</Options> 451 451 <Output>C:\MyTemp\NoelV\peli0.0.0.3\turhakepeli\turhakepeli\turhakepeli\bin\x86\Debug\Content\laatikkoYla.xnb</Output> 452 <Time>2015-07-21T11:06:0 7.6962038+03:00</Time>452 <Time>2015-07-21T11:06:08+03:00</Time> 453 453 </Item> 454 454 <Item> … … 459 459 <Options>None</Options> 460 460 <Output>C:\MyTemp\NoelV\peli0.0.0.3\turhakepeli\turhakepeli\turhakepeli\bin\x86\Debug\Content\kalja.xnb</Output> 461 <Time>2015-07-21T1 0:32:59.5549471+03:00</Time>461 <Time>2015-07-21T16:37:40+03:00</Time> 462 462 </Item> 463 463 <Item> … … 468 468 <Options>None</Options> 469 469 <Output>C:\MyTemp\NoelV\peli0.0.0.3\turhakepeli\turhakepeli\turhakepeli\bin\x86\Debug\Content\laatikkoYla2.xnb</Output> 470 <Time>2015-07-21T11:49:4 3.7546038+03:00</Time>470 <Time>2015-07-21T11:49:44+03:00</Time> 471 471 </Item> 472 472 <Item> … … 477 477 <Options>None</Options> 478 478 <Output>C:\MyTemp\NoelV\peli0.0.0.3\turhakepeli\turhakepeli\turhakepeli\bin\x86\Debug\Content\laatikkoAla2.xnb</Output> 479 <Time>2015-07-21T11:50: 09.9002038+03:00</Time>479 <Time>2015-07-21T11:50:10+03:00</Time> 480 480 </Item> 481 481 <Item> … … 486 486 <Options>None</Options> 487 487 <Output>C:\MyTemp\NoelV\peli0.0.0.3\turhakepeli\turhakepeli\turhakepeli\bin\x86\Debug\Content\laatikkoAla3.xnb</Output> 488 <Time>2015-07-21T13:30:3 7.3898043+03:00</Time>488 <Time>2015-07-21T13:30:38+03:00</Time> 489 489 </Item> 490 490 <Item> … … 495 495 <Options>None</Options> 496 496 <Output>C:\MyTemp\NoelV\peli0.0.0.3\turhakepeli\turhakepeli\turhakepeli\bin\x86\Debug\Content\laatikkoYla3.xnb</Output> 497 <Time>2015-07-21T13:29:4 1.9162043+03:00</Time>497 <Time>2015-07-21T13:29:42+03:00</Time> 498 498 </Item> 499 499 <BuildSuccessful>true</BuildSuccessful>
Note: See TracChangeset
for help on using the changeset viewer.