- Timestamp:
- 2016-07-08 12:15:37 (7 years ago)
- Location:
- 2015/koodauskerho/AakeR/IMBT
- Files:
-
- 4 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
2015/koodauskerho/AakeR/IMBT/IMBT/IMBT/IMBT.cs
r7972 r8048 23 23 this.Tag = "pelaaja"; 24 24 25 26 ((IMBT)Game.Instance).AddCollisionHandler(this, "perusAmmus", delegate (PhysicsObject a, PhysicsObject b) 27 { 28 this.healthit.Value -= 3.5 * vahinkoKerroin; 29 kontrolleri.Vibrate(0.5, 0.5, 10, 10, 0.1); 30 }); 31 ((IMBT)Game.Instance).AddCollisionHandler(this, "raketti", delegate (PhysicsObject a, PhysicsObject b) 32 { 33 this.healthit.Value -= 12 * vahinkoKerroin; 34 kontrolleri.Vibrate(0.5, 0.5, 10, 10, 0.1); 35 }); 36 ((IMBT)Game.Instance).AddCollisionHandler(this, "pallo", delegate (PhysicsObject a, PhysicsObject b) 37 { 38 this.healthit.Value -= 18 * vahinkoKerroin; 39 kontrolleri.Vibrate(0.5, 0.5, 10, 10, 0.1); 40 }); 41 ((IMBT)Game.Instance).AddCollisionHandler(this, "rajahdys", delegate (PhysicsObject a, PhysicsObject b) 42 { 43 this.healthit.Value -= 1000 * vahinkoKerroin; 44 }); 45 ((IMBT)Game.Instance).AddCollisionHandler(this, "laser", delegate (PhysicsObject a, PhysicsObject b) 46 { 47 this.healthit.Value -= 1.3 * vahinkoKerroin; 48 kontrolleri.Vibrate(0.5, 0.5, 10, 10, 0.1); 49 }); 50 ((IMBT)Game.Instance).AddCollisionHandler(this, "haulikko", delegate (PhysicsObject a, PhysicsObject b) 51 { 52 this.healthit.Value -= 3.5 * vahinkoKerroin; 53 kontrolleri.Vibrate(0.5, 0.5, 10, 10, 0.1); 54 }); 55 ((IMBT)Game.Instance).AddCollisionHandler(this, "superSniperAmmus", delegate (PhysicsObject a, PhysicsObject b) 56 { 57 this.healthit.Value -= 12.5 * vahinkoKerroin; 58 kontrolleri.Vibrate(0.5, 0.5, 10, 10, 0.1); 59 }); 25 60 26 61 this.healthit = new DoubleMeter(100, 0, 100); … … 43 78 : base(leveys, korkeus, valinta, pelaajanKuva) 44 79 { 45 this.LinearDamping = 0.65; 46 Nopeus = 9000; 47 healthit.MaxValue = 200; 48 healthit.Value = 200; 80 this.LinearDamping = 0.85; 81 Nopeus = 4000; 49 82 } 50 83 } … … 75 108 rajahdys.ShockwaveReachesObject += delegate (IPhysicsObject pelaajaJohonPaineaaltoOsui, Vector voima) 76 109 { 77 if (pelaajaJohonPaineaaltoOsui.Tag.Equals("pelaaja") )110 if (pelaajaJohonPaineaaltoOsui.Tag.Equals("pelaaja") && pelaajaJohonPaineaaltoOsui is Tankkipelaaja) 78 111 { 79 112 (pelaajaJohonPaineaaltoOsui as Pelaaja).healthit.Value -= 1000; 80 113 81 114 } 82 83 84 85 rajahdys.Image = rajahdysKuva;86 rajahdys.Tag = "rajahdys";87 rajahdys.Position = this.Position;88 ((IMBT)Game.Instance).Add(rajahdys);89 90 this.Ase.Ammo.Value = 0;91 this.Ase.Destroy();92 this.Destroy();93 115 }; 94 }; 116 117 rajahdys.Image = rajahdysKuva; 118 rajahdys.Tag = "rajahdys"; 119 rajahdys.Position = this.Position; 120 ((IMBT)Game.Instance).Add(rajahdys); 121 122 this.Ase.Ammo.Value = 0; 123 this.Ase.Destroy(); 124 this.Destroy(); 125 }; 126 127 ((IMBT)Game.Instance).AddCollisionHandler(this, delegate (PhysicsObject a, PhysicsObject b) 128 { 129 SavuLiekki(); 130 }); 131 132 /* 95 133 ((IMBT)Game.Instance).AddCollisionHandler(this, "perusAmmus", delegate (PhysicsObject a, PhysicsObject b) 96 134 { … … 135 173 }); 136 174 175 */ 137 176 int[] tykkienKoot = { 30, 30, 30, 50 }; 138 139 177 this.Ase = new AssaultRifle(tykkienKoot[valinta], tykkienKoot[valinta]); 140 178 this.Ase.Image = tykkiTorninKuva; … … 344 382 SoundEffect valahdysAani = LoadSoundEffect("ValahdysAani"); 345 383 SoundEffect superSniperAani = LoadSoundEffect("superSniperAmmusAani"); 384 SoundEffect lyontiAani = LoadSoundEffect("MonsterLyontiAani"); 385 SoundEffect monsterAani = LoadSoundEffect("MonsterErikoisKykyAani"); 346 386 Pelaaja pelaaja1; 347 387 MultiSelectWindow alkuValikko; … … 386 426 void LuoKentta() 387 427 { 388 MediaPlayer.Stop();428 /*MediaPlayer.Stop(); 389 429 alkuValikko.Destroy(); 390 /*switch (RandomGen.NextInt(4))430 switch (RandomGen.NextInt(4)) 391 431 { 392 432 case 0: … … 505 545 ajastin.Start(); 506 546 507 double tahtainNopeus = 8;547 double tahtainNopeus = 10; 508 548 kontrollerit[pelaajanr - 1].Listen(Button.DPadRight, ButtonState.Down, OhjaaTahtain, "", pelaaja, new Vector(tahtainNopeus, 0)); 509 549 kontrollerit[pelaajanr - 1].Listen(Button.DPadLeft, ButtonState.Down, OhjaaTahtain, "", pelaaja, new Vector(-tahtainNopeus, 0)); … … 511 551 kontrollerit[pelaajanr - 1].Listen(Button.DPadDown, ButtonState.Down, OhjaaTahtain, "", pelaaja, new Vector(0, -tahtainNopeus)); 512 552 513 pelaaja.Nopeus = 1200;553 pelaaja.Nopeus = 900.0; 514 554 } 515 555 … … 517 557 { 518 558 pelaaja.Nopeus = 800.0; 559 } 560 if (valinta == 1) 561 { 562 pelaaja.Nopeus = 1300.0; 519 563 } 520 564 … … 747 791 raketinAani.Stop(); 748 792 }); 749 pelaaja.Ase.FireRate = 0. 45;793 pelaaja.Ase.FireRate = 0.33; 750 794 751 795 if (konenr == 1) 752 796 { 753 Pelaaja[] kohdePelaajat = new Tankkipelaaja[pelaajat.Count - 1];797 Pelaaja[] kohdePelaajat = new Pelaaja[pelaajat.Count - 1]; 754 798 for (int i = 0, j = 0; i < pelaajat.Count; i++) 755 799 { … … 822 866 Timer.SingleShot(0.01 * maara + 0.01, delegate 823 867 { 824 pelaaja.Ase.FireRate = 0. 4;868 pelaaja.Ase.FireRate = 0.33; 825 869 }); 826 870 } … … 842 886 843 887 pelaaja.tahtain.Image = tahtainKuva3; 844 Timer.SingleShot( 3.5, delegate // aika jonka jälkeen voi taas ampua888 Timer.SingleShot(4, delegate // aika jonka jälkeen voi taas ampua 845 889 { 846 890 tahtainAani2.Play(); … … 859 903 ammus.Size *= 5; 860 904 ammus.MaximumLifetime = new TimeSpan(0, 0, 4); 861 pelaaja.Ase.FireRate = 0. 75;905 pelaaja.Ase.FireRate = 0.33; 862 906 } 863 907 // Tähän tulee laser, ei pallo … … 936 980 } 937 981 pelaaja.voiLiikkua = true; 938 pelaaja.Ase.FireRate = 0.2 ;982 pelaaja.Ase.FireRate = 0.25; 939 983 }); 940 984 } … … 989 1033 if (olio.Tag.Equals("pelaaja")) 990 1034 { 991 ((Tankkipelaaja)olio).healthit.Value -= 4; 992 ((Tankkipelaaja)olio).SavuLiekki(); 1035 ((Pelaaja)olio).healthit.Value -= 4; 1036 if (olio is Tankkipelaaja) 1037 { 1038 ((Tankkipelaaja)olio).SavuLiekki(); 1039 } 993 1040 } 994 1041 } … … 1055 1102 pelaaja.erikoiskyky = false; 1056 1103 1057 Timer.SingleShot( 6.0, delegate1104 Timer.SingleShot(4.5, delegate 1058 1105 { 1059 1106 pelaaja.erikoiskyky = true; … … 1100 1147 shieldAani.Play(); 1101 1148 1102 Timer.SingleShot(1 .75, delegate1149 Timer.SingleShot(1, delegate 1103 1150 { 1104 1151 pelaaja.IgnoresExplosions = false; … … 1119 1166 pelaaja.Hit(pelaaja.Angle.GetVector() * nopeus); 1120 1167 boostiAani.Play(); 1121 Timer.SingleShot( 4.5, delegate1168 Timer.SingleShot(3, delegate 1122 1169 { 1123 1170 pelaaja.erikoiskyky = true; … … 1136 1183 Lyonti.Angle = pelaaja.Angle; 1137 1184 Lyonti.Image = RandomGen.SelectOne(lyontiKuva, lyontiKuvaKaannetty); 1185 lyontiAani.Play(); 1138 1186 Lyonti.Position = hit; 1139 1187 Lyonti.LifetimeLeft = TimeSpan.FromSeconds(0.2); … … 1148 1196 { 1149 1197 Pelaaja kohde = item as Pelaaja; 1150 kohde.healthit.Value -= 10;1151 1198 kohde.healthit.Value -= 8.5; 1199 kohde.kontrolleri.Vibrate(0.5, 0.5, 10, 10, 0.1); 1152 1200 } 1153 1201 } … … 1158 1206 { 1159 1207 pelaaja.IgnoresCollisionResponse = true; 1160 pelaaja.Nopeus = 20000; 1208 monsterAani.Play(); 1209 pelaaja.Nopeus = 9000; 1161 1210 pelaaja.voiTehdaErikoiskyvyn = false; 1162 Timer.SingleShot( 4.5, delegate1211 Timer.SingleShot(5.5, delegate 1163 1212 { 1164 1213 pelaaja.voiTehdaErikoiskyvyn = true; 1165 1214 }); 1166 Timer.SingleShot( 1.25, delegate1215 Timer.SingleShot(0.75, delegate 1167 1216 { 1168 1217 pelaaja.IgnoresCollisionResponse = false; 1169 pelaaja.Nopeus = 9000;1218 pelaaja.Nopeus = 4000; 1170 1219 }); 1171 1220 } -
2015/koodauskerho/AakeR/IMBT/IMBT/IMBT/IMBT.csproj.Debug.cachefile
r7972 r8048 114 114 Content\LyontiKuvaKaannetty.xnb 115 115 Content\MonsterJaljet.xnb 116 Content\MonsterLyontiAani.xnb 117 Content\MonsterErikoisKykyAani.xnb 116 118 Content\Music1.wma 117 119 Content\Music2.wma -
2015/koodauskerho/AakeR/IMBT/IMBT/IMBT/obj/x86/Debug/ContentPipeline-{B6A1F4C9-F2E2-4290-A5B5-3717058CC989}.xml
r7972 r8048 977 977 <Options>None</Options> 978 978 <Output>C:\MyTemp\AakeR\IMBT\IMBT\IMBT\bin\x86\Debug\Content\Pelaaja4MonsterKavelyAnimaatio3.xnb</Output> 979 <Time>2016-07-07T1 1:22:20.6344846+03:00</Time>979 <Time>2016-07-07T15:04:37.6696011+03:00</Time> 980 980 </Item> 981 981 <Item> … … 1041 1041 <Output>C:\MyTemp\AakeR\IMBT\IMBT\IMBT\bin\x86\Debug\Content\MonsterJaljet.xnb</Output> 1042 1042 <Time>2016-07-07T13:00:51.6483821+03:00</Time> 1043 </Item> 1044 <Item> 1045 <Source>MonsterLyontiAani.wav</Source> 1046 <Name>MonsterLyontiAani</Name> 1047 <Importer>WavImporter</Importer> 1048 <Processor>SoundEffectProcessor</Processor> 1049 <Options>None</Options> 1050 <Output>C:\MyTemp\AakeR\IMBT\IMBT\IMBT\bin\x86\Debug\Content\MonsterLyontiAani.xnb</Output> 1051 <Time>2016-07-08T10:21:20.5868106+03:00</Time> 1052 </Item> 1053 <Item> 1054 <Source>MonsterErikoisKykyAani.wav</Source> 1055 <Name>MonsterErikoisKykyAani</Name> 1056 <Importer>WavImporter</Importer> 1057 <Processor>SoundEffectProcessor</Processor> 1058 <Options>None</Options> 1059 <Output>C:\MyTemp\AakeR\IMBT\IMBT\IMBT\bin\x86\Debug\Content\MonsterErikoisKykyAani.xnb</Output> 1060 <Time>2016-07-08T10:43:54.7937729+03:00</Time> 1043 1061 </Item> 1044 1062 <BuildSuccessful>true</BuildSuccessful> -
2015/koodauskerho/AakeR/IMBT/IMBT/IMBT/obj/x86/Debug/IMBT.csproj.FileListAbsolute.txt
r7972 r8048 127 127 C:\MyTemp\AakeR\IMBT\IMBT\IMBT\bin\x86\Debug\Content\LyontiKuvaKaannetty.xnb 128 128 C:\MyTemp\AakeR\IMBT\IMBT\IMBT\bin\x86\Debug\Content\MonsterJaljet.xnb 129 C:\MyTemp\AakeR\IMBT\IMBT\IMBT\bin\x86\Debug\Content\MonsterLyontiAani.xnb 130 C:\MyTemp\AakeR\IMBT\IMBT\IMBT\bin\x86\Debug\Content\MonsterErikoisKykyAani.xnb -
2015/koodauskerho/AakeR/IMBT/IMBT/IMBT/obj/x86/Debug/cachefile-{B6A1F4C9-F2E2-4290-A5B5-3717058CC989}-targetpath.txt
r7972 r8048 119 119 Content\LyontiKuvaKaannetty.xnb 120 120 Content\MonsterJaljet.xnb 121 Content\MonsterLyontiAani.xnb 122 Content\MonsterErikoisKykyAani.xnb -
2015/koodauskerho/AakeR/IMBT/IMBT/IMBTContent/IMBTContent.contentproj
r7972 r8048 716 716 </Compile> 717 717 </ItemGroup> 718 <ItemGroup> 719 <Compile Include="MonsterLyontiAani.wav"> 720 <Name>MonsterLyontiAani</Name> 721 <Importer>WavImporter</Importer> 722 <Processor>SoundEffectProcessor</Processor> 723 </Compile> 724 </ItemGroup> 725 <ItemGroup> 726 <Compile Include="MonsterErikoisKykyAani.wav"> 727 <Name>MonsterErikoisKykyAani</Name> 728 <Importer>WavImporter</Importer> 729 <Processor>SoundEffectProcessor</Processor> 730 </Compile> 731 </ItemGroup> 718 732 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 719 733 <!-- 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.