- Timestamp:
- 2011-12-27 17:27:06 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
2010/23/hniemi/BlockPusher/Blockpusher/Blockpusher/Blockpusher.cs
r2637 r2638 54 54 currentLevelIndex = levelIndex; 55 55 currentLevel = levels[levelIndex].Clone(); 56 currentLevel.Victory += Victory ;56 currentLevel.Victory += VictorySplash; 57 57 currentLevel.AddToGame(); 58 58 SetControls(); … … 128 128 w.AddItemHandler(1, delegate { SetControls(); w.Close(); }); 129 129 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); 130 144 } 131 145 … … 155 169 156 170 Widget buttons = new Widget(new HorizontalLayout()); 171 Widget bottomButtons = new Widget(new HorizontalLayout()); 172 157 173 PushButton previous = new PushButton(150, buttonheight, "Previous"); 158 174 buttons.Add(previous); 159 175 160 PushButton play = new PushButton(150, buttonheight, "Select");161 buttons.Add(play);162 163 176 PushButton next = new PushButton(150, buttonheight, "Next"); 164 177 buttons.Add(next); … … 166 179 Label name = new Label(levels[current].Name); 167 180 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; 170 189 name.Y = buttons.Bottom - (name.Height / 2); 190 191 bottomButtons.Bottom = Screen.Bottom; 171 192 172 193 Add(topic); 173 194 Add(buttons); 174 195 Add(name); 196 Add(bottomButtons); 175 197 176 198 levels[current].AddToGame(); … … 179 201 next.Clicked += delegate { LevelSelectionMenu((current + 1) % levels.Count); }; 180 202 play.Clicked += delegate { NewGame(current); }; 203 back.Clicked += Menu; 181 204 182 205 } … … 190 213 ClearAll(); 191 214 currentLevel = new BlockLevel(this); 192 currentLevel.Victory += Victory ;215 currentLevel.Victory += VictorySplash; 193 216 194 217 currentLevel.CreateField(ReadFile("Data/CurrentSave.txt"));
Note: See TracChangeset
for help on using the changeset viewer.