Ignore:
Timestamp:
2017-07-28 12:16:40 (6 years ago)
Author:
sieerinn
Message:
 
Location:
2017/utsjoki/NilláN/Speargear
Files:
8 added
11 edited

Legend:

Unmodified
Added
Removed
  • 2017/utsjoki/NilláN/Speargear/Speargear/Speargear/Speargear.cs

    r9173 r9212  
    2727    Pelaaja pelaaja2; 
    2828 
     29    SoundEffect osumanääni = LoadSoundEffect("robux"); 
     30 
    2931    Vector nopeusYlos = new Vector(0, 10000); 
    3032    Vector nopeusAlas = new Vector(0, -10000); 
     
    4244    Image vasenKuva = LoadImage("peliukko"); 
    4345    Image taustakuva = LoadImage("taso"); 
    44      
    45     bool vasen = false; 
    46     bool oikea = false; 
    47  
    48     bool vasen2 = false; 
    49     bool oikea2 = false; 
     46    Image hitsplat = LoadImage("hit"); 
    5047 
    5148 
     
    8986        pelaaja2 = LuoPelaaja(-370, -250); 
    9087 
    91         AddCollisionHandler<Pelaaja, PhysicsObject>(pelaaja1, "keihäs2", osuuKeihääseen); 
    92         AddCollisionHandler<Pelaaja, PhysicsObject>(pelaaja2, "keihäs1", osuuKeihääseen); 
     88        AddCollisionHandler<Pelaaja, PhysicsObject>(pelaaja1, "heitto2", (a, b) => osuuKeihääseen(a, b, 1, LoadImage("hit"))); 
     89        AddCollisionHandler<Pelaaja, PhysicsObject>(pelaaja2, "heitto1", (a,b) => osuuKeihääseen(a, b, 1, LoadImage("hit"))); 
     90 
     91        AddCollisionHandler<Pelaaja, PhysicsObject>(pelaaja1, "keihäs2", (a, b) => osuuKeihääseen(a, b, 2, LoadImage("hit2"))); 
     92        AddCollisionHandler<Pelaaja, PhysicsObject>(pelaaja2, "keihäs1", (a, b) => osuuKeihääseen(a, b, 2, LoadImage("hit2"))); 
    9393 
    9494        vasenReuna = Level.CreateLeftBorder(); 
     
    100100        Level.Background.FitToLevel(); 
    101101 
     102        //MediaPlayer.Play(""); 
     103 
    102104    } 
    103105 
     
    121123        Keyboard.Listen(Key.M, ButtonState.Pressed, Lyönti, null, pelaaja1, "keihäs1"); 
    122124        Keyboard.Listen(Key.Comma, ButtonState.Pressed, torjunta, null, pelaaja1); 
    123         Keyboard.Listen(Key.Period, ButtonState.Pressed, heitäKeihäs, null, pelaaja1, "keihäs1"); 
     125        Keyboard.Listen(Key.Period, ButtonState.Pressed, heitäKeihäs, null, pelaaja1, "heitto1"); 
    124126 
    125127 
     
    131133        Keyboard.Listen(Key.Y, ButtonState.Pressed, Lyönti, null, pelaaja2, "keihäs2"); 
    132134        Keyboard.Listen(Key.U, ButtonState.Pressed, torjunta, null, pelaaja2); 
    133         Keyboard.Listen(Key.T, ButtonState.Pressed, heitäKeihäs, null, pelaaja2, "keihäs2"); 
     135        Keyboard.Listen(Key.T, ButtonState.Pressed, heitäKeihäs, null, pelaaja2, "heitto2"); 
    134136 
    135137    } 
     
    168170    } 
    169171 
    170     void osuuKeihääseen(Pelaaja puolustaja, PhysicsObject keihäs) 
     172    void osuuKeihääseen(Pelaaja puolustaja, PhysicsObject keihäs, int vahinko, Image splatkuva) 
    171173    { 
    172174        Pelaaja hyökkääjä = (puolustaja == pelaaja1) ? pelaaja2 : pelaaja1; 
     
    179181        else 
    180182        { 
    181             puolustaja.ElamaLaskuri.Value -= 1; 
     183            GameObject hitsplat = new GameObject(30, 30); 
     184            hitsplat.Image = splatkuva; 
     185            puolustaja.Add(hitsplat); 
     186            hitsplat.LifetimeLeft = TimeSpan.FromSeconds(1); 
     187            osumanääni.Play(); 
     188            puolustaja.ElamaLaskuri.Value -= vahinko; 
    182189            puolustaja.Hit((puolustaja.Position - keihäs.Position).Normalize() * 5000); 
    183190        } 
     191         
    184192 
    185193    } 
  • 2017/utsjoki/NilláN/Speargear/Speargear/Speargear/Speargear.csproj.Debug.cachefile

    r9173 r9212  
    66Content\oikea.xnb 
    77Content\taso.xnb 
     8Content\roblox_death_sound_effect-f49ELvryhao_fmt43.xnb 
     9Content\robux.xnb 
     10Content\hit.xnb 
     11Content\hit2.xnb 
     12Content\roblox_death_sound_effect-f49ELvryhao_fmt43.wma 
  • 2017/utsjoki/NilláN/Speargear/Speargear/Speargear/obj/x86/Debug/ContentPipeline-{2D890E8B-0405-4957-9033-337AC1B0214F}.xml

    r9173 r9212  
    6565      <Time>2017-07-27T12:04:36.163918+03:00</Time> 
    6666    </Item> 
     67    <Item> 
     68      <Source>roblox_death_sound_effect-f49ELvryhao_fmt43.mp3</Source> 
     69      <Name>roblox_death_sound_effect-f49ELvryhao_fmt43</Name> 
     70      <Importer>Mp3Importer</Importer> 
     71      <Processor>SongProcessor</Processor> 
     72      <Options>None</Options> 
     73      <Output>C:\MyTemp\Speargear\Speargear\Speargear\bin\x86\Debug\Content\roblox_death_sound_effect-f49ELvryhao_fmt43.xnb</Output> 
     74      <Extra>C:\MyTemp\Speargear\Speargear\Speargear\bin\x86\Debug\Content\roblox_death_sound_effect-f49ELvryhao_fmt43.wma</Extra> 
     75      <Time>2017-07-27T14:51:06.8052669+03:00</Time> 
     76    </Item> 
     77    <Item> 
     78      <Source>robux.wav</Source> 
     79      <Name>robux</Name> 
     80      <Importer>WavImporter</Importer> 
     81      <Processor>SoundEffectProcessor</Processor> 
     82      <Options>None</Options> 
     83      <Output>C:\MyTemp\Speargear\Speargear\Speargear\bin\x86\Debug\Content\robux.xnb</Output> 
     84      <Time>2017-07-28T09:30:47.6007886+03:00</Time> 
     85    </Item> 
     86    <Item> 
     87      <Source>hit.png</Source> 
     88      <Name>hit</Name> 
     89      <Importer>TextureImporter</Importer> 
     90      <Processor>TextureProcessor</Processor> 
     91      <Options>None</Options> 
     92      <Output>C:\MyTemp\Speargear\Speargear\Speargear\bin\x86\Debug\Content\hit.xnb</Output> 
     93      <Time>2017-07-28T09:42:52.5672004+03:00</Time> 
     94    </Item> 
     95    <Item> 
     96      <Source>hit2.png</Source> 
     97      <Name>hit2</Name> 
     98      <Importer>TextureImporter</Importer> 
     99      <Processor>TextureProcessor</Processor> 
     100      <Options>None</Options> 
     101      <Output>C:\MyTemp\Speargear\Speargear\Speargear\bin\x86\Debug\Content\hit2.xnb</Output> 
     102      <Time>2017-07-28T10:51:54.9326918+03:00</Time> 
     103    </Item> 
    67104    <BuildSuccessful>true</BuildSuccessful> 
    68105    <Settings> 
  • 2017/utsjoki/NilláN/Speargear/Speargear/Speargear/obj/x86/Debug/Speargear.csproj.FileListAbsolute.txt

    r9173 r9212  
    1414C:\MyTemp\Speargear\Speargear\Speargear\bin\x86\Debug\Content\oikea.xnb 
    1515C:\MyTemp\Speargear\Speargear\Speargear\bin\x86\Debug\Content\taso.xnb 
     16C:\MyTemp\Speargear\Speargear\Speargear\bin\x86\Debug\Content\roblox_death_sound_effect-f49ELvryhao_fmt43.xnb 
     17C:\MyTemp\Speargear\Speargear\Speargear\bin\x86\Debug\Content\robux.xnb 
     18C:\MyTemp\Speargear\Speargear\Speargear\bin\x86\Debug\Content\roblox_death_sound_effect-f49ELvryhao_fmt43.wma 
     19C:\MyTemp\Speargear\Speargear\Speargear\bin\x86\Debug\Content\hit.xnb 
     20C:\MyTemp\Speargear\Speargear\Speargear\bin\x86\Debug\Content\hit2.xnb 
  • 2017/utsjoki/NilláN/Speargear/Speargear/Speargear/obj/x86/Debug/cachefile-{2D890E8B-0405-4957-9033-337AC1B0214F}-targetpath.txt

    r9173 r9212  
    66Content\oikea.xnb 
    77Content\taso.xnb 
     8Content\roblox_death_sound_effect-f49ELvryhao_fmt43.xnb 
     9Content\roblox_death_sound_effect-f49ELvryhao_fmt43.wma 
     10Content\robux.xnb 
     11Content\hit.xnb 
     12Content\hit2.xnb 
  • 2017/utsjoki/NilláN/Speargear/Speargear/SpeargearContent/SpeargearContent.contentproj

    r9173 r9212  
    9494    </Compile> 
    9595  </ItemGroup> 
     96  <ItemGroup> 
     97    <Compile Include="roblox_death_sound_effect-f49ELvryhao_fmt43.mp3"> 
     98      <Name>roblox_death_sound_effect-f49ELvryhao_fmt43</Name> 
     99      <Importer>Mp3Importer</Importer> 
     100      <Processor>SongProcessor</Processor> 
     101    </Compile> 
     102  </ItemGroup> 
     103  <ItemGroup> 
     104    <Compile Include="robux.wav"> 
     105      <Name>robux</Name> 
     106      <Importer>WavImporter</Importer> 
     107      <Processor>SoundEffectProcessor</Processor> 
     108    </Compile> 
     109  </ItemGroup> 
     110  <ItemGroup> 
     111    <Compile Include="hit.png"> 
     112      <Name>hit</Name> 
     113      <Importer>TextureImporter</Importer> 
     114      <Processor>TextureProcessor</Processor> 
     115    </Compile> 
     116  </ItemGroup> 
     117  <ItemGroup> 
     118    <Compile Include="hit2.png"> 
     119      <Name>hit2</Name> 
     120      <Importer>TextureImporter</Importer> 
     121      <Processor>TextureProcessor</Processor> 
     122    </Compile> 
     123  </ItemGroup> 
    96124  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    97125  <!--  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.