- Timestamp:
- 2011-06-09 15:55:09 (10 years ago)
- Location:
- 2011/23/iltakuop/Blocks/Blocks
- Files:
-
- 5 added
- 3 deleted
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
2011/23/iltakuop/Blocks/Blocks/Blocks/Peli.cs
r1816 r1824 37 37 PhysicsObject tnt; 38 38 PhysicsObject elämä; 39 PhysicsObject Power1;40 PhysicsObject Power2;41 39 42 40 PhysicsObject alaReuna; … … 59 57 Image mailanKuva = LoadImage("Maila"); 60 58 Image elämänKuva = LoadImage("elämä"); 61 Image Power2Kuva = LoadImage("Power2"); 62 Image Power1Kuva = LoadImage("Power1");59 60 List<Image> kuvat = new List<Image>(); 63 61 int pisteet; 64 62 int elämät = 3; … … 80 78 public override void Begin() 81 79 { 80 for (int i = 1; i < 8; i++) 81 { 82 kuvat.Add(LoadImage("Power" + i)); 83 } 84 82 85 Valikko(); 83 86 } … … 448 451 } 449 452 450 if (kohde.Tag.ToString() == "ttaso" && pallo.Velocity.X ==0)451 { 452 pallo.Velocity = new Vector(100, pallo.Velocity.Y);453 if (kohde.Tag.ToString() == "ttaso" && pallo.Velocity.X < 10) 454 { 455 Timer.SingleShot(0.05, korjaaXSuunta); 453 456 454 457 } 455 458 if (kohde != maila && pallo.Velocity.Y == 0 && ySuuntaKorjattu == 0) 456 459 { 457 Timer.SingleShot(0. 1, korjaaYSuunta);460 Timer.SingleShot(0.05, korjaaYSuunta); 458 461 ySuuntaKorjattu = 1; 459 462 } … … 462 465 elämätL.Value = elämät; 463 466 467 } 468 469 void korjaaXSuunta() 470 { 471 if (pallo.Velocity.X == 0) pallo.Velocity = new Vector(100, pallo.Velocity.Y); 464 472 } 465 473 … … 484 492 else if ((Power > 4)&&(Power < 10)) 485 493 { 486 PudotaPower1(kohde); 487 } 488 else if ((Power > 9) && (Power < 15)) 489 { 490 PudotaPower2(kohde); 494 PudotaPower(kohde, 1); 495 } 496 else if ((Power > 9) && (Power < 14)) 497 { 498 PudotaPower(kohde, 2); 499 } 500 else if ((Power > 13) && (Power < 17)) 501 { 502 PudotaPower(kohde, 3); 503 } 504 else if ((Power > 16) && (Power < 19)) 505 { 506 PudotaPower(kohde, 4); 507 } 508 else if ((Power > 18) && (Power < 20)) 509 { 510 PudotaPower(kohde, 5); 491 511 } 492 512 } … … 504 524 } 505 525 506 void PudotaPower1(PhysicsObject kohde) 507 { 508 Power1 = new PhysicsObject(10, 10); 509 Power1.IgnoresCollisionResponse = true; 510 Power1.Tag = "Power1"; 511 Power1.Position = kohde.Position; 512 Power1.Image = Power1Kuva; 526 void PudotaPower(PhysicsObject kohde, int x) 527 { 528 int y = x; 529 y--; 530 PhysicsObject Power = new PhysicsObject(10, 10); 531 Power.IgnoresCollisionResponse = true; 532 Power.Tag = "Power" + x; 533 Power.Position = kohde.Position; 534 Power.Image = kuvat[y]; 513 535 Vector impulssi = new Vector(0, -100); 514 Add(Power1); 515 Power1.Hit(impulssi); 516 } 517 518 519 void PudotaPower2(PhysicsObject kohde) 520 { 521 Power2 = new PhysicsObject(10, 10); 522 Power2.IgnoresCollisionResponse = true; 523 Power2.Tag = "Power2"; 524 Power2.Position = kohde.Position; 525 Power2.Image = Power2Kuva; 526 Vector impulssi = new Vector(0, -100); 527 Add(Power2); 528 Power2.Hit(impulssi); 529 } 536 Add(Power); 537 Power.Hit(impulssi); 538 } 539 540 530 541 531 542 void TarkistaVoitto() … … 799 810 kohde.Destroy(); 800 811 } 801 else if (kohde.Tag.ToString() == "Power1")802 {812 //else if (kohde.Tag.ToString() == "Power1") 813 //{ 803 814 804 if (pieniMaila == 1)805 {806 PalautaMaila();807 }808 else if (isoMaila == 0)809 {810 maila.Width += 20;811 isoMaila = 1;812 Timer.SingleShot(20, PalautaMaila);813 }815 // if (pieniMaila == 1) 816 // { 817 // PalautaMaila(); 818 // } 819 // else if (isoMaila == 0) 820 // { 821 // maila.Width += 20; 822 // isoMaila = 1; 823 // Timer.SingleShot(20, PalautaMaila); 824 // } 814 825 815 kohde.Destroy(); 816 } 817 else if (kohde.Tag.ToString() == "Power2") 818 { 819 if (isoMaila == 1) 820 { 821 PalautaMaila(); 822 } 823 else if (pieniMaila == 0) 826 // kohde.Destroy(); 827 //} 828 //else if (kohde.Tag.ToString() == "Power2") 829 //{ 830 // if (isoMaila == 1) 831 // { 832 // PalautaMaila(); 833 // } 834 // else if (pieniMaila == 0) 835 // { 836 // kohde.Destroy(); 837 // pieniMaila = 1; 838 // maila.Width -= 20; 839 // Timer.SingleShot(20, PalautaMaila); 840 // } 841 842 843 //} 844 845 for (int i = 1; i < 6; i++) 846 { 847 if (kohde.Tag.ToString() == "Power" + i) 824 848 { 825 849 kohde.Destroy(); 826 pieniMaila = 1; 827 maila.Width -= 20; 828 Timer.SingleShot(20, PalautaMaila); 829 } 830 831 } 850 pisteet += i * 1000; 851 } 852 853 } 854 855 pisteetL.Value = pisteet; 856 pisteetL.Value = pisteet; 832 857 } 833 858 -
2011/23/iltakuop/Blocks/Blocks/Blocks/kentta1.txt
r1794 r1824 11 11 - - 12 12 13 13 14 14 15 15 -
2011/23/iltakuop/Blocks/Blocks/BlocksContent/BlocksContent.contentproj
r1807 r1824 149 149 </ItemGroup> 150 150 <ItemGroup> 151 <Compile Include="Power6.png"> 152 <Name>Power6</Name> 153 <Importer>TextureImporter</Importer> 154 <Processor>TextureProcessor</Processor> 155 </Compile> 156 </ItemGroup> 157 <ItemGroup> 158 <Compile Include="Power7.png"> 159 <Name>Power7</Name> 160 <Importer>TextureImporter</Importer> 161 <Processor>TextureProcessor</Processor> 162 </Compile> 163 </ItemGroup> 164 <ItemGroup> 165 <Compile Include="Power2.png"> 166 <Name>Power2</Name> 167 <Importer>TextureImporter</Importer> 168 <Processor>TextureProcessor</Processor> 169 </Compile> 170 </ItemGroup> 171 <ItemGroup> 172 <Compile Include="Power3.png"> 173 <Name>Power3</Name> 174 <Importer>TextureImporter</Importer> 175 <Processor>TextureProcessor</Processor> 176 </Compile> 177 </ItemGroup> 178 <ItemGroup> 151 179 <Compile Include="Power1.png"> 152 180 <Name>Power1</Name> … … 156 184 </ItemGroup> 157 185 <ItemGroup> 158 <Compile Include="Power2.png"> 159 <Name>Power2</Name> 186 <Compile Include="Power4.png"> 187 <Name>Power4</Name> 188 <Importer>TextureImporter</Importer> 189 <Processor>TextureProcessor</Processor> 190 </Compile> 191 </ItemGroup> 192 <ItemGroup> 193 <Compile Include="Power5.png"> 194 <Name>Power5</Name> 160 195 <Importer>TextureImporter</Importer> 161 196 <Processor>TextureProcessor</Processor>
Note: See TracChangeset
for help on using the changeset viewer.