- Timestamp:
- 2014-06-06 12:44:28 (9 years ago)
- Location:
- 2014/23/AaronA/RogueRPG/RogueRPG
- Files:
-
- 6 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
2014/23/AaronA/RogueRPG/RogueRPG/RogueRPG/RogueRPG.cs
r4880 r4902 19 19 Vector pelaajanPaikka = new Vector(0,200); 20 20 21 IntMeter raha = new IntMeter( 50000);21 IntMeter raha = new IntMeter(100); 22 22 public IntMeter vahinko = new IntMeter(1); 23 IntMeter pankkiraha = new IntMeter( 30);23 IntMeter pankkiraha = new IntMeter(50); 24 24 IntMeter elamaLaskuri = new IntMeter(5, 0, 5); 25 IntMeter potions = new IntMeter( 0);25 IntMeter potions = new IntMeter(1); 26 26 IntMeter mana = new IntMeter(5); 27 IntMeter storagepotions = new IntMeter( 1);27 IntMeter storagepotions = new IntMeter(0); 28 28 IntMeter storagemana = new IntMeter(0); 29 29 … … 139 139 Level.Background.Height = Level.Height; 140 140 Quickbinds(); 141 141 142 } 142 143 … … 174 175 ruudut.SetTileMethod(new Color(255, 255, 255), Wildu); 175 176 ruudut.SetTileMethod(new Color(255, 200, 255), Wildu_top); 177 ruudut.SetTileMethod(new Color(255, 8, 8), World4); 178 ruudut.SetTileMethod(new Color(69, 100, 100), World3_Left); 179 ruudut.SetTileMethod(new Color(69, 69, 100), World2_Left); 180 ruudut.SetTileMethod(new Color(69, 69, 69), World5); 181 ruudut.SetTileMethod(new Color(6, 6, 6), World666); 176 182 177 183 //3. Execute luo kentän 178 184 // Parametreina leveys ja korkeus 179 185 ruudut.Execute(20, 20); 186 if (level == 666) Camera.ZoomToLevel(); 180 187 } 181 188 … … 268 275 AddCollisionHandler(player, "wildu_top", Osuuwildu_top); 269 276 AddCollisionHandler(player, "boss", Osuuboss); 277 AddCollisionHandler(player, "world3_Left", Osuuworld3_Left); 278 AddCollisionHandler(player, "world5", Osuuworld5); 279 AddCollisionHandler(player, "world4", Osuuworld4); 280 AddCollisionHandler(player, "world2_Left", Osuuworld2_Left); 281 AddCollisionHandler(player, "world666", Osuuworld666); 270 282 271 283 } … … 296 308 World(1); 297 309 potions.Value -= 3; 298 mana.Value -= 10 0;310 mana.Value -= 10; 299 311 300 312 if (mana.Value <= 0) … … 357 369 Add(taso); 358 370 } 371 void World666(Vector paikka, double leveys, double korkeus) 372 { 373 PhysicsObject taso = PhysicsObject.CreateStaticObject(leveys, korkeus); 374 taso.Position = paikka; 375 taso.Color = new Color (0, 0, 0, 0); 376 taso.Tag = "world666"; 377 //taso.Image = groundImage; 378 //taso.CollisionIgnoreGroup = 1; 379 Add(taso); 380 } 359 381 void Gohome(Vector paikka, double leveys, double korkeus) 360 382 { … … 377 399 Add(taso); 378 400 } 401 void World4(Vector paikka, double leveys, double korkeus) 402 { 403 PhysicsObject taso = PhysicsObject.CreateStaticObject(leveys, korkeus); 404 taso.Position = paikka; 405 taso.Color = Color.Red; 406 taso.Tag = "world4"; 407 //taso.Image = groundImage; 408 //taso.CollisionIgnoreGroup = 1; 409 Add(taso); 410 } 411 void World3_Left(Vector paikka, double leveys, double korkeus) 412 { 413 PhysicsObject taso = PhysicsObject.CreateStaticObject(leveys, korkeus); 414 taso.Position = paikka; 415 taso.Color = Color.Brown; 416 taso.Tag = "world3_Left"; 417 //taso.Image = groundImage; 418 //taso.CollisionIgnoreGroup = 1; 419 Add(taso); 420 } 421 void World2_Left(Vector paikka, double leveys, double korkeus) 422 { 423 PhysicsObject taso = PhysicsObject.CreateStaticObject(leveys, korkeus); 424 taso.Position = paikka; 425 taso.Color = Color.Brown; 426 taso.Tag = "world2_Left"; 427 //taso.Image = groundImage; 428 //taso.CollisionIgnoreGroup = 1; 429 Add(taso); 430 } 431 void World5(Vector paikka, double leveys, double korkeus) 432 { 433 PhysicsObject taso = PhysicsObject.CreateStaticObject(leveys, korkeus); 434 taso.Position = paikka; 435 taso.Color = Color.Brown; 436 taso.Tag = "world5"; 437 //taso.Image = groundImage; 438 //taso.CollisionIgnoreGroup = 1; 439 Add(taso); 440 } 441 379 442 380 443 void Seina(Vector paikka, double leveys, double korkeus) … … 462 525 Add(taso); 463 526 } 527 464 528 465 529 void OsuuPankkiin(PhysicsObject player, PhysicsObject pankki) … … 594 658 int.TryParse(w.InputBox.Text, out maara); 595 659 596 if (maara <= 0 || maara > storagepotions.Value)660 if (maara <= 0 || maara > potions.Value) 597 661 { 598 662 MessageDisplay.Add("Invalid amount of potions"); … … 615 679 int.TryParse(w.InputBox.Text, out maara); 616 680 617 if (maara <= 0 || maara > storagepotions.Value)681 if (maara <= 0 || maara > mana.Value) 618 682 { 619 683 MessageDisplay.Add("Invalid amount of mana crystals"); … … 642 706 else 643 707 { 708 storagepotions.Value -= maara; 709 potions.Value += maara; 710 } 711 }; 712 Add(kysymysIkkuna); 713 } 714 715 void Withdrawmana() 716 { 717 InputWindow kysymysIkkuna = new InputWindow("How many mana crystals do you want to withdraw?"); 718 kysymysIkkuna.TextEntered += delegate(InputWindow w) 719 { 720 int maara; 721 int.TryParse(w.InputBox.Text, out maara); 722 723 if (maara <= 0 || maara > storagemana.Value) 724 { 725 MessageDisplay.Add("Invalid amount of mana crystals"); 726 } 727 else 728 { 644 729 storagemana.Value -= maara; 645 730 mana.Value += maara; … … 649 734 } 650 735 651 void Withdrawmana()652 {653 InputWindow kysymysIkkuna = new InputWindow("How many mana crystals do you want to withdraw?");654 kysymysIkkuna.TextEntered += delegate(InputWindow w)655 {656 int maara;657 int.TryParse(w.InputBox.Text, out maara);658 659 if (maara <= 0 || maara > storagepotions.Value)660 {661 MessageDisplay.Add("Invalid amount of mana crystals");662 }663 else664 {665 storagemana.Value -= maara;666 mana.Value += maara;667 }668 };669 Add(kysymysIkkuna);670 }671 672 736 void OsuuBSmith(PhysicsObject player, PhysicsObject bsmith) 673 737 { 674 MultiSelectWindow alkuValikko = new MultiSelectWindow("BlackSmith", "Buy", " Sell", "Exit");738 MultiSelectWindow alkuValikko = new MultiSelectWindow("BlackSmith", "Buy", "Exit"); 675 739 alkuValikko.AddItemHandler(0, OstaBSmith); 676 740 //alkuValikko.AddItemHandler(1, myybsmith); … … 680 744 void OstaBSmith() 681 745 { 682 MultiSelectWindow alkuValikko = new MultiSelectWindow("Buy", "Damage +1: "+100*vahinko.Value + "$", "Hitpoints +1: 50$", "Exit");746 MultiSelectWindow alkuValikko = new MultiSelectWindow("Buy", "Damage +1: "+100*vahinko.Value + "$", "Hitpoints +1: "+10*elamaLaskuri.MaxValue + "$", "Exit"); 683 747 alkuValikko.AddItemHandler(0, Ostadmg); 684 748 alkuValikko.AddItemHandler(1, Ostahp); … … 726 790 void Osuupotion(PhysicsObject player, PhysicsObject potion) 727 791 { 728 MultiSelectWindow alkuValikko = new MultiSelectWindow("Potions", "Buy", " Sell", "Exit");792 MultiSelectWindow alkuValikko = new MultiSelectWindow("Potions", "Buy", "Exit"); 729 793 alkuValikko.AddItemHandler(0, Ostapotionshop); 730 794 player.Position = potion.Position + new Vector(0, 100); … … 801 865 World(2); 802 866 } 867 803 868 void Osuuwildu_top(PhysicsObject player, PhysicsObject wildu_top) 804 869 { … … 810 875 pelaajanPaikka = new Vector(player.X, Level.Top - 50); 811 876 World(1); 877 } 878 void Osuuworld666(PhysicsObject player, PhysicsObject world666) 879 { 880 pelaajanPaikka = new Vector(0, 0); 881 World(666); 882 } 883 void Osuuworld5(PhysicsObject player, PhysicsObject world5) 884 { 885 pelaajanPaikka = new Vector(Level.Right - 50, player.Y); 886 World(5); 887 } 888 889 void Osuuworld2_Left(PhysicsObject player, PhysicsObject world2_left) 890 { 891 pelaajanPaikka = new Vector(Level.Left + 50, player.Y); 892 World(2); 893 } 894 void Osuuworld4(PhysicsObject player, PhysicsObject world4) 895 { 896 pelaajanPaikka = new Vector(Level.Right - 50, player.Y); 897 World(4); 898 } 899 void Osuuworld3_Left(PhysicsObject player, PhysicsObject world3_left) 900 { 901 pelaajanPaikka = new Vector(Level.Left + 50, player.Y); 902 World(3); 812 903 } 813 904 void Osuuworld3_rand(PhysicsObject player, PhysicsObject world3_rand) … … 836 927 void Osuuboss(PhysicsObject player, PhysicsObject boss) 837 928 { 838 elamaLaskuri.Value -= 5;929 elamaLaskuri.Value -= 3; 839 930 (boss as Vihu).ElamaLaskuri.Value -= vahinko.Value; 840 931 } -
2014/23/AaronA/RogueRPG/RogueRPG/RogueRPGContent/RogueRPGContent.contentproj
r4880 r4902 150 150 </Compile> 151 151 </ItemGroup> 152 <ItemGroup> 153 <Compile Include="world4.png"> 154 <Name>world4</Name> 155 <Importer>TextureImporter</Importer> 156 <Processor>TextureProcessor</Processor> 157 </Compile> 158 </ItemGroup> 159 <ItemGroup> 160 <Compile Include="world4_kohteet.png"> 161 <Name>world4_kohteet</Name> 162 <Importer>TextureImporter</Importer> 163 <Processor>TextureProcessor</Processor> 164 </Compile> 165 </ItemGroup> 166 <ItemGroup> 167 <Compile Include="world5.png"> 168 <Name>world5</Name> 169 <Importer>TextureImporter</Importer> 170 <Processor>TextureProcessor</Processor> 171 </Compile> 172 <Compile Include="world5_kohteet.png"> 173 <Name>world5_kohteet</Name> 174 <Importer>TextureImporter</Importer> 175 <Processor>TextureProcessor</Processor> 176 </Compile> 177 </ItemGroup> 178 <ItemGroup> 179 <Compile Include="world666.jpg"> 180 <Name>world666</Name> 181 <Importer>TextureImporter</Importer> 182 <Processor>TextureProcessor</Processor> 183 </Compile> 184 </ItemGroup> 185 <ItemGroup> 186 <Compile Include="world666_kohteet.png"> 187 <Name>world666_kohteet</Name> 188 <Importer>TextureImporter</Importer> 189 <Processor>TextureProcessor</Processor> 190 </Compile> 191 </ItemGroup> 152 192 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 153 193 <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Note: See TracChangeset
for help on using the changeset viewer.