Ignore:
Timestamp:
2015-07-03 11:38:18 (4 years ago)
Author:
eemikone
Message:

peli valmis

Location:
2015/27/EemilI/infected - Copy/infected
Files:
27 added
10 edited

Legend:

Unmodified
Added
Removed
  • 2015/27/EemilI/infected - Copy/infected/infected/infected.cs

    r6772 r6784  
    1717    Image pistoolikuva = LoadImage("JuanDeag"); 
    1818    Image halekuva = LoadImage("shotfun"); 
    19      
     19    Image lappukuva = LoadImage("lappu"); 
     20    IntMeter pistelaskuri; 
     21    IntMeter lappulaskuri; 
     22 
    2023    AssaultRifle ase; 
    2124     
    2225    List<Vector> spawnipaikat = new List<Vector>(); 
     26    List<Vector> lappujenspawnipaikat = new List<Vector>(); 
    2327    List<Label> valikonKohdat; 
    2428 
     
    2731       
    2832        Valikko(); 
    29         //IsFullScreen = true; 
     33        IsFullScreen = true; 
    3034        SmoothTextures = true; 
    3135        MediaPlayer.Play("Volatile Reaction"); 
     36 
    3237    } 
    3338    void LuoHahmo(Vector paikka, double leveys, double korkeus) 
     
    3944        Add(mies); 
    4045        AddCollisionHandler(mies, "zombi", PelaajaKuolee); 
     46        AddCollisionHandler(mies, "lappu", KeraaLappu); 
    4147        mies.CollisionIgnoreGroup = 3; 
     48         
    4249 
    4350        ase = new AssaultRifle(50,6); 
     
    5865        //siirrin.Timeout += delegate { valo.Position = mies.Position; }; 
    5966        //siirrin.Start(); 
     67         
    6068    } 
    6169 
     
    6876        mappi.SetTileMethod(Color.Red, LuoHahmo); 
    6977        mappi.SetTileMethod(Color.FromHexCode("7F0000"), LuoTurvaSeina); 
     78        mappi.SetTileMethod(Color.Orange, LuoLappu); 
    7079        mappi.Execute(40, 40); 
    7180        LuoPisteLaskuri(); 
     81        LuoLappuLaskuri(); 
    7282        Level.AmbientLight = 0.5; 
    7383         
     
    8595        Camera.StayInLevel = true; 
    8696        Camera.Zoom(1.0); 
     97 
     98        GameObject tausta = new GameObject(Level.Width, Level.Height); 
     99        tausta.Color = Color.Black; 
     100        Add(tausta, -3); 
    87101    } 
    88102 
     
    142156 
    143157 
    144         aikaLaskuri.Interval = 4; 
     158        aikaLaskuri.Interval = 10; 
    145159        aikaLaskuri.Timeout += LuoUusiZombi; 
    146160        aikaLaskuri.Start(); 
     161 
     162        Timer lappuAjastin = new Timer(); 
     163        lappuAjastin.Interval = 30; 
     164        lappuAjastin.Timeout += LuoUusiLappu; 
     165        lappuAjastin.Start(); 
    147166 
    148167        Label aikaNaytto = new Label(); 
     
    256275        Timer.SingleShot(1, Valikko); 
    257276    } 
    258     IntMeter pistelaskuri; 
     277    
    259278    void LuoPisteLaskuri() 
    260279    { 
     
    262281 
    263282        Label pisteNaytto = new Label(); 
    264         pisteNaytto.X = Screen.Left + 75; 
    265         pisteNaytto.Y = Screen.Top - 75; 
     283        pisteNaytto.X = Screen.Right - pisteNaytto.Width; 
     284        pisteNaytto.Y = Screen.Top - pisteNaytto.Height*2; 
    266285        pisteNaytto.TextColor = Color.White; 
    267286        pisteNaytto.Color = Color.Black; 
     287         
    268288 
    269289        pisteNaytto.BindTo(pistelaskuri); 
     
    382402        kauppa.AddItemHandler(0, delegate 
    383403        { 
    384             if (pistelaskuri.Value >= 1) 
    385             { 
    386                 pistelaskuri.Value -= 1; 
     404            if (pistelaskuri.Value >= 100) 
     405            { 
     406                pistelaskuri.Value -= 100; 
    387407                Keyboard.Listen(Key.D2, ButtonState.Pressed, VaihdaAse, "Ota haulikko esille", "haulikko"); 
    388408            } 
     
    391411        kauppa.AddItemHandler(1, delegate 
    392412        { 
    393             if (pistelaskuri.Value >= 1) 
    394             { 
    395                 pistelaskuri.Value -= 1; 
     413            if (pistelaskuri.Value >= 250) 
     414            { 
     415                pistelaskuri.Value -= 250; 
    396416                Keyboard.Listen(Key.D3, ButtonState.Pressed, VaihdaAse, "Ota ak-47 esille", "ak47"); 
    397417            } 
     
    399419        }); 
    400420         
    401         kauppa.AddItemHandler(1, delegate 
     421        kauppa.AddItemHandler(2, delegate 
    402422        { 
    403423            IsPaused = false; 
     
    405425        Add(kauppa); 
    406426    } 
     427    void LuoLappu(Vector paikka, double leveys, double korkeus) 
     428    { 
     429         
     430            lappujenspawnipaikat.Add(paikka); 
     431 
     432         
     433    } 
     434    void LuoLappuLaskuri() 
     435    { 
     436        lappulaskuri = new IntMeter(0,0,10); 
     437 
     438        Label lappunaytto = new Label(); 
     439        lappunaytto.X = Screen.Right - lappunaytto.Width; 
     440        lappunaytto.Y = Screen.Top - 75; 
     441        lappunaytto.TextColor = Color.White; 
     442        lappunaytto.Color = Color.Black; 
     443 
     444        lappulaskuri.UpperLimit += KaikkiLaputKeratty; 
     445 
     446        lappunaytto.BindTo(lappulaskuri); 
     447        Add(lappunaytto); 
     448 
     449        lappunaytto.IntFormatString = "Laput: {0:D1}/10"; 
     450    } 
     451    void LuoUusiLappu() 
     452    { 
     453        int indeksi = RandomGen.NextInt(0, lappujenspawnipaikat.Count - 1); 
     454        Vector paikka = lappujenspawnipaikat[indeksi]; 
     455        LuoLappu(paikka); 
     456 
     457    } 
     458    void LuoLappu(Vector paikka) 
     459    { 
     460        PhysicsObject lappu = new PhysicsObject(40, 40); 
     461        lappu.Tag = "lappu"; 
     462        lappu.Position = paikka; 
     463        lappu.Image = lappukuva; 
     464         
     465        Add(lappu); 
     466    } 
     467    void KaikkiLaputKeratty() 
     468    { 
     469        MessageDisplay.Add("Keräsit kaikki laput..."); 
     470        MessageDisplay.Add("Voit jatkaa jos haluat"); 
     471    } 
     472    void KeraaLappu(PhysicsObject pelaaja,PhysicsObject lappu) 
     473    {  
     474    MessageDisplay.Add("Keräsit lapun"); 
     475    lappulaskuri.Value++; 
     476    lappu.Destroy(); 
     477    } 
    407478} 
  • 2015/27/EemilI/infected - Copy/infected/infected/infected.csproj.Debug.cachefile

    r6772 r6784  
    1414Content\hale.xnb 
    1515Content\m4.xnb 
     16Content\lappu.xnb 
    1617Content\Ghost Story.wma 
    1718Content\Volatile Reaction.wma 
  • 2015/27/EemilI/infected - Copy/infected/infected/obj/x86/Debug/ContentPipeline-{B898C966-80ED-44D3-9FBA-1E981C2850D4}.xml

    r6772 r6784  
    1818      <Options>None</Options> 
    1919      <Output>C:\MyTemp\EemilI\infected - Copy\infected\infected\bin\x86\Debug\Content\mappi.xnb</Output> 
    20       <Time>2015-07-02T14:17:01.9048031+03:00</Time> 
     20      <Time>2015-07-03T10:45:15.388847+03:00</Time> 
    2121    </Item> 
    2222    <Item> 
     
    8383      <Options>None</Options> 
    8484      <Output>C:\MyTemp\EemilI\infected - Copy\infected\infected\bin\x86\Debug\Content\valikkokuva.xnb</Output> 
    85       <Time>2015-07-02T12:29:51.2191031+03:00</Time> 
     85      <Time>2015-07-03T11:31:50.157247+03:00</Time> 
    8686    </Item> 
    8787    <Item> 
     
    138138      <Output>C:\MyTemp\EemilI\infected - Copy\infected\infected\bin\x86\Debug\Content\m4.xnb</Output> 
    139139      <Time>2015-07-03T10:08:47.104847+03:00</Time> 
     140    </Item> 
     141    <Item> 
     142      <Source>lappu.png</Source> 
     143      <Name>lappu</Name> 
     144      <Importer>TextureImporter</Importer> 
     145      <Processor>TextureProcessor</Processor> 
     146      <Options>None</Options> 
     147      <Output>C:\MyTemp\EemilI\infected - Copy\infected\infected\bin\x86\Debug\Content\lappu.xnb</Output> 
     148      <Time>2015-07-03T10:34:58.858847+03:00</Time> 
    140149    </Item> 
    141150    <BuildSuccessful>true</BuildSuccessful> 
  • 2015/27/EemilI/infected - Copy/infected/infected/obj/x86/Debug/cachefile-{B898C966-80ED-44D3-9FBA-1E981C2850D4}-targetpath.txt

    r6772 r6784  
    1616Content\hale.xnb 
    1717Content\m4.xnb 
     18Content\lappu.xnb 
  • 2015/27/EemilI/infected - Copy/infected/infected/obj/x86/Debug/infected.csproj.FileListAbsolute.txt

    r6772 r6784  
    2424C:\MyTemp\EemilI\infected - Copy\infected\infected\bin\x86\Debug\Content\pistol.xnb 
    2525C:\MyTemp\EemilI\infected - Copy\infected\infected\bin\x86\Debug\Content\m4.xnb 
     26C:\MyTemp\EemilI\infected - Copy\infected\infected\bin\x86\Debug\Content\lappu.xnb 
  • 2015/27/EemilI/infected - Copy/infected/infectedContent/infectedContent.contentproj

    r6772 r6784  
    150150    </Compile> 
    151151  </ItemGroup> 
     152  <ItemGroup> 
     153    <Compile Include="lappu.png"> 
     154      <Name>lappu</Name> 
     155      <Importer>TextureImporter</Importer> 
     156      <Processor>TextureProcessor</Processor> 
     157    </Compile> 
     158  </ItemGroup> 
    152159  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    153160  <!--  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.