Changeset 6785 for 2015/27


Ignore:
Timestamp:
2015-07-03 11:42:34 (8 years ago)
Author:
beechiks
Message:
 
Location:
2015/27/BenjaminE/HackNSlashOikea
Files:
14 added
5 deleted
16 edited

Legend:

Unmodified
Added
Removed
  • 2015/27/BenjaminE/HackNSlashOikea/HackNSlashOikea/HackNSlashOikea/HackNSlashOikea.cs

    r6760 r6785  
    1111    Image ekaPlKuva = LoadImage("ekaPelaajaKuva"); 
    1212    PhysicsObject ekaPelaaja; 
     13    SoundEffect pelaajaKuole = LoadSoundEffect("pelaajaKuole"); 
    1314    AssaultRifle pelaajanAse; 
    1415    PhysicsObject ammus; 
    1516    Image luotiKuva = LoadImage("luoti"); 
    1617    SoundEffect ammusAani = LoadSoundEffect("ammusAani"); 
    17  
     18    IntMeter pisteLaskuri = new IntMeter(0, 0, 100); 
     19 
     20    SoundEffect zombieAani = LoadSoundEffect("zombieAani"); 
     21    SoundEffect zombieKuole = LoadSoundEffect("zombieKuole"); 
     22    Image vertaa = LoadImage("vertaa"); 
     23    ExplosionSystem vertaaEffect; 
    1824    double zombieRate = 1.0; 
    1925 
     26    EasyHighScore topLista = new EasyHighScore(); 
     27 
    2028    public override void Begin() 
    2129    { 
    22         //MediaPlayer.Play("musiiki"); 
    23         //MediaPlayer.IsRepeating = true; 
    24  
    25         Level.Background.Color = Color.Black; 
    26  
    27         MultiSelectWindow alkuValikko = new MultiSelectWindow("Zombie Attack", "Aloita peli", "Lopeta"); 
    28         alkuValikko.AddItemHandler(0, AloitaPeli); 
    29         alkuValikko.AddItemHandler(2, Exit); 
    30         Add(alkuValikko); 
     30        Window tyhma = new Window(); 
     31        AloitaUdella(tyhma); 
    3132    } 
    3233 
    3334    void AloitaPeli() 
    3435    { 
     36 
     37        MediaPlayer.Play("zombieAaniM"); 
     38        MediaPlayer.IsRepeating = true; 
     39 
    3540        Vector keski = new Vector(); 
    3641        LuoPelaaja(keski); 
     
    3843        EnempaZombia(); 
    3944        Level.CreateBorders(false); 
    40         Level.Background.Image = LoadImage("tausta"); 
    41         Level.Background.TileToLevel(); 
     45        GameObject tausta = new GameObject(Level.Width, Level.Height); 
     46        tausta.Image = LoadImage("tausta"); 
     47        Add(tausta, -3); 
    4248        Camera.StayInLevel = true; 
    4349        Camera.Follow(ekaPelaaja); 
     
    7480        ekaPelaaja.Add(pelaajanAse); 
    7581 
     82 
     83        Level.AmbientLight = -0.7; 
     84 
     85        Light valo = new Light(); 
     86        valo.Intensity = 1.5; 
     87        valo.Distance = 150; 
     88        valo.Position = ekaPelaaja.Position; 
     89        Add(valo); 
     90 
     91        Timer valoAjastin = new Timer(); 
     92        valoAjastin.Interval = 0.1; 
     93        valoAjastin.Timeout += delegate 
     94        { 
     95            valo.Position = ekaPelaaja.Position; 
     96        }; 
     97        valoAjastin.Start(); 
     98 
    7699        AddCollisionHandler(ekaPelaaja, "vihu", PelajaKuole); 
     100 
     101        Label pistenaytto = new Label(""); 
     102        pistenaytto.BindTo(pisteLaskuri); 
     103        pistenaytto.Position = new Vector(0, Screen.Top - 50.0); 
     104        pistenaytto.Color = Color.White; 
     105        pistenaytto.TextScale = new Vector(2.0, 2.0); 
     106        Add(pistenaytto); 
    77107 
    78108        Add(ekaPelaaja); 
     
    82112    void PelajaKuole(PhysicsObject pelaaja, PhysicsObject vihu)  
    83113    { 
     114        pelaajaKuole.Play(); 
    84115        ClearAll(); 
    85         AlotaUdella(); 
    86     } 
    87  
    88     void AlotaUdella()  
     116        topLista.EnterAndShow(pisteLaskuri.Value); 
     117        topLista.HighScoreWindow.Closed += AloitaUdella; 
     118        Level.Background.Color = Color.Black; 
     119    } 
     120 
     121    void AloitaUdella(Window sender)  
    89122    { 
    90123        Level.Background.Color = Color.Black; 
     
    92125        MultiSelectWindow alkuValikko = new MultiSelectWindow("Zombie Attack", "Aloita peli", "Lopeta"); 
    93126        alkuValikko.AddItemHandler(0, AloitaPeli); 
    94         alkuValikko.AddItemHandler(2, Exit); 
     127        alkuValikko.AddItemHandler(1, Exit); 
    95128        Add(alkuValikko); 
    96129    } 
     
    98131    void Spawner() 
    99132    { 
     133        vertaaEffect = new ExplosionSystem(vertaa, 100); 
     134        vertaaEffect.MinLifetime = 0.1; 
     135        vertaaEffect.MaxLifetime = 0.2; 
     136        vertaaEffect.MinScale = 4; 
     137        vertaaEffect.MaxScale = 10; 
     138        vertaaEffect.MinVelocity = 20.0; 
     139        vertaaEffect.MaxVelocity = 50.0; 
     140        Add(vertaaEffect); 
     141 
    100142        Timer spawneri = new Timer(); 
    101143        spawneri.Timeout += LuoVihu; 
     
    132174        if (ammus != null) 
    133175        { 
    134             ammusAani.Play(); 
    135176            ammus.Height = 1.0; 
    136177            ammus.Width = 1.0; 
    137178            ammus.Image = luotiKuva; 
    138179            ammus.Tag = "ammus"; 
     180            ammusAani.Play(); 
    139181 
    140182            AddCollisionHandler(ammus, delegate (PhysicsObject a, PhysicsObject b) 
     
    170212    { 
    171213        vihu.Destroy(); 
     214        vertaaEffect.AddEffect(vihu.X, vihu.Y, 100); 
     215        pisteLaskuri.AddValue(1); 
    172216    } 
    173217} 
  • 2015/27/BenjaminE/HackNSlashOikea/HackNSlashOikea/HackNSlashOikea/HackNSlashOikea.csproj.Debug.cachefile

    r6760 r6785  
    66Content\musiiki.xnb 
    77Content\ammusAani.xnb 
     8Content\zombieKuole.xnb 
     9Content\pelaajaKuole.xnb 
     10Content\vertaa.xnb 
     11Content\pisteet.xnb 
     12Content\zombieAaniM.xnb 
     13Content\zombieAani.xnb 
    814Content\musiiki.wma 
    9 Content\ammusAani.wma 
     15Content\zombieAaniM.wma 
  • 2015/27/BenjaminE/HackNSlashOikea/HackNSlashOikea/HackNSlashOikea/obj/x86/Debug/ContentPipeline-{E8D421DF-029D-4388-8D7A-2B33D24D9EB1}.xml

    r6760 r6785  
    2727      <Options>None</Options> 
    2828      <Output>C:\MyTemp\BenE\HackNSlashOikea\HackNSlashOikea\HackNSlashOikea\bin\x86\Debug\Content\ekaPelaajaKuva.xnb</Output> 
    29       <Time>2015-07-02T14:33:09.9802736+03:00</Time> 
     29      <Time>2015-07-03T10:31:18.5551878+03:00</Time> 
    3030    </Item> 
    3131    <Item> 
     
    3636      <Options>None</Options> 
    3737      <Output>C:\MyTemp\BenE\HackNSlashOikea\HackNSlashOikea\HackNSlashOikea\bin\x86\Debug\Content\tausta.xnb</Output> 
    38       <Time>2015-07-02T13:11:48.3374736+03:00</Time> 
     38      <Time>2015-07-03T10:40:19.6691878+03:00</Time> 
    3939    </Item> 
    4040    <Item> 
     
    4848    </Item> 
    4949    <Item> 
    50       <Source>musiiki.mp3</Source> 
    51       <Name>musiiki</Name> 
     50      <Source>ammusAani.wav</Source> 
     51      <Name>ammusAani</Name> 
     52      <Importer>WavImporter</Importer> 
     53      <Processor>SoundEffectProcessor</Processor> 
     54      <Options>None</Options> 
     55      <Output>C:\MyTemp\BenE\HackNSlashOikea\HackNSlashOikea\HackNSlashOikea\bin\x86\Debug\Content\ammusAani.xnb</Output> 
     56      <Time>2015-07-03T09:22:45.7211878+03:00</Time> 
     57    </Item> 
     58    <Item> 
     59      <Source>zombieKuole.wav</Source> 
     60      <Name>zombieKuole</Name> 
     61      <Importer>WavImporter</Importer> 
     62      <Processor>SoundEffectProcessor</Processor> 
     63      <Options>None</Options> 
     64      <Output>C:\MyTemp\BenE\HackNSlashOikea\HackNSlashOikea\HackNSlashOikea\bin\x86\Debug\Content\zombieKuole.xnb</Output> 
     65      <Time>2015-07-03T09:26:47.8971878+03:00</Time> 
     66    </Item> 
     67    <Item> 
     68      <Source>pelaajaKuole.wav</Source> 
     69      <Name>pelaajaKuole</Name> 
     70      <Importer>WavImporter</Importer> 
     71      <Processor>SoundEffectProcessor</Processor> 
     72      <Options>None</Options> 
     73      <Output>C:\MyTemp\BenE\HackNSlashOikea\HackNSlashOikea\HackNSlashOikea\bin\x86\Debug\Content\pelaajaKuole.xnb</Output> 
     74      <Time>2015-07-03T09:30:10.4731878+03:00</Time> 
     75    </Item> 
     76    <Item> 
     77      <Source>vertaa.png</Source> 
     78      <Name>vertaa</Name> 
     79      <Importer>TextureImporter</Importer> 
     80      <Processor>TextureProcessor</Processor> 
     81      <Options>None</Options> 
     82      <Output>C:\MyTemp\BenE\HackNSlashOikea\HackNSlashOikea\HackNSlashOikea\bin\x86\Debug\Content\vertaa.xnb</Output> 
     83      <Time>2015-07-03T10:35:51.0541878+03:00</Time> 
     84    </Item> 
     85    <Item> 
     86      <Source>zombieAaniM.mp3</Source> 
     87      <Name>zombieAaniM</Name> 
    5288      <Importer>Mp3Importer</Importer> 
    5389      <Processor>SongProcessor</Processor> 
    5490      <Options>None</Options> 
    55       <Output>C:\MyTemp\BenE\HackNSlashOikea\HackNSlashOikea\HackNSlashOikea\bin\x86\Debug\Content\musiiki.xnb</Output> 
    56       <Extra>C:\MyTemp\BenE\HackNSlashOikea\HackNSlashOikea\HackNSlashOikea\bin\x86\Debug\Content\musiiki.wma</Extra> 
    57       <Time>2015-07-02T14:04:41.5265736+03:00</Time> 
     91      <Output>C:\MyTemp\BenE\HackNSlashOikea\HackNSlashOikea\HackNSlashOikea\bin\x86\Debug\Content\zombieAaniM.xnb</Output> 
     92      <Extra>C:\MyTemp\BenE\HackNSlashOikea\HackNSlashOikea\HackNSlashOikea\bin\x86\Debug\Content\zombieAaniM.wma</Extra> 
     93      <Time>2015-07-03T11:26:20.4684822+03:00</Time> 
    5894    </Item> 
    5995    <Item> 
    60       <Source>ammusAani.mp3</Source> 
    61       <Name>ammusAani</Name> 
    62       <Importer>Mp3Importer</Importer> 
    63       <Processor>SongProcessor</Processor> 
     96      <Source>zombieAani.wav</Source> 
     97      <Name>zombieAani</Name> 
     98      <Importer>WavImporter</Importer> 
     99      <Processor>SoundEffectProcessor</Processor> 
    64100      <Options>None</Options> 
    65       <Output>C:\MyTemp\BenE\HackNSlashOikea\HackNSlashOikea\HackNSlashOikea\bin\x86\Debug\Content\ammusAani.xnb</Output> 
    66       <Extra>C:\MyTemp\BenE\HackNSlashOikea\HackNSlashOikea\HackNSlashOikea\bin\x86\Debug\Content\ammusAani.wma</Extra> 
    67       <Time>2015-07-02T14:47:51.2645736+03:00</Time> 
     101      <Output>C:\MyTemp\BenE\HackNSlashOikea\HackNSlashOikea\HackNSlashOikea\bin\x86\Debug\Content\zombieAani.xnb</Output> 
     102      <Time>2015-07-03T09:26:47.8841878+03:00</Time> 
    68103    </Item> 
    69104    <BuildSuccessful>true</BuildSuccessful> 
  • 2015/27/BenjaminE/HackNSlashOikea/HackNSlashOikea/HackNSlashOikea/obj/x86/Debug/HackNSlashOikea.csproj.FileListAbsolute.txt

    r6760 r6785  
    3232C:\MyTemp\BenE\HackNSlashOikea\HackNSlashOikea\HackNSlashOikea\bin\x86\Debug\Content\tausta.xnb 
    3333C:\MyTemp\BenE\HackNSlashOikea\HackNSlashOikea\HackNSlashOikea\bin\x86\Debug\Content\luoti.xnb 
    34 C:\MyTemp\BenE\HackNSlashOikea\HackNSlashOikea\HackNSlashOikea\bin\x86\Debug\Content\musiiki.xnb 
    35 C:\MyTemp\BenE\HackNSlashOikea\HackNSlashOikea\HackNSlashOikea\bin\x86\Debug\Content\musiiki.wma 
    3634C:\MyTemp\BenE\HackNSlashOikea\HackNSlashOikea\HackNSlashOikea\bin\x86\Debug\Content\ammusAani.xnb 
    37 C:\MyTemp\BenE\HackNSlashOikea\HackNSlashOikea\HackNSlashOikea\bin\x86\Debug\Content\ammusAani.wma 
     35C:\MyTemp\BenE\HackNSlashOikea\HackNSlashOikea\HackNSlashOikea\bin\x86\Debug\Content\zombieAani.xnb 
     36C:\MyTemp\BenE\HackNSlashOikea\HackNSlashOikea\HackNSlashOikea\bin\x86\Debug\Content\zombieKuole.xnb 
     37C:\MyTemp\BenE\HackNSlashOikea\HackNSlashOikea\HackNSlashOikea\bin\x86\Debug\Content\pelaajaKuole.xnb 
     38C:\MyTemp\BenE\HackNSlashOikea\HackNSlashOikea\HackNSlashOikea\bin\x86\Debug\Content\vertaa.xnb 
     39C:\MyTemp\BenE\HackNSlashOikea\HackNSlashOikea\HackNSlashOikea\bin\x86\Debug\Content\zombieAaniM.xnb 
     40C:\MyTemp\BenE\HackNSlashOikea\HackNSlashOikea\HackNSlashOikea\bin\x86\Debug\Content\zombieAaniM.wma 
  • 2015/27/BenjaminE/HackNSlashOikea/HackNSlashOikea/HackNSlashOikea/obj/x86/Debug/cachefile-{E8D421DF-029D-4388-8D7A-2B33D24D9EB1}-targetpath.txt

    r6760 r6785  
    44Content\tausta.xnb 
    55Content\luoti.xnb 
    6 Content\musiiki.xnb 
    7 Content\musiiki.wma 
    86Content\ammusAani.xnb 
    9 Content\ammusAani.wma 
     7Content\zombieKuole.xnb 
     8Content\pelaajaKuole.xnb 
     9Content\vertaa.xnb 
     10Content\zombieAaniM.xnb 
     11Content\zombieAaniM.wma 
     12Content\zombieAani.xnb 
  • 2015/27/BenjaminE/HackNSlashOikea/HackNSlashOikea/HackNSlashOikeaContent/HackNSlashOikeaContent.contentproj

    r6760 r6785  
    5353  </ItemGroup> 
    5454  <ItemGroup> 
    55     <Compile Include="tausta.png"> 
    56       <Name>tausta</Name> 
    57       <Importer>TextureImporter</Importer> 
    58       <Processor>TextureProcessor</Processor> 
    59     </Compile> 
    60   </ItemGroup> 
    61   <ItemGroup> 
    6255    <Compile Include="vihu.png"> 
    6356      <Name>vihu</Name> 
     
    8174  </ItemGroup> 
    8275  <ItemGroup> 
    83     <Compile Include="musiiki.mp3"> 
    84       <Name>musiiki</Name> 
    85       <Importer>Mp3Importer</Importer> 
    86       <Processor>SongProcessor</Processor> 
     76    <Compile Include="ammusAani.wav"> 
     77      <Name>ammusAani</Name> 
     78      <Importer>WavImporter</Importer> 
     79      <Processor>SoundEffectProcessor</Processor> 
    8780    </Compile> 
    8881  </ItemGroup> 
    8982  <ItemGroup> 
    90     <Compile Include="ammusAani.mp3"> 
    91       <Name>ammusAani</Name> 
     83    <Compile Include="zombieAani.wav"> 
     84      <Name>zombieAani</Name> 
     85      <Importer>WavImporter</Importer> 
     86      <Processor>SoundEffectProcessor</Processor> 
     87    </Compile> 
     88    <Compile Include="zombieKuole.wav"> 
     89      <Name>zombieKuole</Name> 
     90      <Importer>WavImporter</Importer> 
     91      <Processor>SoundEffectProcessor</Processor> 
     92    </Compile> 
     93  </ItemGroup> 
     94  <ItemGroup> 
     95    <Compile Include="pelaajaKuole.wav"> 
     96      <Name>pelaajaKuole</Name> 
     97      <Importer>WavImporter</Importer> 
     98      <Processor>SoundEffectProcessor</Processor> 
     99    </Compile> 
     100  </ItemGroup> 
     101  <ItemGroup> 
     102    <Compile Include="vertaa.png"> 
     103      <Name>vertaa</Name> 
     104      <Importer>TextureImporter</Importer> 
     105      <Processor>TextureProcessor</Processor> 
     106    </Compile> 
     107  </ItemGroup> 
     108  <ItemGroup> 
     109    <Compile Include="tausta.png"> 
     110      <Name>tausta</Name> 
     111      <Importer>TextureImporter</Importer> 
     112      <Processor>TextureProcessor</Processor> 
     113    </Compile> 
     114  </ItemGroup> 
     115  <ItemGroup> 
     116    <Compile Include="zombieAaniM.mp3"> 
     117      <Name>zombieAaniM</Name> 
    92118      <Importer>Mp3Importer</Importer> 
    93119      <Processor>SongProcessor</Processor> 
Note: See TracChangeset for help on using the changeset viewer.