- Timestamp:
- 2015-06-23 22:33:21 (8 years ago)
- Location:
- 2015/26/ohjaajat/HillbillyRun/HillbillyRun/HillbillyRun
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
2015/26/ohjaajat/HillbillyRun/HillbillyRun/HillbillyRun/HillbillyRun/HillbillyRun.cs
r6215 r6216 91 91 public override void Begin() 92 92 { 93 //IntroSequence();93 IntroSequence(); 94 94 //MainMenu(); 95 StartGame();95 //StartGame(); 96 96 } 97 97 … … 101 101 Level.Background.Color = Color.Black; 102 102 103 Keyboard.Listen(Key.Escape, ButtonState.Pressed, SkipIntro, "Skip"); 104 105 ShowMadeWithJypeli(); 106 107 Timer.SingleShot(4.0, delegate // TODO get rid of fixed amount of seconds 108 { 109 ShowBackgroundStory(); 110 }); 111 112 113 114 } 115 116 void ShowMadeWithJypeli() 117 { 118 Image madewithImage = LoadImage("madewithjypeli"); 119 120 double w = Window.Width / 4; 121 double h = w * (madewithImage.Height / (double)madewithImage.Width); // take aspect ratio from the picture 122 123 GameObject madewithjypeliObject = new GameObject(w, h); 124 madewithjypeliObject.Image = madewithImage; 125 Add(madewithjypeliObject); 126 127 // Tässä oli jotain epätehokasta feidailua tuolle Made with Jypeli -kuvalle. Ei tunnu päivittyvän joka framella tai on muuten vain tosi raskas... 128 129 //fadeTimer = new Timer(); 130 //fadeTimer.Interval = 0.5; 131 //fadeTimer.Timeout += delegate 132 //{ 133 // madewithjypeliObject.Image = LerpImage(madewithjypeliObject.Image, Color.Black, 0.6); 134 //}; 135 //fadeTimer.Start(5); 136 137 Timer.SingleShot(1.2, delegate 138 { 139 madewithjypeliObject.Destroy(); 140 }); 141 142 } 143 144 Image LerpImage(Image original, Color targetColor, double ratio) 145 { 146 Image newImage = new Image(original.Width, original.Height, Color.Transparent); 147 for (int y = 0; y < original.Height; y++) 148 { 149 for (int x = 0; x < original.Width; x++) 150 { 151 newImage[y, x] = Color.Lerp(original[y, x], targetColor, ratio); 152 } 153 } 154 return newImage; 155 } 156 157 void ShowBackgroundStory() 158 { 103 159 Label storyLabel = new Label("Once upon a time..."); 104 storyLabel.TextColor = Color. Gray;160 storyLabel.TextColor = Color.Black; 105 161 Add(storyLabel); 106 162 107 163 Timer textTimer = new Timer(); 108 textTimer.Interval = 0. 5;164 textTimer.Interval = 0.1; 109 165 textTimer.Timeout += delegate 110 166 { 111 // TODO vaalenna tekstiä näkyville läpinäkyvyyttä tms. säätämällä112 167 // lightens text up: 168 storyLabel.TextColor = Color.Lerp(storyLabel.TextColor, Color.Gray, 0.1); 113 169 }; 114 170 textTimer.Start(); 115 171 // TODO siirrä aliohjelmaan, jolle voi antaa parametrina stringin, joka näytetään siististi feidaamalla esille 116 172 117 118 119 // TODO replace this SingleShot with something else. It must be the last thing after the intro sequence 120 173 // TODO lisää koko pelin tarina usealla feidailevalla tekstinpätkällä esitettynä 174 121 175 // Clean up after the intro: 122 Timer.SingleShot(5, delegate 123 { 176 Timer.SingleShot(5, delegate // TODO get rid of this fixed amount of seconds 177 { // TODO replace this SingleShot with something else. It must be the last thing after the intro sequence 124 178 storyLabel.Destroy(); 125 179 … … 129 183 } 130 184 185 void SkipIntro() 186 { 187 ClearTimers(); 188 ClearAll(); 189 Keyboard.Clear(); 190 MainMenu(); 191 } 192 131 193 void MainMenu() 132 194 { 133 Level.Background.Color = Color. MediumBlue;195 Level.Background.Color = Color.DarkBlue; 134 196 135 197 MultiSelectWindow mainmenu = new MultiSelectWindow("Main menu", … … 218 280 level.SetTileMethod(Color.White, CreateBlockObject); 219 281 level.SetTileMethod(Color.DarkGray, CreateMilk); 220 level.SetTileMethod(Color.Gray, CreateCrawly); 282 level.SetTileMethod(Color.Gray, CreateCrawly); 221 283 level.SetTileMethod(Color.Red, CreateDummy, Color.Red); //TODO: CreateWitch 222 284 level.SetTileMethod(Color.Rose, CreateFlame); … … 396 458 bool wheat = probability < 20; 397 459 398 if (wheat)460 if (wheat) 399 461 { 400 462 GameObject wheatBlock = new GameObject(width * 1.5, height * 3); -
2015/26/ohjaajat/HillbillyRun/HillbillyRun/HillbillyRun/HillbillyRunContent/HillbillyRunContent.contentproj
r6213 r6216 108 108 </ItemGroup> 109 109 <ItemGroup> 110 <Compile Include="madewithjypeli.png"> 111 <Name>madewithjypeli</Name> 112 <Importer>TextureImporter</Importer> 113 <Processor>TextureProcessor</Processor> 114 </Compile> 115 </ItemGroup> 116 <ItemGroup> 110 117 <Compile Include="crawl.anim"> 111 118 <Name>crawl</Name>
Note: See TracChangeset
for help on using the changeset viewer.