Changeset 6039 for 2015/24


Ignore:
Timestamp:
2015-06-11 19:32:52 (8 years ago)
Author:
empaheik
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 2015/24/ohjaajat/Dungeon/Dungeon/Dungeon/Dungeon.cs

    r6038 r6039  
    5252        barbaari.Destroy(); //TODO: Mitä nyt oikeasti tapahtuu, kun barbaari astuu ansaan. Meidän tapauksessa kai tapetaan saman tien. 
    5353        peli.Splatter(huone.Position); 
     54 
     55        this.Animation.Start(1); 
     56 
     57        if(peli.barbaarit.Count < 1) 
     58        { 
     59            peli.kierrosKaynnissa = false; 
     60            //peli. 
     61        } 
    5462    } 
    5563} 
     
    177185 
    178186    int[] hinnat = new int[] { 100, 200, 300, 100}; 
    179     private int barbaariMaara = 3; 
     187    private int barbaariMaara = 2; 
     188 
     189    public bool kierrosKaynnissa = false; 
    180190 
    181191    Room[,] huoneet; 
     
    191201    GameObject digArrowHead; 
    192202 
    193     IntMeter kulttuuri = new IntMeter(300, 0, 2000); 
     203    IntMeter kultuuri = new IntMeter(1000, 0, 2000); 
    194204 
    195205    const int VAAKA_HUONEET = 12; 
     
    243253 
    244254        Label rahat = new Label(); 
    245         rahat.BindTo(kulttuuri); 
     255        rahat.BindTo(kultuuri); 
    246256        rahat.Position = new Vector(Level.Right + Level.Width * 0.2, Level.Bottom + Level.Height * 0.1); 
    247257        rahat.TextColor = Color.White; 
     
    301311            kuva.Clicked += delegate 
    302312            { 
    303                ostamassa = LuoAnsaPaivitys(ansaKuvat[indeksi], hinnat[indeksi]); 
     313               ostamassa = LuoAnsaPaivitys(ansaKuvat[ansaKuvat.Length-1], hinnat[indeksi]); 
    304314            }; 
    305315 
     
    318328        upg.Size = new Vector(0.5, 0.5) * RUUDUN_KOKO; 
    319329        upg.Price = hinta; 
     330        upg.Animation = new Animation(ansaKuvat); 
    320331        return upg; 
    321332    } 
     
    404415    void SeuraavaAalto() 
    405416    { 
    406  
    407         barbaariAjastin.Start(barbaariMaara); 
    408         barbaariMaara += 2; 
     417        if (!kierrosKaynnissa) 
     418        { 
     419            barbaariAjastin.Start(barbaariMaara); 
     420            barbaariMaara += 2; 
     421            kierrosKaynnissa = false; 
     422        } 
    409423    } 
    410424 
     
    502516    void AsetaPaivitys(Room huone) 
    503517    { 
    504         if (ostamassa != null && huone.Dug && kulttuuri.Value >= ostamassa.Price) 
    505         { 
    506             kulttuuri.Value -= ostamassa.Price; 
     518        if (ostamassa != null && huone.Dug && kultuuri.Value >= ostamassa.Price) 
     519        { 
     520            kultuuri.Value -= ostamassa.Price; 
    507521 
    508522            // Lisätään päivitys huoneeseen. 
     
    708722            Add(p, 3); 
    709723 
    710             GameObject varjo = new GameObject(20, 10); 
     724            GameObject varjo = new GameObject(5, 5); 
    711725            varjo.Position = p.Position; 
    712726            varjo.Shape = Shape.Circle; 
Note: See TracChangeset for help on using the changeset viewer.