- Timestamp:
- 2016-07-29 11:31:42 (7 years ago)
- Location:
- 2016/30/KasimirP
- Files:
-
- 15 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
2016/30/KasimirP/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1.cs
r8212 r8243 32 32 int index = 0; 33 33 34 bool SuperVoima = false; 35 36 //SoundEffect maaliAani = LoadSoundEffect("illuminati"); 34 bool SuperVoima = false, alkanut = false; 35 36 SoundEffect maaliAani = LoadSoundEffect("Powerup5"); 37 SoundEffect voimaLoppuu = LoadSoundEffect("Powerup8"); 37 38 38 39 public override void Begin() 40 41 { 42 Valikko(); 43 44 } 45 46 47 48 void LuoKentta() 39 49 { 40 50 Gravity = new Vector(0, -1000); 41 42 LuoKentta(); 43 LisaaNappaimet(); 44 Level.CreateBorders(); 45 Camera.Follow(pelaaja1); 46 Camera.ZoomFactor = 1.2; 47 Camera.StayInLevel = true; 48 SmoothTextures = false; 49 Window.Fullscreen = true; 50 } 51 52 void LuoKentta() 53 { 51 54 52 TileMap kentta = TileMap.FromLevelAsset("kentta1"); 55 53 kentta.SetTileMethod('#', LisaaTaso); … … 61 59 kentta.SetTileMethod('F', LisaaLentovihu); 62 60 kentta.Execute(RUUDUN_KOKO, RUUDUN_KOKO); 63 61 62 LisaaNappaimet(); 63 Level.CreateBorders(); 64 Camera.Follow(pelaaja1); 65 Camera.ZoomFactor = 1.2; 66 Camera.StayInLevel = true; 67 SmoothTextures = false; 68 Window.Fullscreen = true; 69 MediaPlayer.Play("musa"); 70 MediaPlayer.IsRepeating = true; 71 MediaPlayer.Volume = 0.5; 72 64 73 //Level.Background.CreateGradient(Color.White, Color.LimeGreen); 65 74 Level.Background.Image = kek; … … 72 81 BRAIN.FarBrain = new RandomMoverBrain(); 73 82 //lentokone.Brain = BRAIN; 74 83 alkanut = true; 75 84 } 76 85 … … 103 112 tahti.Image = tahtiKuva; 104 113 tahti.Tag = "tahti"; 114 105 115 Add(tahti); 106 116 } … … 155 165 156 166 lentokone.Position = paikka; 157 lentokone.IgnoresGravity = true;167 lentokone.IgnoresGravity = false; 158 168 Add(lentokone); 159 169 } … … 162 172 { 163 173 164 PhysicsObject s = PhysicsObject.CreateStaticObject(Shrek); 165 s.Mass = 0; 166 s.Position = paikka + new Vector(0, s.Height / 43 / 2); 167 s.Width /= 20; 168 s.Height /= 20; 174 PhysicsObject s = PhysicsObject.CreateStaticObject(60,80); 175 s.Image = Shrek; 176 s.Position = paikka; 177 s.Bottom = paikka.Y - korkeus / 2; 169 178 s.Tag = "Shrek"; 170 171 172 179 173 180 Add(s); … … 184 191 Keyboard.Listen(Key.Right, ButtonState.Down, Liikuta, "Liikkuu vasemmalle", pelaaja1, nopeus); 185 192 Keyboard.Listen(Key.Up, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", pelaaja1, hyppyNopeus); 193 Keyboard.Listen(Key.R, ButtonState.Pressed, AloitaAlusta, "Aloita alusta"); 186 194 187 195 ControllerOne.Listen(Button.Back, ButtonState.Pressed, Exit, "Poistu pelistä"); … … 190 198 ControllerOne.Listen(Button.DPadRight, ButtonState.Down, Liikuta, "Pelaaja liikkuu oikealle", pelaaja1, nopeus); 191 199 ControllerOne.Listen(Button.A, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", pelaaja1, hyppyNopeus); 200 192 201 193 202 /*Keyboard.Listen(Key.Right, ButtonState.Down, pelaaja1.Animation.Start, ""); … … 201 210 base.Update(time); 202 211 203 if (pelaaja1.Velocity.X == 0) 212 if (!alkanut) 213 { 214 return; 215 } 216 217 if (pelaaja1.Velocity.X == 0) 204 218 { 205 219 pelaaja1.Animation.Stop(); … … 234 248 void TormaaTahteen(PhysicsObject hahmo, PhysicsObject tahti) 235 249 { 236 //§§maaliAani.Play();250 maaliAani.Play(); 237 251 Supervoima(); 238 MessageDisplay.Add("Keräsit superlehden xd! ");252 MessageDisplay.Add("Keräsit superlehden xd! Voit nyt tappaa Pepejä xd"); 239 253 tahti.Destroy(); 240 254 } … … 259 273 rajahdusSysteemi.AddEffect(a.Position, 50); 260 274 a.Destroy(); 275 276 MediaPlayer.Play("loppumusa"); 277 MediaPlayer.Volume = 2; 261 278 } 262 279 } … … 270 287 rajahdusSysteemi.AddEffect(a.Position, 50); 271 288 a.Destroy(); 289 290 MediaPlayer.Play("loppumusa"); 272 291 } 273 292 … … 280 299 rajahdusSysteemi.AddEffect(a.Position, 50); 281 300 a.Destroy(); 301 302 MediaPlayer.Play("loppumusa"); 282 303 } 283 304 … … 291 312 { 292 313 MessageDisplay.Add("Supervoima loppui xdddd"); 314 voimaLoppuu.Play(); 293 315 SuperVoima = false; 294 316 } 295 317 318 void Valikko() 319 { 320 MultiSelectWindow alkuValikko = new MultiSelectWindow("pelin alkuvalikko", "Aloita peli", "Lopeta :D"); 321 alkuValikko.AddItemHandler(0, LuoKentta); 322 alkuValikko.AddItemHandler(1, Exit); 323 Add(alkuValikko); 324 Mouse.IsCursorVisible = true; 325 } 326 void AloitaAlusta() 327 { 328 ClearAll(); 329 Valikko(); 330 } 331 296 332 } -
2016/30/KasimirP/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1.csproj.Debug.cachefile
r8212 r8243 18 18 Content\illuminati.xnb 19 19 Content\yee.xnb 20 Content\musa.xnb 21 Content\Powerup5.xnb 22 Content\Powerup8.xnb 23 Content\loppumusa.xnb 20 24 Content\illuminati.wma 25 Content\musa.wma 26 Content\loppumusa.wma -
2016/30/KasimirP/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1/obj/x86/Debug/ContentPipeline-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}.xml
r8212 r8243 36 36 <Options>None</Options> 37 37 <Output>C:\MyTemp\KasimirP\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\kentta1.xnb</Output> 38 <Time>2016-07-2 8T14:53:05.2303945+03:00</Time>38 <Time>2016-07-29T10:42:26.4507707+03:00</Time> 39 39 </Item> 40 40 <Item> … … 173 173 <Output>C:\MyTemp\KasimirP\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\yee.xnb</Output> 174 174 <Time>2016-07-28T13:36:50.8149752+03:00</Time> 175 </Item> 176 <Item> 177 <Source>musa.mp3</Source> 178 <Name>musa</Name> 179 <Importer>Mp3Importer</Importer> 180 <Processor>SongProcessor</Processor> 181 <Options>None</Options> 182 <Output>C:\MyTemp\KasimirP\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\musa.xnb</Output> 183 <Extra>C:\MyTemp\KasimirP\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\musa.wma</Extra> 184 <Time>2016-07-29T09:49:46.3498707+03:00</Time> 185 </Item> 186 <Item> 187 <Source>Powerup5.wav</Source> 188 <Name>Powerup5</Name> 189 <Importer>WavImporter</Importer> 190 <Processor>SoundEffectProcessor</Processor> 191 <Options>None</Options> 192 <Output>C:\MyTemp\KasimirP\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\Powerup5.xnb</Output> 193 <Time>2016-07-29T10:07:46.0457707+03:00</Time> 194 </Item> 195 <Item> 196 <Source>Powerup8.wav</Source> 197 <Name>Powerup8</Name> 198 <Importer>WavImporter</Importer> 199 <Processor>SoundEffectProcessor</Processor> 200 <Options>None</Options> 201 <Output>C:\MyTemp\KasimirP\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\Powerup8.xnb</Output> 202 <Time>2016-07-29T10:11:34.7463707+03:00</Time> 203 </Item> 204 <Item> 205 <Source>loppumusa.mp3</Source> 206 <Name>loppumusa</Name> 207 <Importer>Mp3Importer</Importer> 208 <Processor>SongProcessor</Processor> 209 <Options>None</Options> 210 <Output>C:\MyTemp\KasimirP\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\loppumusa.xnb</Output> 211 <Extra>C:\MyTemp\KasimirP\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\loppumusa.wma</Extra> 212 <Time>2016-07-29T10:28:04.3465707+03:00</Time> 175 213 </Item> 176 214 <BuildSuccessful>true</BuildSuccessful> -
2016/30/KasimirP/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1/obj/x86/Debug/Tasohyppelypeli1.csproj.FileListAbsolute.txt
r8212 r8243 27 27 C:\MyTemp\KasimirP\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\illuminati.wma 28 28 C:\MyTemp\KasimirP\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\yee.xnb 29 C:\MyTemp\KasimirP\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\musa.xnb 30 C:\MyTemp\KasimirP\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\musa.wma 31 C:\MyTemp\KasimirP\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\Powerup5.xnb 32 C:\MyTemp\KasimirP\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\Powerup8.xnb 33 C:\MyTemp\KasimirP\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\loppumusa.xnb 34 C:\MyTemp\KasimirP\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\loppumusa.wma -
2016/30/KasimirP/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1/obj/x86/Debug/cachefile-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}-targetpath.txt
r8212 r8243 19 19 Content\illuminati.wma 20 20 Content\yee.xnb 21 Content\musa.xnb 22 Content\musa.wma 23 Content\Powerup5.xnb 24 Content\Powerup8.xnb 25 Content\loppumusa.xnb 26 Content\loppumusa.wma -
2016/30/KasimirP/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1Content/Tasohyppelypeli1Content.contentproj
r8212 r8243 164 164 </Compile> 165 165 </ItemGroup> 166 <ItemGroup> 167 <Compile Include="musa.mp3"> 168 <Name>musa</Name> 169 <Importer>Mp3Importer</Importer> 170 <Processor>SongProcessor</Processor> 171 </Compile> 172 </ItemGroup> 173 <ItemGroup> 174 <Compile Include="Powerup5.wav"> 175 <Name>Powerup5</Name> 176 <Importer>WavImporter</Importer> 177 <Processor>SoundEffectProcessor</Processor> 178 </Compile> 179 </ItemGroup> 180 <ItemGroup> 181 <Compile Include="Powerup8.wav"> 182 <Name>Powerup8</Name> 183 <Importer>WavImporter</Importer> 184 <Processor>SoundEffectProcessor</Processor> 185 </Compile> 186 </ItemGroup> 187 <ItemGroup> 188 <Compile Include="loppumusa.mp3"> 189 <Name>loppumusa</Name> 190 <Importer>Mp3Importer</Importer> 191 <Processor>SongProcessor</Processor> 192 </Compile> 193 </ItemGroup> 166 194 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 167 195 <!-- To modify your build process, add your task inside one of the targets below and uncomment it. -
2016/30/KasimirP/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1Content/kentta1.txt
r8212 r8243 1 1 2 3 ............................#######....... ................X....X...X......X...X.........X*.................2 ..............................................................................................X............ 3 ............................#######.......X...............X....X...X......X...X.........X*...###........... 4 4 .......................X.................###....X.......########################........###................ 5 .N..................######.....................########..........................X... ......................6 .................................*....... ......................................#####.......................5 .N..................######.....................########..........................X...#........KKK.......... 6 .................................*.......K.....................................#####..........###.......... 7 7 ##################.............#####...####................................................................ 8 8 ##################LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL
Note: See TracChangeset
for help on using the changeset viewer.