- Timestamp:
- 2015-06-25 17:39:54 (6 years ago)
- Location:
- 2015/26/ohjaajat/HillbillyRun/HillbillyRun/HillbillyRun
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
2015/26/ohjaajat/HillbillyRun/HillbillyRun/HillbillyRun/HillbillyRun/HillbillyRun.cs
r6384 r6385 433 433 level.SetTileMethod(Color.Gold, CreatePlayer); 434 434 level.SetTileMethod(Color.Harlequin, CreateCart); 435 level.SetTileMethod(Color.FromHexCode("A17FFF"), CreatePitchfork); 436 437 level.SetTileMethod(Color.Gray, (new AbstractTileMap<Color>.TileMethod[] { CreateCrawly, CreateWorm })[levelNumber]); // ಠ_ಠ 438 level.SetTileMethod(Color.Red, (new AbstractTileMap<Color>.TileMethod[] { CreateFireMage, CreateShroom })[levelNumber]); 435 439 level.SetTileMethod(Color.White, CreateBlockObject); 436 //level.SetTileMethod(Color.DarkGray, (new AbstractTileMap<Color>.TileMethod[] { CreateMilk, CreatePitchfork })[levelNumber]); // Vain jos jaksan vippastaa maitokannun pysymään mukana ClearAllin läpi hmm437 440 level.SetTileMethod(Color.DarkGray, CreateMilk); 438 level.SetTileMethod(Color.FromHexCode("A17FFF"), CreatePitchfork);439 440 level.SetTileMethod(Color.Gray, (new AbstractTileMap<Color>.TileMethod[] { CreateCrawly, CreateWorm })[levelNumber]); // ಠ_ಠ441 level.SetTileMethod(Color.Red, CreateFireMage);442 441 level.SetTileMethod(Color.Rose, CreateFlame, true); 443 442 //level.SetTileMethod(Color.Azure, CreateDummy, Color.Azure); //TODO: CreateSmoke … … 623 622 brain.Speed = 60; 624 623 brain.FallsOffPlatforms = false; 624 brain.TriesToJump = true; 625 625 worm.Brain = brain; 626 626 … … 672 672 RemoveCollisionHandlers(crawly); 673 673 }); 674 } 675 676 void CreateShroom(Vector position, double width, double height) 677 { 678 PlatformCharacter shroom = new PlatformCharacter(width, height * 2); 679 shroom.Position = position + new Vector(0, shroom.Height/ 2); 680 shroom.Tag = "burn"; 681 shroom.Tag += "shroom"; 682 //shroom.AnimWalk = new Animation(); 683 shroom.CollisionIgnoreGroup = 3; 684 Add(shroom, 1); 685 //bool immune = false; 686 687 PlatformWandererBrain brain = new PlatformWandererBrain(); 688 brain.Speed = 20; 689 brain.FallsOffPlatforms = false; 690 shroom.Brain = brain; 691 692 FollowerBrain attackBrain = new FollowerBrain("player"); 693 attackBrain.DistanceFar = Window.Width / 2.5; 694 attackBrain.DistanceClose = Window.Width / 2; 695 attackBrain.StopWhenTargetClose = false; 696 attackBrain.Speed = brain.Speed * 6; 697 attackBrain.FarBrain = brain; 698 shroom.Brain = attackBrain; 699 700 int matoja = RandomGen.NextInt(1, 3); 701 int rahkeet = 10; 702 703 //// Taiotaan matoja 704 var castTimer = new Timer { Interval = 6.0 }; 705 castTimer.Timeout += delegate 706 { 707 //shroom.PlayAnimation(); 708 709 Timer.SingleShot(RandomGen.NextDouble(3, 5), delegate { shroom.Brain = attackBrain; }); 710 711 Timer.SingleShot(1.5, 712 delegate 713 { 714 for (int i = 0; i < matoja; i++) 715 { 716 CreateWorm(shroom.Position + RandomGen.NextVector(- 200, 0, 200, 0), TILE_SIZE, TILE_SIZE); 717 shroom.Brain = brain; 718 } 719 }); 720 721 722 }; 723 724 attackBrain.TargetClose += delegate() 725 { 726 if (!castTimer.Enabled) 727 { 728 castTimer.Start(); 729 } 730 }; 731 732 AddCollisionHandler(shroom, "pitchfork", delegate(PhysicsObject s, PhysicsObject f) 733 { 734 matoja += RandomGen.NextInt(1, 5); 735 rahkeet--; 736 if(rahkeet<1) 737 { 738 shroom.Destroy(); 739 castTimer.Stop(); 740 } 741 }); 742 743 674 744 } 675 745 … … 865 935 players.Remove(player); 866 936 867 //if (player.Improvement != null) 868 //{ 869 GetRidOfImprovement(player); 870 //Improvement parannus = player.Improvement; 871 //parannus.Position = player.Position; 872 //parannus.IsVisible = true; 873 //parannus.IgnoresCollisionResponse = false; 874 //parannus.Tag = "improvement"; 875 //} 937 GetRidOfImprovement(player); 876 938 877 939 player.Destroy(); … … 882 944 883 945 AddCollisionHandler(player, "improvement", CollectImprovement); 884 // AddCollisionHandler(player, "improvement", CollectImprovement);885 946 } 886 947 … … 960 1021 public void CreateMilkParticles(HillBilly billy, int size, int xBase, int yBase, Vector position, String tag) 961 1022 { 962 //splash.Play();963 1023 for (int i = 0; i < 10; i++) 964 1024 { … … 989 1049 } 990 1050 991 //private void UseImprovement(HillBilly player)992 //{993 // if (player.Improvement == null)994 // {995 // CreateMilkParticles(player, 5, 100, 100, new Vector(0, player.Height/3), "tears");996 // return;997 // }998 // player.UseImprovement(player.Improvement);999 //}1000 1001 1051 void Loss() 1002 1052 { … … 1021 1071 //billy.AnimWalk = new Animation(milkWalk); 1022 1072 //billy.AnimIdle = new Animation(milkWalk.CurrentFrame); 1023 }1024 1025 #region Camera1026 void UpdateCamera()1027 {1028 double minY = players.Min(p => p.Y);1029 double maxY = players.Max(p => p.Y);1030 double minX = players.Min(p => p.X) + cameraOffset;1031 1032 Vector minPosition = new Vector(Math.Max(minX, cameraTargetX), minY);1033 Vector maxPosition = new Vector(minX, maxY);1034 1035 cameraTarget = (minPosition + maxPosition) * 0.5;1036 cameraTarget.X = Math.Max(cameraTargetX, minX); //Lellllll.1037 1038 //cameraTarget.Y = Math.Max(cameraTarget.X, Level.Bottom + Window.Height/2.0);1039 1040 cameraTargetX = Math.Max(cameraTargetX, minX);1041 1042 cameraTarget.X = Math.Min(cameraTargetX, rightCamLimit);1043 cameraTarget.Y = Math.Max(cameraTarget.Y, bottomCamLimit);1044 1045 double windowMax = Camera.ScreenToWorld(new Vector(Window.Width / 2.0, 0)).X;1046 double windowMin = Camera.ScreenToWorld(new Vector(-Window.Width / 2.0, 0)).X;1047 foreach (var player in players)1048 {1049 player.Left = Math.Max(player.Left, windowMin);1050 player.Right = Math.Min(player.Right, windowMax);1051 }1052 1073 } 1053 1074 … … 1066 1087 Owner.PlayAnimation(Owner.Improvement.Animations[1], evilClone.Destroy); 1067 1088 } 1089 1090 #region Camera 1091 void UpdateCamera() 1092 { 1093 double minY = players.Min(p => p.Y); 1094 double maxY = players.Max(p => p.Y); 1095 double minX = players.Min(p => p.X) + cameraOffset; 1096 1097 Vector minPosition = new Vector(Math.Max(minX, cameraTargetX), minY); 1098 Vector maxPosition = new Vector(minX, maxY); 1099 1100 cameraTarget = (minPosition + maxPosition) * 0.5; 1101 cameraTarget.X = Math.Max(cameraTargetX, minX); //Lellllll. 1102 1103 //cameraTarget.Y = Math.Max(cameraTarget.X, Level.Bottom + Window.Height/2.0); 1104 1105 cameraTargetX = Math.Max(cameraTargetX, minX); 1106 1107 cameraTarget.X = Math.Min(cameraTargetX, rightCamLimit); 1108 cameraTarget.Y = Math.Max(cameraTarget.Y, bottomCamLimit); 1109 1110 double windowMax = Camera.ScreenToWorld(new Vector(Window.Width / 2.0, 0)).X; 1111 double windowMin = Camera.ScreenToWorld(new Vector(-Window.Width / 2.0, 0)).X; 1112 foreach (var player in players) 1113 { 1114 player.Left = Math.Max(player.Left, windowMin); 1115 player.Right = Math.Min(player.Right, windowMax); 1116 } 1117 } 1068 1118 1069 1119 -
2015/26/ohjaajat/HillbillyRun/HillbillyRun/HillbillyRun/HillbillyRun/HillbillyRun.csproj
r6147 r6385 18 18 <XnaOutputType>Game</XnaOutputType> 19 19 <ApplicationIcon>Game.ico</ApplicationIcon> 20 <Thumbnail>GameThumbnail.png</Thumbnail> 20 <Thumbnail> 21 </Thumbnail> 21 22 <PublishUrl>publish\</PublishUrl> 22 23 <Install>true</Install> … … 117 118 <ItemGroup> 118 119 <Content Include="Game.ico" /> 119 <Content Include="GameThumbnail.png" />120 120 </ItemGroup> 121 121 <ItemGroup> -
2015/26/ohjaajat/HillbillyRun/HillbillyRun/HillbillyRun/HillbillyRunContent/HillbillyRunContent.contentproj
r6384 r6385 323 323 </Compile> 324 324 </ItemGroup> 325 <ItemGroup> 326 <Compile Include="GameThumbnail.png"> 327 <Name>GameThumbnail</Name> 328 <Importer>TextureImporter</Importer> 329 <Processor>TextureProcessor</Processor> 330 </Compile> 331 </ItemGroup> 325 332 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 326 333 <!-- 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.