Changeset 8048 for 2015


Ignore:
Timestamp:
2016-07-08 12:15:37 (7 years ago)
Author:
aaelruut
Message:
 
Location:
2015/koodauskerho/AakeR/IMBT
Files:
4 added
11 edited

Legend:

Unmodified
Added
Removed
  • 2015/koodauskerho/AakeR/IMBT/IMBT/IMBT/IMBT.cs

    r7972 r8048  
    2323        this.Tag = "pelaaja"; 
    2424 
     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        }); 
    2560 
    2661        this.healthit = new DoubleMeter(100, 0, 100); 
     
    4378        : base(leveys, korkeus, valinta, pelaajanKuva) 
    4479    { 
    45         this.LinearDamping = 0.65; 
    46         Nopeus = 9000; 
    47         healthit.MaxValue = 200; 
    48         healthit.Value = 200; 
     80        this.LinearDamping = 0.85; 
     81        Nopeus = 4000; 
    4982    } 
    5083} 
     
    75108            rajahdys.ShockwaveReachesObject += delegate (IPhysicsObject pelaajaJohonPaineaaltoOsui, Vector voima) 
    76109            { 
    77                 if (pelaajaJohonPaineaaltoOsui.Tag.Equals("pelaaja")) 
     110                if (pelaajaJohonPaineaaltoOsui.Tag.Equals("pelaaja") && pelaajaJohonPaineaaltoOsui is Tankkipelaaja) 
    78111                { 
    79112                    (pelaajaJohonPaineaaltoOsui as Pelaaja).healthit.Value -= 1000; 
    80113                     
    81114                } 
    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(); 
    93115            }; 
    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        /* 
    95133        ((IMBT)Game.Instance).AddCollisionHandler(this, "perusAmmus", delegate (PhysicsObject a, PhysicsObject b) 
    96134        { 
     
    135173        }); 
    136174 
     175        */ 
    137176        int[] tykkienKoot = { 30, 30, 30, 50 }; 
    138  
    139177        this.Ase = new AssaultRifle(tykkienKoot[valinta], tykkienKoot[valinta]); 
    140178        this.Ase.Image = tykkiTorninKuva; 
     
    344382    SoundEffect valahdysAani = LoadSoundEffect("ValahdysAani"); 
    345383    SoundEffect superSniperAani = LoadSoundEffect("superSniperAmmusAani"); 
     384    SoundEffect lyontiAani = LoadSoundEffect("MonsterLyontiAani"); 
     385    SoundEffect monsterAani = LoadSoundEffect("MonsterErikoisKykyAani"); 
    346386    Pelaaja pelaaja1; 
    347387    MultiSelectWindow alkuValikko; 
     
    386426    void LuoKentta() 
    387427    { 
    388         MediaPlayer.Stop(); 
     428        /*MediaPlayer.Stop(); 
    389429        alkuValikko.Destroy(); 
    390         /*switch (RandomGen.NextInt(4)) 
     430        switch (RandomGen.NextInt(4)) 
    391431        { 
    392432            case 0: 
     
    505545            ajastin.Start(); 
    506546 
    507             double tahtainNopeus = 8; 
     547            double tahtainNopeus = 10; 
    508548            kontrollerit[pelaajanr - 1].Listen(Button.DPadRight, ButtonState.Down, OhjaaTahtain, "", pelaaja, new Vector(tahtainNopeus, 0)); 
    509549            kontrollerit[pelaajanr - 1].Listen(Button.DPadLeft, ButtonState.Down, OhjaaTahtain, "", pelaaja, new Vector(-tahtainNopeus, 0)); 
     
    511551            kontrollerit[pelaajanr - 1].Listen(Button.DPadDown, ButtonState.Down, OhjaaTahtain, "", pelaaja, new Vector(0, -tahtainNopeus)); 
    512552 
    513             pelaaja.Nopeus = 1200; 
     553            pelaaja.Nopeus = 900.0; 
    514554        } 
    515555 
     
    517557        { 
    518558            pelaaja.Nopeus = 800.0; 
     559        } 
     560        if (valinta == 1) 
     561        { 
     562            pelaaja.Nopeus = 1300.0; 
    519563        } 
    520564 
     
    747791                                raketinAani.Stop(); 
    748792                            }); 
    749                             pelaaja.Ase.FireRate = 0.45; 
     793                            pelaaja.Ase.FireRate = 0.33; 
    750794 
    751795                            if (konenr == 1) 
    752796                            { 
    753                                 Pelaaja[] kohdePelaajat = new Tankkipelaaja[pelaajat.Count - 1]; 
     797                                Pelaaja[] kohdePelaajat = new Pelaaja[pelaajat.Count - 1]; 
    754798                                for (int i = 0, j = 0; i < pelaajat.Count; i++) 
    755799                                { 
     
    822866                            Timer.SingleShot(0.01 * maara + 0.01, delegate 
    823867                            { 
    824                                 pelaaja.Ase.FireRate = 0.4; 
     868                                pelaaja.Ase.FireRate = 0.33; 
    825869                            }); 
    826870                        } 
     
    842886 
    843887                                    pelaaja.tahtain.Image = tahtainKuva3; 
    844                                     Timer.SingleShot(3.5, delegate // aika jonka jälkeen voi taas ampua 
     888                                    Timer.SingleShot(4, delegate // aika jonka jälkeen voi taas ampua 
    845889                                    { 
    846890                                        tahtainAani2.Play(); 
     
    859903                            ammus.Size *= 5; 
    860904                            ammus.MaximumLifetime = new TimeSpan(0, 0, 4); 
    861                             pelaaja.Ase.FireRate = 0.75; 
     905                            pelaaja.Ase.FireRate = 0.33; 
    862906                        } 
    863907                        // Tähän tulee laser, ei pallo 
     
    936980                                } 
    937981                                pelaaja.voiLiikkua = true; 
    938                                 pelaaja.Ase.FireRate = 0.2; 
     982                                pelaaja.Ase.FireRate = 0.25; 
    939983                            }); 
    940984                        } 
     
    9891033        if (olio.Tag.Equals("pelaaja")) 
    9901034        { 
    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            } 
    9931040        } 
    9941041    } 
     
    10551102                pelaaja.erikoiskyky = false; 
    10561103 
    1057                 Timer.SingleShot(6.0, delegate 
     1104                Timer.SingleShot(4.5, delegate 
    10581105                { 
    10591106                    pelaaja.erikoiskyky = true; 
     
    11001147                shieldAani.Play(); 
    11011148 
    1102                 Timer.SingleShot(1.75, delegate 
     1149                Timer.SingleShot(1, delegate 
    11031150                { 
    11041151                    pelaaja.IgnoresExplosions = false; 
     
    11191166            pelaaja.Hit(pelaaja.Angle.GetVector() * nopeus); 
    11201167            boostiAani.Play(); 
    1121             Timer.SingleShot(4.5, delegate 
     1168            Timer.SingleShot(3, delegate 
    11221169            { 
    11231170                pelaaja.erikoiskyky = true; 
     
    11361183        Lyonti.Angle = pelaaja.Angle; 
    11371184        Lyonti.Image = RandomGen.SelectOne(lyontiKuva, lyontiKuvaKaannetty); 
     1185        lyontiAani.Play(); 
    11381186        Lyonti.Position = hit; 
    11391187        Lyonti.LifetimeLeft = TimeSpan.FromSeconds(0.2); 
     
    11481196        { 
    11491197            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); 
    11521200        } 
    11531201    } 
     
    11581206        { 
    11591207            pelaaja.IgnoresCollisionResponse = true; 
    1160             pelaaja.Nopeus = 20000; 
     1208            monsterAani.Play(); 
     1209            pelaaja.Nopeus = 9000; 
    11611210            pelaaja.voiTehdaErikoiskyvyn = false; 
    1162             Timer.SingleShot(4.5, delegate 
     1211            Timer.SingleShot(5.5, delegate 
    11631212            { 
    11641213                pelaaja.voiTehdaErikoiskyvyn = true; 
    11651214            }); 
    1166             Timer.SingleShot(1.25, delegate 
     1215            Timer.SingleShot(0.75, delegate 
    11671216            { 
    11681217                pelaaja.IgnoresCollisionResponse = false; 
    1169                 pelaaja.Nopeus = 9000; 
     1218                pelaaja.Nopeus = 4000; 
    11701219            }); 
    11711220        } 
  • 2015/koodauskerho/AakeR/IMBT/IMBT/IMBT/IMBT.csproj.Debug.cachefile

    r7972 r8048  
    114114Content\LyontiKuvaKaannetty.xnb 
    115115Content\MonsterJaljet.xnb 
     116Content\MonsterLyontiAani.xnb 
     117Content\MonsterErikoisKykyAani.xnb 
    116118Content\Music1.wma 
    117119Content\Music2.wma 
  • 2015/koodauskerho/AakeR/IMBT/IMBT/IMBT/obj/x86/Debug/ContentPipeline-{B6A1F4C9-F2E2-4290-A5B5-3717058CC989}.xml

    r7972 r8048  
    977977      <Options>None</Options> 
    978978      <Output>C:\MyTemp\AakeR\IMBT\IMBT\IMBT\bin\x86\Debug\Content\Pelaaja4MonsterKavelyAnimaatio3.xnb</Output> 
    979       <Time>2016-07-07T11:22:20.6344846+03:00</Time> 
     979      <Time>2016-07-07T15:04:37.6696011+03:00</Time> 
    980980    </Item> 
    981981    <Item> 
     
    10411041      <Output>C:\MyTemp\AakeR\IMBT\IMBT\IMBT\bin\x86\Debug\Content\MonsterJaljet.xnb</Output> 
    10421042      <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> 
    10431061    </Item> 
    10441062    <BuildSuccessful>true</BuildSuccessful> 
  • 2015/koodauskerho/AakeR/IMBT/IMBT/IMBT/obj/x86/Debug/IMBT.csproj.FileListAbsolute.txt

    r7972 r8048  
    127127C:\MyTemp\AakeR\IMBT\IMBT\IMBT\bin\x86\Debug\Content\LyontiKuvaKaannetty.xnb 
    128128C:\MyTemp\AakeR\IMBT\IMBT\IMBT\bin\x86\Debug\Content\MonsterJaljet.xnb 
     129C:\MyTemp\AakeR\IMBT\IMBT\IMBT\bin\x86\Debug\Content\MonsterLyontiAani.xnb 
     130C:\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  
    119119Content\LyontiKuvaKaannetty.xnb 
    120120Content\MonsterJaljet.xnb 
     121Content\MonsterLyontiAani.xnb 
     122Content\MonsterErikoisKykyAani.xnb 
  • 2015/koodauskerho/AakeR/IMBT/IMBT/IMBTContent/IMBTContent.contentproj

    r7972 r8048  
    716716    </Compile> 
    717717  </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> 
    718732  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    719733  <!--  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.