Changeset 6219
- Timestamp:
- 2015-06-24 07:42:28 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
2015/26/ohjaajat/HillbillyRun/HillbillyRun/HillbillyRun/HillbillyRun/HillbillyRun.cs
r6218 r6219 103 103 public override void Begin() 104 104 { 105 //IntroSequence();105 IntroSequence(); 106 106 //MainMenu(); 107 StartGame();107 //StartGame(); 108 108 } 109 109 … … 169 169 void ShowBackgroundStory() 170 170 { 171 Label storyLabel = new Label("Once upon a time..."); 172 storyLabel.TextColor = Color.Black; 171 ShowStoryText(new Queue<string>(new[] { "Once upon a time...", "...blaa blaa blaa.", "Blaa." })); 172 } 173 174 void ShowStoryText(Queue<string> messages) 175 { 176 // Mennään alkuvalikkoon jos ei ole enää viestejä. 177 if (messages.Count == 0) 178 { 179 MainMenu(); 180 return; 181 } 182 183 // Näytetään nykyinen viesti. 184 var storyLabel = new Label(messages.Dequeue()) { TextColor = Color.Black, TextScale = new Vector(3, 3) }; 173 185 Add(storyLabel); 174 186 175 Timer textTimer = new Timer(); 176 textTimer.Interval = 0.1; 177 textTimer.Timeout += delegate 178 { 179 // lightens text up: 180 storyLabel.TextColor = Color.Lerp(storyLabel.TextColor, Color.Gray, 0.1); 181 }; 187 var textTimer = new Timer { Interval = 0.05 }; 188 textTimer.Timeout += () => storyLabel.TextColor = Color.Lerp(storyLabel.TextColor, Color.White, 0.05); 182 189 textTimer.Start(); 183 // TODO siirrä aliohjelmaan, jolle voi antaa parametrina stringin, joka näytetään siististi feidaamalla esille 184 185 // TODO lisää koko pelin tarina usealla feidailevalla tekstinpätkällä esitettynä 186 187 // Clean up after the intro: 188 Timer.SingleShot(5, delegate // TODO get rid of this fixed amount of seconds 189 { // TODO replace this SingleShot with something else. It must be the last thing after the intro sequence 190 storyLabel.Destroy(); 191 192 ClearAll(); 193 MainMenu(); 194 }); 190 191 // Näytetään seuraava viesti muutaman sekunnin päästä. 192 Timer.SingleShot(4, delegate { storyLabel.Destroy(); ShowStoryText(messages); }); 195 193 } 196 194
Note: See TracChangeset
for help on using the changeset viewer.