- Timestamp:
- 2016-06-16 13:46:13 (7 years ago)
- Location:
- 2016/24/JimiR
- Files:
-
- 82 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
2016/24/JimiR/MultiFuse/MultiFuse/MultiFuse/MultiFuse.cs
r7324 r7372 18 18 19 19 DoubleMeter nopeus = new DoubleMeter(100, 100, 200); 20 IntMeter rahaMittari = new IntMeter(0); 20 21 21 22 … … 25 26 PhysicsObject pelaaja; 26 27 PhysicsObject teleporter; 28 PhysicsObject questguy; 27 29 28 30 … … 39 41 Image healthinKuva = LoadImage("sydän"); 40 42 Image paperinKuva = LoadImage("paper"); 43 Image rahanKuva = LoadImage("rahea"); 41 44 Image marketinKuva = LoadImage("lattia"); 42 45 Image dungeoninlattia = LoadImage("dungeonladdi"); … … 64 67 level.Execute(50, 50); 65 68 IsMouseVisible = false; 66 IsFullScreen = true;69 IsFullScreen = false; 67 70 LuoCursor(); 68 71 } … … 103 106 pelaaja.AngularDamping = 0.95; 104 107 pelaaja.LinearDamping = 0.7; 108 pelaaja.Tag = "pelaaja"; 105 109 pelaaja.Animation = new Animation(pelaajaWalk); 106 110 Add(pelaaja); … … 109 113 110 114 111 PushButton juoksupainike = new PushButton(" EsJuoksu");115 PushButton juoksupainike = new PushButton("Run"); 112 116 Add(juoksupainike); 113 117 juoksupainike.Clicked += Juoksee; … … 121 125 Add(elamaPalkki); 122 126 127 healthlvl.LowerLimit += PelaajaKuolee; 128 123 129 LuoPaper(); 130 131 LuoSkill(rahanKuva, rahaMittari, new Vector(Screen.Right - 200, Screen.Bottom + 650)); 124 132 125 133 LuoSkill(miekanKuva, attacklvl, new Vector(Screen.Right - 200, Screen.Bottom + 750)); … … 131 139 tuliskilll.Position = new Vector(Screen.Right - 200, Screen.Bottom + 600); 132 140 Add(tuliskilll); 141 142 133 143 ProgressBar tulipalkki = new ProgressBar(100, 20); 134 144 tulipalkki.X = Screen.Right - 120; … … 162 172 AddCollisionHandler(pelaaja, "teleporter", LuoTeleporttausvalikko); 163 173 } 174 void PelaajaKuolee() 175 { 176 ClearAll(); 177 LuoAlkuValikko(); 178 179 } 164 180 void Juoksee() 165 181 { … … 227 243 //cursor.Position = Mouse.PositionOnScreen; 228 244 Mouse.ListenMovement(0.1, KuunteleLiiketta, null); 229 Add(cursor );230 } 231 232 Label LuoSkill(Image kuva, DoubleMeter mittari, Vector Position)245 Add(cursor, 2); 246 } 247 248 Label LuoSkill(Image kuva, Meter mittari, Vector Position) 233 249 { 234 250 Label label = new Label(); … … 294 310 marketplace.SetTileMethod('T', LuoTeleporter); 295 311 marketplace.SetTileMethod('K', LuoKauppias); 312 marketplace.SetTileMethod('Q', LuoQuestGuy); 296 313 marketplace.Execute(50, 50); 297 314 IsMouseVisible = false; … … 317 334 { 318 335 MultiSelectWindow kauppavalikko = new MultiSelectWindow("S Market", 319 " Food", "arrow", "exit");336 "Attacklevel - 10", "healthlevel - 10", "exit"); 320 337 Add(kauppavalikko); 338 339 kauppavalikko.AddItemHandler(0, ostaaattacklevun); 340 kauppavalikko.AddItemHandler(1, ostaahealthlevun); 341 kauppavalikko.AddItemHandler(2, Exit); 342 } 343 344 void ostaaattacklevun() 345 { 346 rahaMittari.Value -= 10; 347 attacklvl.Value += 10; 348 } 349 350 void ostaahealthlevun() 351 { 352 rahaMittari.Value -= 10; 353 healthlvl.Value += 10; 321 354 } 322 355 … … 334 367 { 335 368 MultiSelectWindow teleportaatioValikko = new MultiSelectWindow("Where would you like to go?", 336 "Dungeons", "Bosses", "TutorialPlace" );369 "Dungeons", "Bosses", "TutorialPlace", "MarketPlace"); 337 370 Add(teleportaatioValikko); 338 371 … … 340 373 teleportaatioValikko.AddItemHandler(1, Bosses); 341 374 teleportaatioValikko.AddItemHandler(2, TutorialPlace); 375 teleportaatioValikko.AddItemHandler(3, MarketPlace); 342 376 } 343 377 … … 379 413 dungeon1.SetTileMethod('T', LuoTeleporter); 380 414 dungeon1.SetTileMethod('K', LuoKauppias); 415 Level.Background.Image = dungeoninlattia; 416 Level.Background.TileToLevel(); 381 417 dungeon1.Execute(50, 50); 382 418 IsMouseVisible = false; … … 390 426 { 391 427 ClearAll(); 392 TileMap dungeon2 = TileMap.FromLevelAsset(" marketplace");428 TileMap dungeon2 = TileMap.FromLevelAsset("dungeon2"); 393 429 dungeon2.SetTileMethod('#', LuoPalikka); 394 430 dungeon2.SetTileMethod('P', LuoPelaaja); … … 396 432 dungeon2.SetTileMethod('T', LuoTeleporter); 397 433 dungeon2.SetTileMethod('K', LuoKauppias); 434 dungeon2.SetTileMethod('G', LuoGiant); 435 Level.Background.Image = dungeoninlattia; 436 Level.Background.TileToLevel(); 398 437 dungeon2.Execute(50, 50); 399 438 IsMouseVisible = false; … … 413 452 dungeon3.SetTileMethod('T', LuoTeleporter); 414 453 dungeon3.SetTileMethod('K', LuoKauppias); 454 Level.Background.Image = dungeoninlattia; 455 Level.Background.TileToLevel(); 415 456 dungeon3.Execute(50, 50); 416 457 IsMouseVisible = false; … … 490 531 if (Vector.Distance(skeleton.Position, pelaaja.Position) < 70) 491 532 { 492 LyoPelaajaa( );533 LyoPelaajaa(1); 493 534 } 494 535 }; … … 513 554 514 555 //void LyoPelaajaa(PhysicsObject tormaaja, PhysicsObject kohde) 515 void LyoPelaajaa( )516 { 517 healthlvl.Value -= 1;556 void LyoPelaajaa(int damage) 557 { 558 healthlvl.Value -= damage; 518 559 519 560 healthlvl.MaxValue += 1; … … 556 597 vihu.ElamaLaskuri.Value -= (int)attacklvl.Value; 557 598 attacklvl.Value += 1; 599 rahaMittari.Value += 10; 558 600 } 559 601 … … 575 617 576 618 AddCollisionHandler(destroyer, pelaaja, Destroyertekeedamagia); 619 577 620 578 621 RandomMoverBrain satunnaisAivotboss = new RandomMoverBrain(200); … … 603 646 void LuoPaper() 604 647 { 605 GameObject paperi = new GameObject(245,400);606 paperi.Position = new Vector(Screen.Right - 33 5, Screen.Bottom + 680);648 Label paperi = new Label(245,400); 649 paperi.Position = new Vector(Screen.Right - 330, Screen.Bottom + 680); 607 650 paperi.Image = paperinKuva; 608 Add(paperi); 651 Add(paperi, 0); 652 } 653 654 void LuoQuestGuy(Vector paikka, double leveys, double korkeus) 655 { 656 questguy = new PhysicsObject(50,75); 657 questguy.Position = paikka; 658 Add(questguy); 659 660 //Tehdään uudet satunnaisaivot, jotka liikkuvat nopeudella 200 661 RandomMoverBrain satunnaisAivot = new RandomMoverBrain(25); 662 663 //Ominaisuuksien muokkaaminen 664 satunnaisAivot.ChangeMovementSeconds = 2; 665 666 //Aivot käyttöön oliolle 667 questguy.Brain = satunnaisAivot; 668 669 AddCollisionHandler(questguy, "pelaaja", QuestValikko); 670 } 671 672 void QuestValikko(PhysicsObject tormaaja, PhysicsObject kohde) 673 { 674 MultiSelectWindow QuestValikko = new MultiSelectWindow("Hello!", 675 "U got anything for me?"); 676 Add(QuestValikko); 677 QuestValikko.AddItemHandler(0, Quest1); 678 } 679 680 void Quest1() 681 { 682 MultiSelectWindow Quest1Valikko = new MultiSelectWindow("YES can you kill a monster for me?", 683 "YEYE"); 684 Add(Quest1Valikko); 685 Quest1Valikko.AddItemHandler(0, Quest2); 686 687 } 688 689 void Quest2() 690 { 691 LuoQuestBossiMappi(); 692 } 693 694 void LuoQuestBossiMappi() 695 { 696 697 } 698 699 void LuoGiant(Vector paikka, double leveys, double korkeus) 700 { 701 Vihu giant = new Vihu(80,80); 702 giant.ElamaLaskuri.MaxValue = 250; 703 giant.ElamaLaskuri.Value = 250; 704 giant.CanRotate = false; 705 giant.Position = paikka; 706 Add(giant); 707 708 ProgressBar elamaPalkki = new ProgressBar(75, 15); 709 //elamaPalkki.X = Screen.Right - 150; 710 elamaPalkki.Y = 50; 711 elamaPalkki.BindTo(giant.ElamaLaskuri); 712 giant.Add(elamaPalkki); 713 714 RandomMoverBrain satunnaisAivot = new RandomMoverBrain(50); 715 // satunnaisAivot.ChangeMovementSeconds = 3;//Ominaisuuksien muokkaaminen 716 717 //AddCollisionHandler(skeleton, pelaaja, LyoPelaajaa); 718 719 FollowerBrain seuraajanAivot = new FollowerBrain(pelaaja); 720 seuraajanAivot.Speed = 100; // Millä nopeudella kohdetta seurataan 721 seuraajanAivot.DistanceFar = 200; // Etäisyys jolla aletaan seurata kohdetta 722 seuraajanAivot.DistanceClose = 50; // Etäisyys jolloin ollaan lähellä kohdetta 723 seuraajanAivot.StopWhenTargetClose = false; // Pysähdytään kun ollaan lähellä kohdetta 724 seuraajanAivot.FarBrain = satunnaisAivot; // Käytetään satunnaisaivoja kun ollaan kaukana 725 726 AddCollisionHandler(giant, "ase", VihuOttaaDamagea); 727 AddCollisionHandler(giant, "ase1", VihuOttaaDamagea1); 728 giant.Brain = seuraajanAivot; 729 730 //seuraajanAivot.TargetClose += LyoPelaajaa; 731 732 Timer lyontiajastin = new Timer(); 733 lyontiajastin.Interval = 2.0; 734 lyontiajastin.Timeout += delegate 735 { 736 if (Vector.Distance(giant.Position, pelaaja.Position) < 70) 737 { 738 LyoPelaajaa(20); 739 } 740 }; 741 lyontiajastin.Start(); 742 giant.Destroyed += lyontiajastin.Stop; 743 609 744 } 610 745 } -
2016/24/JimiR/MultiFuse/MultiFuse/MultiFuse/MultiFuse.csproj.Debug.cachefile
r7324 r7372 35 35 Content\sydÀn.xnb 36 36 Content\miekka.xnb 37 Content\rahea.xnb 38 Content\dungeon2.xnb -
2016/24/JimiR/MultiFuse/MultiFuse/MultiFuse/obj/x86/Debug/ContentPipeline-{5D343048-8B72-4D84-BCD9-BE783E0016F2}.xml
r7324 r7372 54 54 <Options>None</Options> 55 55 <Output>C:\MyTemp\JimiR\MultiFuse\MultiFuse\MultiFuse\bin\x86\Debug\Content\marketplace.xnb</Output> 56 <Time>2016-06-1 3T14:52:22.7327272+03:00</Time>56 <Time>2016-06-16T10:27:33.3836469+03:00</Time> 57 57 </Item> 58 58 <Item> … … 325 325 <Output>C:\MyTemp\JimiR\MultiFuse\MultiFuse\MultiFuse\bin\x86\Debug\Content\miekka.xnb</Output> 326 326 <Time>2016-06-15T14:25:02.3734023+03:00</Time> 327 </Item> 328 <Item> 329 <Source>rahea.png</Source> 330 <Name>rahea</Name> 331 <Importer>TextureImporter</Importer> 332 <Processor>TextureProcessor</Processor> 333 <Options>None</Options> 334 <Output>C:\MyTemp\JimiR\MultiFuse\MultiFuse\MultiFuse\bin\x86\Debug\Content\rahea.xnb</Output> 335 <Time>2016-06-16T11:03:47.4721702+03:00</Time> 336 </Item> 337 <Item> 338 <Source>dungeon2.txt</Source> 339 <Name>dungeon2</Name> 340 <Importer>TextFileImporter</Importer> 341 <Processor>TextFileContentProcessor</Processor> 342 <Options>None</Options> 343 <Output>C:\MyTemp\JimiR\MultiFuse\MultiFuse\MultiFuse\bin\x86\Debug\Content\dungeon2.xnb</Output> 344 <Time>2016-06-16T12:36:15.1485859+03:00</Time> 327 345 </Item> 328 346 <BuildSuccessful>true</BuildSuccessful> -
2016/24/JimiR/MultiFuse/MultiFuse/MultiFuse/obj/x86/Debug/MultiFuse.csproj.FileListAbsolute.txt
r7324 r7372 71 71 C:\MyTemp\JimiR\MultiFuse\MultiFuse\MultiFuse\bin\x86\Debug\Content\sydÀn.xnb 72 72 C:\MyTemp\JimiR\MultiFuse\MultiFuse\MultiFuse\bin\x86\Debug\Content\miekka.xnb 73 C:\MyTemp\JimiR\MultiFuse\MultiFuse\MultiFuse\bin\x86\Debug\Content\rahea.xnb 74 C:\MyTemp\JimiR\MultiFuse\MultiFuse\MultiFuse\bin\x86\Debug\Content\dungeon2.xnb -
2016/24/JimiR/MultiFuse/MultiFuse/MultiFuse/obj/x86/Debug/cachefile-{5D343048-8B72-4D84-BCD9-BE783E0016F2}-targetpath.txt
r7324 r7372 35 35 Content\sydÀn.xnb 36 36 Content\miekka.xnb 37 Content\rahea.xnb 38 Content\dungeon2.xnb -
2016/24/JimiR/MultiFuse/MultiFuse/MultiFuseContent/MultiFuseContent.contentproj
r7324 r7372 265 265 </Compile> 266 266 </ItemGroup> 267 <ItemGroup> 268 <Compile Include="rahea.png"> 269 <Name>rahea</Name> 270 <Importer>TextureImporter</Importer> 271 <Processor>TextureProcessor</Processor> 272 </Compile> 273 </ItemGroup> 274 <ItemGroup> 275 <Compile Include="dungeon2.txt"> 276 <Name>dungeon2</Name> 277 <Importer>TextFileImporter</Importer> 278 <Processor>TextFileContentProcessor</Processor> 279 </Compile> 280 </ItemGroup> 267 281 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 268 282 <!-- To modify your build process, add your task inside one of the targets below and uncomment it. -
2016/24/JimiR/MultiFuse/MultiFuse/MultiFuseContent/marketplace.txt
r7256 r7372 8 8 # # 9 9 # # 10 # 10 # Q P # 11 11 # # 12 12 # #
Note: See TracChangeset
for help on using the changeset viewer.