- Timestamp:
- 2012-06-06 21:57:25 (11 years ago)
- Location:
- 2012/23/LeoS
- Files:
-
- 2 added
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
2012/23/LeoS/leoS/leoS/bin/x86/Debug/Content/kentta1.txt
r2818 r2824 17 17 # # # 18 18 # # # 19 20 P #### #### #### # 19 W # T # ####### 20 P #### #### #### # T T 21 21 ############ ######### -
2012/23/LeoS/leoS/leoS/leoS.cs
r2820 r2824 9 9 public class LeoS : PhysicsGame 10 10 { 11 12 13 11 PhysicsObject pelaaja; 14 12 bool pelaajaIlmassa = false; 15 13 SoundEffect hyppyAani = LoadSoundEffect("Jump"); 16 14 17 15 18 16 public override void Begin() 19 17 { 20 MultiSelectWindow valikko = new MultiSelectWindow("Menu", 21 "Level 1", "Level 2", "Level 3", "Level 4", "Exit Game"); valikko.ItemSelected += PainettiinValikonNappia; 18 ClearAll(); 19 MultiSelectWindow valikko = new MultiSelectWindow ("Menu", "Control Help", "Level 1", "Level 2", "Level 3", 20 "Level 4", "Exit Game" ); valikko.ItemSelected += PainettiinValikonNappia; 21 valikko.Color = Color.Gold; 22 valikko.DefaultCancel = -1; 22 23 Add(valikko); 23 24 25 24 } 26 25 … … 29 28 void AloitaPeli(string levelFile) 30 29 { 31 32 33 ClearAll(); 34 LataaKentta(levelFile); 35 30 LataaKentta(levelFile); 31 36 32 37 33 Level.Background.CreateGradient(Color.Teal, Color.Ruby); … … 50 46 Add(oikeareuna); 51 47 AsetaOhjaimet(); 52 53 48 Camera.Follow(pelaaja); 54 55 49 } 56 50 … … 61 55 { 62 56 case 0: 57 Ohjeet(); 58 break; 59 case 1: 63 60 AloitaPeli("kentta1"); 64 61 break; 65 case 1:62 case 2: 66 63 AloitaPeli("kentta2"); 67 64 break; 68 case 2:65 case 3: 69 66 AloitaPeli("kentta3"); 70 67 break; 71 case 3:68 case 4: 72 69 AloitaPeli2("kentta4"); 73 70 break; 74 case 4:71 case 5: 75 72 Exit(); 76 73 break; 77 78 74 } 79 75 } 80 81 82 83 void LuoKentta(string levelFile) 84 { 85 86 } 87 88 void LataaKentta(string levelFile) 76 void LataaKentta(string levelFile) 89 77 { 90 78 TileMap ruudut = TileMap.FromLevelAsset(levelFile); … … 93 81 ruudut.SetTileMethod('*', LuoEste); 94 82 ruudut.SetTileMethod('T', LuoTykki); 95 96 83 ruudut.SetTileMethod('W', LuoExtra); 97 84 ruudut.Execute(20, 20); 98 85 } … … 113 100 } 114 101 102 void LuoExtra(Vector paikka, double leveys, double korkeus) 103 { 104 PhysicsObject extra = PhysicsObject.CreateStaticObject(leveys, 105 korkeus, Shape.Ellipse); 106 extra.Position = paikka; 107 extra.Color = Color.Ivory; 108 Add(extra); 109 } 110 111 112 115 113 void PelaajaOsuiReunaan(PhysicsObject tormaaja, PhysicsObject kohde) 116 114 { 117 115 tormaaja.Destroy(); 118 Explosion rajahdys = new Explosion( 600.0);116 Explosion rajahdys = new Explosion(500.0); 119 117 rajahdys.Position = pelaaja.Position; 120 118 Add(rajahdys); … … 123 121 tekstikentta.TextColor = Color.Black; 124 122 Add(tekstikentta); 125 126 127 123 tekstikentta.Font = Font.DefaultLarge; 128 124 LuoAikaLaskuri(); … … 155 151 Keyboard.Listen(Key.Up, ButtonState.Pressed, Hyppy, "Pelaaja 1: Liiku", pelaaja); 156 152 Keyboard.Listen(Key.Down, ButtonState.Pressed, Hyppy2, "Hyppää alas", pelaaja); 157 158 153 } 159 154 … … 163 158 pelaaja.Velocity = nopeus; 164 159 } 165 160 166 161 void Hyppy(PhysicsObject pelaaja) 167 162 { … … 170 165 pelaaja.Velocity = nopeus; 171 166 pelaajaIlmassa = true; 167 hyppyAani.Play(); 168 172 169 } 173 170 void PelaajaOsuiMuuriin(PhysicsObject tormaaja, PhysicsObject kohde) … … 198 195 199 196 } 200 201 197 202 198 void LuoTykki(Vector paikka, double leveys, double korkeus) … … 215 211 ampumisAjastin.Start(); 216 212 ampumisAjastin.Timeout += delegate { ase.Shoot(); }; 217 218 213 } 219 214 … … 226 221 tekstikentta.TextColor = Color.Red; 227 222 tekstikentta.Font = Font.DefaultLargeBold; 228 tekstikentta.X = Screen.Left + 0;229 tekstikentta.Y = Screen.Top + 300;230 223 Add(tekstikentta); 231 224 kohde.Destroy(); … … 261 254 pelaaja.Velocity = nopeus; 262 255 pelaajaIlmassa = true; 263 264 265 266 267 } 268 void LuoAikaLaskuri() 269 { 270 Timer aikaLaskuri = new Timer(); 271 aikaLaskuri.Interval = 2.5; 272 aikaLaskuri.Timeout += delegate { Begin(); }; 273 aikaLaskuri.Start(1); 256 hyppyAani.Play(); 257 258 259 260 } 261 void LuoAikaLaskuri() 262 { 263 Timer aikaLaskuri = new Timer(); 264 aikaLaskuri.Interval = 2.5; 265 aikaLaskuri.Timeout += delegate { Begin(); }; 266 aikaLaskuri.Start(1); 267 } 268 void Ohjeet() 269 { 270 LuoAikaLaskuri2(); 271 272 Label tekstikentta = new Label("teksti"); 273 tekstikentta.Text = "You Jump with UP-Button,Move Forward with RIGHT-Button and Jump Down with DOWN-Button"; 274 tekstikentta.TextColor = Color.Red; 275 tekstikentta.Font = Font.DefaultLargeBold; 276 Add(tekstikentta); 277 278 Label tekstikentta2 = new Label("teksti"); 279 tekstikentta2.Text = "This screen is readable about 5 seconds"; 280 tekstikentta2.TextColor = Color.Yellow; 281 tekstikentta2.Font = Font.DefaultLargeBold; 282 tekstikentta2.X = 0.0; 283 tekstikentta2.Y = -80.0; 284 Add(tekstikentta2); 285 } 286 void LuoAikaLaskuri2() 287 { 288 Timer aikaLaskuri = new Timer(); 289 aikaLaskuri.Interval = 5; 290 aikaLaskuri.Timeout += delegate { Begin(); }; 291 aikaLaskuri.Start(); 292 293 } 294 void Poiminta() 295 { 274 296 297 } 275 298 } 276 } 277 278 279 280 281 282 299 300 301 302 303 -
2012/23/LeoS/leoS/leoS/leoS.csproj.Debug.cachefile
r2818 r2824 6 6 Content\kentta4.xnb 7 7 Content\Tausta2.xnb 8 Content\Jump.xnb 8 9 Content\Tausta.wma 9 10 Content\Tausta2.wma -
2012/23/LeoS/leoS/leoS/obj/x86/Debug/cachefile-{25605763-3341-4275-93D9-4B0A394A16A7}-targetpath.txt
r2818 r2824 8 8 Content\Tausta2.xnb 9 9 Content\Tausta2.wma 10 Content\Jump.xnb 10 11 Content\kentta1.txt -
2012/23/LeoS/leoS/leoS/obj/x86/Debug/leoS.csproj.FileListAbsolute.txt
r2818 r2824 33 33 J:\LeoS\LeoS\leoS\leoS\bin\x86\Debug\Content\Tausta2.xnb 34 34 J:\LeoS\LeoS\leoS\leoS\bin\x86\Debug\Content\Tausta2.wma 35 J:\LeoS\LeoS\leoS\leoS\bin\x86\Debug\Content\Jump.xnb -
2012/23/LeoS/leoS/leoSContent/kentta1.txt
r2818 r2824 17 17 # # # 18 18 # # # 19 20 P #### #### #### # 19 W # T # ####### 20 P #### #### #### # T T 21 21 ############ ######### -
2012/23/LeoS/leoS/leoSContent/leoSContent.contentproj
r2818 r2824 94 94 </Compile> 95 95 </ItemGroup> 96 <ItemGroup> 97 <Compile Include="Jump.wav"> 98 <Name>Jump</Name> 99 <Importer>WavImporter</Importer> 100 <Processor>SoundEffectProcessor</Processor> 101 </Compile> 102 </ItemGroup> 96 103 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 97 104 <!-- To modify your build process, add your task inside one of the targets below and uncomment it. -
2012/23/LeoS/leoS/leoSContent/obj/x86/Debug/ContentPipeline.xml
r2820 r2824 18 18 <Options>None</Options> 19 19 <Output>J:\LeoS\LeoS\leoS\leoS\bin\x86\Debug\Content\kentta1.xnb</Output> 20 <Time>2012-06-06T 13:46:59.5806075+03:00</Time>20 <Time>2012-06-06T21:54:58.6389427+03:00</Time> 21 21 </Item> 22 22 <Item> … … 55 55 <Options>None</Options> 56 56 <Output>J:\LeoS\LeoS\leoS\leoS\bin\x86\Debug\Content\kentta4.xnb</Output> 57 <Time>2012-06-06T16:33: 05.0435956+03:00</Time>57 <Time>2012-06-06T16:33:17.9995956+03:00</Time> 58 58 </Item> 59 59 <Item> … … 66 66 <Extra>J:\LeoS\LeoS\leoS\leoS\bin\x86\Debug\Content\Tausta2.wma</Extra> 67 67 <Time>2012-06-06T14:56:16.5106058+03:00</Time> 68 </Item> 69 <Item> 70 <Source>Jump.wav</Source> 71 <Name>Jump</Name> 72 <Importer>WavImporter</Importer> 73 <Processor>SoundEffectProcessor</Processor> 74 <Options>None</Options> 75 <Output>J:\LeoS\LeoS\leoS\leoS\bin\x86\Debug\Content\Jump.xnb</Output> 76 <Time>2012-06-06T19:14:48.3999495+03:00</Time> 68 77 </Item> 69 78 <BuildSuccessful>true</BuildSuccessful>
Note: See TracChangeset
for help on using the changeset viewer.