Ignore:
Timestamp:
2015-06-26 10:48:23 (6 years ago)
Author:
anlakane
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 2014/30/MitjaK/Attack to Agora/Attack to Agora/Attack to Agora/Attack to Agora/Attack_to_Agora_mitja.cs

    r6434 r6440  
    1414{ 
    1515    Image jouniBoss = LoadImage("jouniboss1"); 
     16    Image jouniHealthbarEmpty = LoadImage("jouniheathbarempty"); 
     17    Image jouniHealthbarFull = LoadImage("jouniheathbarfull"); 
    1618    Animation jounibossArrive; 
    1719 
    1820    Image anttijussiboss = LoadImage("anttijussiboss"); 
     21    Image ajHBarEmpty = LoadImage("ajheathbarempty"); 
     22    Image ajHBarFull = LoadImage("ajheathbarfull"); 
     23 
    1924 
    2025    Elava currentBoss; 
     
    3035    void LuoAmpuvaVihollinen(Vector paikka, double leveys, double korkeus) 
    3136    { 
    32         Elava vihollinen = new Elava(200, 200, 1000); 
     37        Elava vihollinen = new Elava(200, 200, 100); 
    3338        vihollinen.Animation = asemiesLiikkuu; 
    3439        vihollinen.Animation.Start(); 
     
    107112        controlsActive = false; 
    108113 
    109         Elava jouni = new Elava(jouniBoss, 5.0); // 10000 
     114        Elava jouni = new Elava(jouniBoss, 10000); // 10000 
    110115        jouni.Kuoli += JouniDefeated; 
    111116        jouni.Position = luomisPaikka; 
    112         jouni.Shape = Shape.FromImage(jouniBoss); 
     117        // jouni.Shape = Shape.FromImage(jouniBoss); 
    113118        jouni.Tag = "jouni"; 
    114119        jouni.CollisionIgnoreGroup = 1; 
     
    122127        currentBoss = jouni; 
    123128        paaseekoSeuraavaanKenttaan = false; 
     129 
     130        bossHealthBar = new ProgressBar(jouniHealthbarEmpty.Width / 2, jouniHealthbarEmpty.Height / 2); 
     131        bossHealthBar.Position = new Vector(Screen.Right - bossHealthBar.Width / 2, Screen.Top - bossHealthBar.Height / 2); 
     132        bossHealthBar.BindTo(jouni.Elamat); 
     133        bossHealthBar.Image = jouniHealthbarEmpty; 
     134        bossHealthBar.BarImage = jouniHealthbarFull; 
     135        Add(bossHealthBar); 
    124136 
    125137        jouni.NeedsUpdateCall = true; 
     
    207219        currentBossWeapon = null; 
    208220 
     221        bossHealthBar.Destroy(); 
     222 
    209223        Timer.SingleShot(jounihaviaa.Duration.Seconds, delegate  
    210224        { 
     
    217231    } 
    218232 
    219     void LuoAnttiJussi(Vector paikka, Double korkeus, Double leveys) 
    220     { 
    221         Elava anttiJussi = new Elava(42, 42, 100); //hp 10000? 
    222         anttiJussi.Image = anttijussiboss; 
     233    void LuoAnttiJussi(Vector paikka) 
     234    { 
     235        Elava anttiJussi = new Elava(anttijussiboss, 1000); //hp 10000? 
     236        anttiJussi.Kuoli += AJDefeated; 
     237        anttiJussi.Size *= 0.2; 
     238        anttiJussi.Position = paikka; 
     239        anttiJussi.Tag = "anttijussi"; 
    223240        Add(anttiJussi); 
    224     } 
     241 
     242        currentBoss = anttiJussi; 
     243 
     244        bossHealthBar = new ProgressBar(ajHBarEmpty.Width / 2, ajHBarEmpty.Height / 2); 
     245        bossHealthBar.Position = new Vector(Screen.Right - bossHealthBar.Width / 2 - 10, Screen.Top - bossHealthBar.Height / 2 - 10); 
     246        bossHealthBar.BindTo(anttiJussi.Elamat); 
     247        bossHealthBar.Image = ajHBarEmpty; 
     248        bossHealthBar.BarImage = ajHBarFull; 
     249        Add(bossHealthBar); 
     250 
     251        GameObject varjo = Varjo(anttiJussi); 
     252        anttiJussi.Kuoli += delegate { varjo.Destroy(); }; 
     253 
     254 
     255    } 
     256 
     257    void AktivoiAJ() 
     258    { 
     259 
     260    } 
     261 
     262    void AJDefeated() 
     263    { 
     264        currentBoss.CanRotate = true; 
     265        currentBoss.IgnoresCollisionResponse = true; 
     266        currentBoss.AngularVelocity = 40.0; 
     267 
     268        jounihaviaa.Play(); 
     269 
     270        PhysicsObject bBorder = Level.CreateBottomBorder(); 
     271        bBorder.Tag = "bBorder"; 
     272 
     273        AddCollisionHandler<PhysicsObject, PhysicsObject>(currentBoss, "bBorder", delegate { 
     274            Explosion rajahdys = new Explosion(1000); 
     275            rajahdys.Speed = 500.0; 
     276            rajahdys.Position = currentBoss.Position; 
     277            Add(rajahdys); 
     278            currentBoss.Destroy(); 
     279 
     280            currentBoss = null; 
     281        }); 
     282    } 
     283 
    225284    // Aliohjelmat 
    226285} 
Note: See TracChangeset for help on using the changeset viewer.