Ignore:
Timestamp:
2015-06-15 18:58:57 (5 years ago)
Author:
sieerinn
Message:
 
File:
1 edited

Legend:

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

    r6106 r6108  
    231231    Image partikkeliKuva = LoadImage("partikkeli"); 
    232232    Image taideVeri = LoadImage("taideveri"); 
     233    private Image[] loppuKuvat = LoadImages2(1, 35, "break/b{0:0000}"); 
    233234    #endregion 
    234235 
     
    399400    { 
    400401        ClearAll(); 
    401         GameObject spurdo = new GameObject(Screen.Width, Screen.Height); 
    402         spurdo.Image = kultuuriKuvat[2][0]; 
    403         Add(spurdo); 
     402        Level.Background.Color = Color.Black; 
     403        var patsas = new GameObject(400, 300); 
     404        patsas.Image = loppuKuvat[0]; 
     405        patsas.Animation = new Animation(loppuKuvat) { FPS = 20, StopOnLastFrame = true }; 
     406        Add(patsas); 
     407 
     408        Timer.SingleShot(3.0, delegate 
     409        { 
     410            patsas.Animation.Start(1); 
     411            hajotusAanet[1].Play(); 
     412        }); 
    404413 
    405414        Label havisit = new Label("Hävisit muuten belin"); 
    406         havisit.Color = Color.HotPink; 
    407         havisit.Size = new Vector(300, 300); 
    408         havisit.Position = new Vector(Level.Right - havisit.Width, Level.Top - havisit.Height * 0.5); 
     415        havisit.TextColor = Color.Black; 
     416        havisit.TextScale *= 3; 
     417        havisit.Top = Screen.Top - 30.0; 
    409418        Add(havisit, 2); 
     419 
     420        const double fadeAika = 5.0; 
     421        var fadeAjastin = new Timer(); 
     422        fadeAjastin.Interval = 0.02; 
     423        fadeAjastin.Timeout += delegate 
     424        { 
     425            havisit.TextColor = Color.Lerp(Color.Black, Color.White, fadeAjastin.SecondCounter.Value / fadeAika); 
     426            if (fadeAjastin.SecondCounter.Value > fadeAika) 
     427            { 
     428                fadeAjastin.Stop(); 
     429            } 
     430        }; 
     431        fadeAjastin.Start(); 
     432 
     433        Keyboard.Listen(Key.Escape, ButtonState.Pressed, delegate { ClearAll(); Begin(); }, null); 
    410434    } 
    411435 
Note: See TracChangeset for help on using the changeset viewer.