Changeset 2638 for 2010


Ignore:
Timestamp:
2011-12-27 17:27:06 (8 years ago)
Author:
hniemi
Message:

voittosplashi lisätty ja back-nappula kentänvalintavalikkoon lisätty

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 2010/23/hniemi/BlockPusher/Blockpusher/Blockpusher/Blockpusher.cs

    r2637 r2638  
    5454        currentLevelIndex = levelIndex; 
    5555        currentLevel = levels[levelIndex].Clone(); 
    56         currentLevel.Victory += Victory; 
     56        currentLevel.Victory += VictorySplash; 
    5757        currentLevel.AddToGame(); 
    5858        SetControls(); 
     
    128128        w.AddItemHandler(1, delegate { SetControls(); w.Close(); }); 
    129129        Add(w); 
     130    } 
     131 
     132    /// <summary> 
     133    /// Shows "Victory"-label 
     134    /// </summary> 
     135    public void VictorySplash()  
     136    { 
     137        Label victory = new Label("Victory!"); 
     138        victory.Color = Color.DarkCyan; 
     139        victory.TextColor = Color.Fuchsia; 
     140 
     141        Add(victory); 
     142 
     143        Timer.SingleShot(1, Victory); 
    130144    } 
    131145 
     
    155169 
    156170        Widget buttons = new Widget(new HorizontalLayout()); 
     171        Widget bottomButtons = new Widget(new HorizontalLayout()); 
     172 
    157173        PushButton previous = new PushButton(150, buttonheight, "Previous"); 
    158174        buttons.Add(previous); 
    159175 
    160         PushButton play = new PushButton(150, buttonheight, "Select"); 
    161         buttons.Add(play); 
    162  
    163176        PushButton next = new PushButton(150, buttonheight, "Next"); 
    164177        buttons.Add(next); 
     
    166179        Label name = new Label(levels[current].Name); 
    167180 
    168         topic.Y = Screen.Top - (topic.Height/2); 
    169         buttons.Y = topic.Bottom - (buttons.Height / 2); 
     181        PushButton back = new PushButton(150, buttonheight, "Back"); 
     182        bottomButtons.Add(back); 
     183 
     184        PushButton play = new PushButton(150, buttonheight, "Select"); 
     185        bottomButtons.Add(play); 
     186 
     187        topic.Top = Screen.Top; 
     188        buttons.Top = topic.Bottom; 
    170189        name.Y = buttons.Bottom - (name.Height / 2); 
     190 
     191        bottomButtons.Bottom = Screen.Bottom; 
    171192         
    172193        Add(topic); 
    173194        Add(buttons); 
    174195        Add(name); 
     196        Add(bottomButtons); 
    175197 
    176198        levels[current].AddToGame(); 
     
    179201        next.Clicked += delegate { LevelSelectionMenu((current + 1) % levels.Count); }; 
    180202        play.Clicked += delegate { NewGame(current); }; 
     203        back.Clicked += Menu; 
    181204 
    182205    } 
     
    190213        ClearAll(); 
    191214        currentLevel = new BlockLevel(this); 
    192         currentLevel.Victory += Victory; 
     215        currentLevel.Victory += VictorySplash; 
    193216 
    194217        currentLevel.CreateField(ReadFile("Data/CurrentSave.txt")); 
Note: See TracChangeset for help on using the changeset viewer.