- Timestamp:
- 2012-06-15 11:36:00 (11 years ago)
- Location:
- 2012/24/PyryL/RageFight
- Files:
-
- 1 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
2012/24/PyryL/RageFight/RageFight/RageFight/RageFight.cs
r3057 r3085 12 12 const double hyppyNopeus = 1000; 13 13 const int RUUDUN_KOKO = 40; 14 const double powerNopeus = 500; 15 const double laskiNopeus = 100; 14 16 15 17 PlatformCharacter pelaaja1; … … 26 28 27 29 PhysicsObject tahti; 30 PhysicsObject pingu; 31 28 32 29 33 … … 43 47 Image apple = LoadImage("mac"); 44 48 Image konehajalla = LoadImage("kone3"); 49 Image linux = LoadImage("linux"); 45 50 46 51 … … 126 131 kentta.SetTileMethod('K', luoKone); 127 132 kentta.SetTileMethod('T', luoKone2); 133 kentta.SetTileMethod('P', lisaaPingu); 128 134 kentta.Execute(RUUDUN_KOKO, RUUDUN_KOKO); 129 135 Level.CreateBorders(); … … 147 153 kentta.SetTileMethod('K', luoKone); 148 154 kentta.SetTileMethod('T', luoKone2); 155 kentta.SetTileMethod('P', lisaaPingu); 156 149 157 kentta.Execute(RUUDUN_KOKO, RUUDUN_KOKO); 150 158 Level.CreateBorders(); … … 166 174 kentta.SetTileMethod('K', luoKone); 167 175 kentta.SetTileMethod('T', luoKone2); 176 kentta.SetTileMethod('P', lisaaPingu); 177 168 178 kentta.Execute(RUUDUN_KOKO, RUUDUN_KOKO); 169 179 Level.CreateBorders(); … … 185 195 kentta.SetTileMethod('K', luoKone); 186 196 kentta.SetTileMethod('T', luoKone2); 197 kentta.SetTileMethod('P', lisaaPingu); 198 187 199 kentta.Execute(RUUDUN_KOKO, RUUDUN_KOKO); 188 200 Level.CreateBorders(); … … 204 216 kentta.SetTileMethod('K', luoKone); 205 217 kentta.SetTileMethod('T', luoKone2); 218 kentta.SetTileMethod('P', lisaaPingu); 219 206 220 kentta.Execute(RUUDUN_KOKO, RUUDUN_KOKO); 207 221 Level.CreateBorders(); … … 224 238 kentta.SetTileMethod('K', luoKone); 225 239 kentta.SetTileMethod('T', luoKone2); 240 kentta.SetTileMethod('P', lisaaPingu); 241 226 242 kentta.Execute(RUUDUN_KOKO, RUUDUN_KOKO); 227 243 Level.CreateBorders(); … … 243 259 kentta.SetTileMethod('K', luoKone); 244 260 kentta.SetTileMethod('T', luoKone2); 261 kentta.SetTileMethod('P', lisaaPingu); 262 245 263 kentta.Execute(RUUDUN_KOKO, RUUDUN_KOKO); 246 264 Level.CreateBorders(); … … 262 280 kentta.SetTileMethod('K', luoKone); 263 281 kentta.SetTileMethod('T', luoKone2); 282 kentta.SetTileMethod('P', lisaaPingu); 283 264 284 kentta.Execute(RUUDUN_KOKO, RUUDUN_KOKO); 265 285 Level.CreateBorders(); … … 281 301 kentta.SetTileMethod('K', luoKone); 282 302 kentta.SetTileMethod('T', luoKone2); 303 kentta.SetTileMethod('P', lisaaPingu); 304 283 305 kentta.Execute(RUUDUN_KOKO, RUUDUN_KOKO); 284 306 Level.CreateBorders(); … … 300 322 kentta.SetTileMethod('K', luoKone); 301 323 kentta.SetTileMethod('T', luoKone2); 324 kentta.SetTileMethod('P', lisaaPingu); 325 302 326 kentta.Execute(RUUDUN_KOKO, RUUDUN_KOKO); 303 327 Level.CreateBorders(); … … 364 388 } 365 389 390 void lisaaPingu(Vector paikka, double leveys, double korkeus) 391 { 392 PhysicsObject pingu = PhysicsObject.CreateStaticObject(leveys, korkeus); 393 pingu.IgnoresCollisionResponse = true; 394 pingu.Position = paikka; 395 pingu.Image = linux; 396 pingu.Tag = "pingu"; 397 Add(pingu); 398 } 399 400 366 401 367 402 void lisaaPelaaja(Vector paikka, double leveys, double korkeus) … … 375 410 376 411 AddCollisionHandler(pelaaja1, kasitteleOmena1); 412 AddCollisionHandler(pelaaja1, kasittelePingu); 413 377 414 378 415 … … 409 446 //AddCollisionHandler(pelaaja2, kasittelePelaajanTormays); 410 447 AddCollisionHandler(pelaaja2, kasitteleOmena2); 448 AddCollisionHandler(pelaaja2, kasittelePingu2); 449 411 450 Add(pelaaja2); 412 451 … … 541 580 } 542 581 543 582 void kasitteleOmena2(IPhysicsObject pelaaja, PhysicsObject kohde) 544 583 { 545 584 if (kohde.Tag.ToString() == "tahti") … … 553 592 } 554 593 594 595 void kasittelePingu(IPhysicsObject pelaaja, PhysicsObject kohde) 596 { 597 if (kohde.Tag.ToString() == "pingu") 598 { 599 maaliAani.Play(); 600 MessageDisplay.Add("Pelaaja 1 keräsi Linuxin!"); 601 kohde.Destroy(); 602 linuxPower1(); 603 } 604 605 } 606 607 void kasittelePingu2(IPhysicsObject pelaaja, PhysicsObject kohde) 608 { 609 if (kohde.Tag.ToString() == "pingu") 610 { 611 maaliAani.Play(); 612 MessageDisplay.Add("Pelaaja 2 keräsi Linuxin!"); 613 kohde.Destroy(); 614 linuxPower2(); 615 } 616 617 } 618 555 619 void p1Power() 556 620 { 557 Keyboard.Listen(Key.Left, ButtonState.Down, liikuta, "Liikkuu vasemmalle", pelaaja1, - nopeus);558 Keyboard.Listen(Key.Right, ButtonState.Down, liikuta, "Liikkuu vasemmalle", pelaaja1, nopeus);621 Keyboard.Listen(Key.Left, ButtonState.Down, liikuta, "Liikkuu vasemmalle", pelaaja1, -powerNopeus); 622 Keyboard.Listen(Key.Right, ButtonState.Down, liikuta, "Liikkuu vasemmalle", pelaaja1, powerNopeus); 559 623 Keyboard.Listen(Key.Up, ButtonState.Pressed, hyppaa, "Pelaaja hyppää", pelaaja1, hyppyNopeus); 560 561 Keyboard.Listen(Key.Down, ButtonState.Pressed, osuu2, "");562 563 624 } 564 625 565 626 void p2Power() 566 627 { 567 Keyboard.Listen(Key.A, ButtonState.Down, liikuta, "Liikkuu vasemmalle", pelaaja2, - nopeus);568 Keyboard.Listen(Key.D, ButtonState.Down, liikuta, "Liikkuu oikealle", pelaaja2, nopeus);628 Keyboard.Listen(Key.A, ButtonState.Down, liikuta, "Liikkuu vasemmalle", pelaaja2, -powerNopeus); 629 Keyboard.Listen(Key.D, ButtonState.Down, liikuta, "Liikkuu oikealle", pelaaja2, powerNopeus); 569 630 Keyboard.Listen(Key.W, ButtonState.Pressed, hyppaa, "Hyppää", pelaaja2, hyppyNopeus); 570 Keyboard.Listen(Key.S, ButtonState.Pressed, osuu1, "");571 572 631 } 632 633 void linuxPower1() 634 { 635 Keyboard.Listen(Key.Left, ButtonState.Down, liikuta, "Liikkuu vasemmalle", pelaaja1, -laskiNopeus); 636 Keyboard.Listen(Key.Right, ButtonState.Down, liikuta, "Liikkuu vasemmalle", pelaaja1, laskiNopeus); 637 Keyboard.Listen(Key.Down, ButtonState.Pressed, lyo, "Pelaaja potkaisee"); 638 } 639 640 void linuxPower2() 641 { 642 Keyboard.Listen(Key.A, ButtonState.Down, liikuta, "Liikkuu vasemmalle", pelaaja2, -laskiNopeus); 643 Keyboard.Listen(Key.D, ButtonState.Down, liikuta, "Liikkuu oikealle", pelaaja2, laskiNopeus); 644 Keyboard.Listen(Key.S, ButtonState.Released, lyo2, "Pelaaja2 potkaisee"); 645 } 646 647 573 648 574 649 … … 826 901 827 902 voimaPalkki.X = Screen.Right - 300; 828 voimaPalkki.Y = Screen. Top - 1000;903 voimaPalkki.Y = Screen.Bottom + 20; 829 904 voimaPalkki.Angle = Angle.RightAngle; 830 905 voimaPalkki.BarColor = Color.Red; … … 846 921 847 922 voimaPalkki.X = Screen.Left + 300; 848 voimaPalkki.Y = Screen. Top - 1000;923 voimaPalkki.Y = Screen.Bottom + 20; 849 924 voimaPalkki.Angle = Angle.RightAngle; 850 925 voimaPalkki.BarColor = Color.Red; -
2012/24/PyryL/RageFight/RageFight/RageFight/RageFight.csproj.Debug.cachefile
r3057 r3085 48 48 Content\Left Hook.xnb 49 49 Content\Right Hook.xnb 50 Content\linux.xnb 50 51 Content\kentta1.txt -
2012/24/PyryL/RageFight/RageFight/RageFightContent/RageFightContent.contentproj
r3057 r3085 330 330 </Compile> 331 331 </ItemGroup> 332 <ItemGroup> 333 <Compile Include="linux.png"> 334 <Name>linux</Name> 335 <Importer>TextureImporter</Importer> 336 <Processor>TextureProcessor</Processor> 337 </Compile> 338 </ItemGroup> 332 339 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 333 340 <!-- To modify your build process, add your task inside one of the targets below and uncomment it. -
2012/24/PyryL/RageFight/RageFight/RageFightContent/kentta10.txt
r3033 r3085 1 1 2 2 3 N *M3 N P M 4 4 # ### # 5 5 -
2012/24/PyryL/RageFight/RageFight/RageFightContent/kentta3.txt
r3033 r3085 2 2 3 3 4 *4 P 5 5 ### 6 6 -
2012/24/PyryL/RageFight/RageFight/RageFightContent/kentta4.txt
r3033 r3085 2 2 3 3 4 *4 P 5 5 ##### 6 6
Note: See TracChangeset
for help on using the changeset viewer.