Changeset 9379 for 2017/31/PatrikK/Tasohyppelypeli/Tasohyppelypeli
- Timestamp:
- 2017-08-03 11:54:39 (2 years ago)
- Location:
- 2017/31/PatrikK/Tasohyppelypeli/Tasohyppelypeli
- Files:
-
- 16 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
2017/31/PatrikK/Tasohyppelypeli/Tasohyppelypeli/Tasohyppelypeli/BEST_GAME_EVER.cs
r9349 r9379 6 6 using Jypeli.Effects; 7 7 using Jypeli.Widgets; 8 class Kranaatinheitin:Cannon 9 { 10 public Kranaatinheitin(double leveys, double korkeus) 11 : base(leveys, korkeus) 12 { 13 14 } 15 } 8 16 9 17 public class Tasohyppelypeli : PhysicsGame … … 42 50 } 43 51 void AloitaPeli() 44 { 52 { 53 SmoothTextures = false; 45 54 ClearAll(); 46 55 Gravity = new Vector(0, -1000); … … 73 82 Level.CreateBorders(); 74 83 //Level.Background.CreateGradient(Color.White, Color.SkyBlue); 75 Level.Background.Image = LoadImage(" background");84 Level.Background.Image = LoadImage("parallax-mountain-bg"); 76 85 //Level.Background.TextureWrapSize = new Vector(2.0, 1.0); 77 86 Level.Background.FitToLevel(); … … 88 97 PhysicsObject taso = PhysicsObject.CreateStaticObject(leveys, korkeus); 89 98 taso.Position = paikka; 90 taso.Image = LoadImage(" ruoho");99 taso.Image = LoadImage("bricks"); 91 100 Add(taso); 92 101 //taso.MakeOneWay(); … … 108 117 store.Position = paikka+new Vector(0.0,korkeus / 2.0); 109 118 store.Image = LoadImage("store"); 110 Add(store); 119 Add(store,3); 120 int pMaxMaara = 100; 121 ExplosionSystem rajahdys = 122 new ExplosionSystem(LoadImage("dollar"), pMaxMaara); 123 Add(rajahdys); 124 125 double x = store.X; 126 double y = store.Y; 127 int pMaara = 1; 128 rajahdys.MaxScale = 70; 129 rajahdys.MinScale = 40; 130 rajahdys.MaxLifetime = 2; 131 rajahdys.MaxVelocity = 25; 132 Timer ajastin = new Timer(); 133 ajastin.Interval = 0.1; 134 ajastin.Timeout += delegate { rajahdys.AddEffect(x, y, pMaara); }; 135 ajastin.Start(); 111 136 store.Tag = "store"; 112 137 //taso.MakeOneWay(); … … 131 156 if (pelaaja1.Weapon is Cannon) 132 157 pelaaja1.Weapon.FireRate = 0.2; 133 else if (pelaaja1.Weapon is PlasmaCannon) 134 pelaaja1.Weapon.FireRate = 5.0; 135 else if (pelaaja1.Weapon is LaserGun) 136 pelaaja1.Weapon.FireRate = 100.0; 158 pelaaja1.Weapon.AmmoIgnoresGravity = false; 137 159 138 160 pelaaja1.Destroyed += GameOver; … … 158 180 Keyboard.Listen(Key.D, ButtonState.Down, Liikuta, "Liikkuu vasemmalle", pelaaja1, 1.0); 159 181 Keyboard.Listen(Key.W, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", pelaaja1, hyppyNopeus); 182 Keyboard.Listen(Key.T, ButtonState.Pressed, Rajayta, ("Räjäytä itsesi")); 160 183 Keyboard.Listen(Key.Space, ButtonState.Released, LentoLopuu, "Lopeta lento", pelaaja1); 161 184 Keyboard.Listen(Key.G, ButtonState.Pressed, HeitaKranaatti, ("Heitä kranaatti"), pelaaja1); 162 185 Keyboard.Listen(Key.Enter, ButtonState.Pressed, Konsoli, "Käytä huijauskoodeja - et pääse top 10:n"); 163 186 Keyboard.Listen(Key.Space, ButtonState.Down, Lento, "Lennä"); 164 Keyboard.Listen(Key.Space, ButtonState.Released, EiLento, "Lopeta lento");187 Keyboard.Listen(Key.Space, ButtonState.Released, EiLento, null); 165 188 Mouse.Listen(MouseButton.Left, ButtonState.Down, AmmuAseella, "Ammu", pelaaja1); 189 Mouse.ListenWheel(ZoomWheel, "Zoomaa"); 166 190 ControllerOne.Listen(Button.Back, ButtonState.Pressed, Exit, "Poistu pelistä"); 167 191 … … 171 195 172 196 PhoneBackButton.Listen(ConfirmExit, "Lopeta peli"); 197 } 198 void ZoomWheel() 199 { 200 Camera.Zoom(Mouse.WheelChange * 0.1); 201 } 202 void Rajayta() 203 { 204 int pMaxMaara = 50; 205 ExplosionSystem rajahdys = 206 new ExplosionSystem(LoadImage("rajahdys"), pMaxMaara); 207 208 Add(rajahdys); 209 210 double x = pelaaja1.X; 211 double y = pelaaja1.Y; 212 int pMaara = 500; 213 rajahdys.MaxVelocity = 1; 214 rajahdys.MaxScale = 20; 215 rajahdys.MinScale = 10; 216 rajahdys.MaxLifetime = 2; 217 rajahdys.AddEffect(x, y, pMaara); 173 218 } 174 219 … … 251 296 252 297 //ammus.Image = LoadImage("ammus"); 253 if (pelaaja1.Weapon is Cannon) 298 if (pelaaja1.Weapon is Kranaatinheitin) 299 { 300 ammus.Image = LoadImage("grenade"); 301 ammus.Size *= 1.5; 302 Timer.SingleShot(3, delegate 303 { 304 Explosion rajahdys = new Explosion(125); 305 rajahdys.Position = ammus.Position; 306 Add(rajahdys); 307 rajahdys.AddShockwaveHandler("VIHOLLINEN", KranaattiOsui); 308 309 }); 310 } 311 else if (pelaaja1.Weapon is Cannon) 254 312 { 255 313 ammus.Image = LoadImage("cannonball"); 256 314 ammus.Size *= 1.5; 315 ammus.IgnoresCollisionResponse = false; 257 316 } 258 317 else if (pelaaja1.Weapon is PlasmaCannon) … … 260 319 ammus.Image = LoadImage("plasma"); 261 320 ammus.Size *= 5.0; 321 ammus.CollisionIgnoreGroup = 3; 262 322 } 263 323 … … 267 327 ammus.Size *= 3.5; 268 328 ammus.Velocity *= 0.1; 329 ammus.CollisionIgnoreGroup = 3; 269 330 } 270 331 else if (pelaaja1.Weapon is AssaultRifle) … … 272 333 ammus.Image = LoadImage("bullet"); 273 334 ammus.Size *= 1.5; 335 ammus.CollisionIgnoreGroup = 3; 274 336 } 275 337 … … 277 339 ammus.MaximumLifetime = TimeSpan.FromSeconds(5.0); 278 340 ammus.IgnoresCollisionResponse = false; 341 279 342 pelaaja.Weapon.AttackSound.Stop(); 280 343 } … … 345 408 { 346 409 MultiSelectWindow Valikko = new MultiSelectWindow("Kauppa", 347 "Osta konekivääri ", "Osta plasma-ase", "Osta laser");410 "Osta konekivääri, 10 aivoa", "Osta plasma-ase, 25 aivoa", "Osta laser, 50 aivoa", "Osta kranaatinheitin, 100 aivoa"); 348 411 Add(Valikko); 349 412 Valikko.AddItemHandler(0, OstaRifle); 350 413 Valikko.AddItemHandler(1, OstaPlasma); 351 414 Valikko.AddItemHandler(2, OstaLaser); 415 Valikko.AddItemHandler(3, OstaKranuHeitin); 352 416 } 353 417 void OstaRifle() … … 386 450 } 387 451 452 } 453 void OstaKranuHeitin() 454 { 455 if (aivolaskuri.Value > 100) 456 { 457 aivolaskuri.Value -= 100; 458 pelaaja1.Weapon = new Kranaatinheitin(30, 10); 459 pelaaja1.Weapon.ProjectileCollision = PelaajanAmmusOsui; 460 pelaaja1.Weapon.FireRate = 0.5; 461 pelaaja1.Weapon.Image = LoadImage("lol"); 462 } 388 463 } 389 464 void VihuAmmuAseella(PlatformCharacter pelaaja) … … 474 549 huijattu = false; 475 550 return; 551 } 552 if (komento == "hyvaksykranu") 553 { 554 kranaattiaika = 0.01; 555 Keyboard.Listen(Key.G, ButtonState.Down, HeitaKranaatti, null, pelaaja1); 476 556 } 477 557 … … 623 703 teleport.Position = paikka; 624 704 teleport.Image = LoadImage("blackhole"); 625 Add(teleport );705 Add(teleport, 3); 626 706 teleport.Tag = "tele"; 707 int pMaxMaara = 100; 708 ExplosionSystem rajahdys = 709 new ExplosionSystem(LoadImage("rajahdys"), pMaxMaara); 710 Add(rajahdys); 711 712 double x = teleport.X; 713 double y = teleport.Y; 714 int pMaara = 1; 715 rajahdys.MaxScale = 20; 716 rajahdys.MinScale = 10; 717 rajahdys.MaxLifetime = 2; 718 rajahdys.MaxVelocity = 5; 719 Timer ajastin = new Timer(); 720 ajastin.Interval = 0.1; 721 ajastin.Timeout += delegate { rajahdys.AddEffect(x, y, pMaara); }; 722 ajastin.Start(); 627 723 } 628 724 void TormaaTeleport(PhysicsObject pelaaja1, PhysicsObject teleport) … … 769 865 void Musiikki() 770 866 { 771 MultiSelectWindow MusiikkiValikko = new MultiSelectWindow("Musiikki", "Default", "Musiikki1", "Musiikki2" );867 MultiSelectWindow MusiikkiValikko = new MultiSelectWindow("Musiikki", "Default", "Musiikki1", "Musiikki2", "Ringtone remix", "Ringtone remix2"); 772 868 MusiikkiValikko.AddItemHandler(0, Default); 773 869 MusiikkiValikko.AddItemHandler(1, Musiikki1); 774 870 MusiikkiValikko.AddItemHandler(2, Musiikki2); 871 MusiikkiValikko.AddItemHandler(3, Musiikki3); 872 MusiikkiValikko.AddItemHandler(4, Musiikki4); 775 873 Add(MusiikkiValikko); 776 874 … … 792 890 TaukoValikko(); 793 891 } 892 void Musiikki3() 893 { 894 MediaPlayer.Play("lol1"); 895 MediaPlayer.IsRepeating = true; 896 if (alkuValikko) 897 AlkuValikko(); 898 else 899 TaukoValikko(); 900 } 901 void Musiikki4() 902 { 903 MediaPlayer.Play("lol2"); 904 MediaPlayer.IsRepeating = true; 905 if (alkuValikko) 906 AlkuValikko(); 907 else 908 TaukoValikko(); 909 } 794 910 void Default() 795 911 { … … 802 918 void AlkuTekstit() 803 919 { 920 int pMaxMaara = 200; 921 ExplosionSystem rajahdys = 922 new ExplosionSystem(LoadImage("rajahdys"), pMaxMaara); 923 924 Add(rajahdys); 925 926 double x = 0; 927 double y = 0; 928 int pMaara = 500; 929 rajahdys.MaxLifetime = 4; 930 rajahdys.AddEffect(x, y, pMaara); 804 931 Label teksti = new Label("Tehty Visual Studio 2015 avulla"); 805 932 Add(teksti); -
2017/31/PatrikK/Tasohyppelypeli/Tasohyppelypeli/Tasohyppelypeli/Tasohyppelypeli.csproj.Debug.cachefile
r9349 r9379 25 25 Content\bullet.xnb 26 26 Content\cannonball.xnb 27 Content\rajahdys.xnb 28 Content\dollar.xnb 29 Content\lol.xnb 30 Content\bricks.xnb 31 Content\parallax-mountain-bg.xnb 32 Content\lol1.xnb 33 Content\lol2.xnb 27 34 Content\background_music.wma 28 35 Content\music1.wma 29 36 Content\music2.wma 37 Content\lol1.wma 38 Content\lol2.wma -
2017/31/PatrikK/Tasohyppelypeli/Tasohyppelypeli/Tasohyppelypeli/obj/x86/Debug/ContentPipeline-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}.xml
r9349 r9379 54 54 <Options>None</Options> 55 55 <Output>C:\MyTemp\PatrikK\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\grenade.xnb</Output> 56 <Time>2017-0 7-31T13:08:53.8434347+03:00</Time>56 <Time>2017-08-03T10:14:01.749439+03:00</Time> 57 57 </Item> 58 58 <Item> … … 238 238 <Output>C:\MyTemp\PatrikK\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\cannonball.xnb</Output> 239 239 <Time>2017-08-02T14:06:46.8343287+03:00</Time> 240 </Item> 241 <Item> 242 <Source>rajahdys.png</Source> 243 <Name>rajahdys</Name> 244 <Importer>TextureImporter</Importer> 245 <Processor>TextureProcessor</Processor> 246 <Options>None</Options> 247 <Output>C:\MyTemp\PatrikK\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\rajahdys.xnb</Output> 248 <Time>2017-08-03T09:26:55.100328+03:00</Time> 249 </Item> 250 <Item> 251 <Source>dollar.png</Source> 252 <Name>dollar</Name> 253 <Importer>TextureImporter</Importer> 254 <Processor>TextureProcessor</Processor> 255 <Options>None</Options> 256 <Output>C:\MyTemp\PatrikK\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\dollar.xnb</Output> 257 <Time>2017-08-03T09:45:47.0030813+03:00</Time> 258 </Item> 259 <Item> 260 <Source>lol.png</Source> 261 <Name>lol</Name> 262 <Importer>TextureImporter</Importer> 263 <Processor>TextureProcessor</Processor> 264 <Options>None</Options> 265 <Output>C:\MyTemp\PatrikK\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\lol.xnb</Output> 266 <Time>2017-08-03T10:01:20.4518297+03:00</Time> 267 </Item> 268 <Item> 269 <Source>bricks.png</Source> 270 <Name>bricks</Name> 271 <Importer>TextureImporter</Importer> 272 <Processor>TextureProcessor</Processor> 273 <Options>None</Options> 274 <Output>C:\MyTemp\PatrikK\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\bricks.xnb</Output> 275 <Time>2017-08-03T10:35:18.3656882+03:00</Time> 276 </Item> 277 <Item> 278 <Source>parallax-mountain-bg.png</Source> 279 <Name>parallax-mountain-bg</Name> 280 <Importer>TextureImporter</Importer> 281 <Processor>TextureProcessor</Processor> 282 <Options>None</Options> 283 <Output>C:\MyTemp\PatrikK\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\parallax-mountain-bg.xnb</Output> 284 <Time>2017-08-03T10:37:04.6475176+03:00</Time> 285 </Item> 286 <Item> 287 <Source>lol1.mp3</Source> 288 <Name>lol1</Name> 289 <Importer>Mp3Importer</Importer> 290 <Processor>SongProcessor</Processor> 291 <Options>None</Options> 292 <Output>C:\MyTemp\PatrikK\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\lol1.xnb</Output> 293 <Extra>C:\MyTemp\PatrikK\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\lol1.wma</Extra> 294 <Time>2017-08-03T10:58:27.0240359+03:00</Time> 295 </Item> 296 <Item> 297 <Source>lol2.mp3</Source> 298 <Name>lol2</Name> 299 <Importer>Mp3Importer</Importer> 300 <Processor>SongProcessor</Processor> 301 <Options>None</Options> 302 <Output>C:\MyTemp\PatrikK\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\lol2.xnb</Output> 303 <Extra>C:\MyTemp\PatrikK\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\lol2.wma</Extra> 304 <Time>2017-08-03T11:08:17.0632014+03:00</Time> 240 305 </Item> 241 306 <BuildSuccessful>true</BuildSuccessful> -
2017/31/PatrikK/Tasohyppelypeli/Tasohyppelypeli/Tasohyppelypeli/obj/x86/Debug/Tasohyppelypeli.csproj.FileListAbsolute.txt
r9349 r9379 36 36 C:\MyTemp\PatrikK\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\bullet.xnb 37 37 C:\MyTemp\PatrikK\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\cannonball.xnb 38 C:\MyTemp\PatrikK\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\rajahdys.xnb 39 C:\MyTemp\PatrikK\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\dollar.xnb 40 C:\MyTemp\PatrikK\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\lol.xnb 41 C:\MyTemp\PatrikK\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\bricks.xnb 42 C:\MyTemp\PatrikK\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\parallax-mountain-bg.xnb 43 C:\MyTemp\PatrikK\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\lol1.xnb 44 C:\MyTemp\PatrikK\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\lol1.wma 45 C:\MyTemp\PatrikK\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\lol2.xnb 46 C:\MyTemp\PatrikK\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\lol2.wma -
2017/31/PatrikK/Tasohyppelypeli/Tasohyppelypeli/Tasohyppelypeli/obj/x86/Debug/cachefile-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}-targetpath.txt
r9349 r9379 28 28 Content\bullet.xnb 29 29 Content\cannonball.xnb 30 Content\rajahdys.xnb 31 Content\dollar.xnb 32 Content\lol.xnb 33 Content\bricks.xnb 34 Content\parallax-mountain-bg.xnb 35 Content\lol1.xnb 36 Content\lol1.wma 37 Content\lol2.xnb 38 Content\lol2.wma -
2017/31/PatrikK/Tasohyppelypeli/Tasohyppelypeli/TasohyppelypeliContent/TasohyppelypeliContent.contentproj
r9349 r9379 221 221 </Compile> 222 222 </ItemGroup> 223 <ItemGroup> 224 <Compile Include="rajahdys.png"> 225 <Name>rajahdys</Name> 226 <Importer>TextureImporter</Importer> 227 <Processor>TextureProcessor</Processor> 228 </Compile> 229 </ItemGroup> 230 <ItemGroup> 231 <Compile Include="dollar.png"> 232 <Name>dollar</Name> 233 <Importer>TextureImporter</Importer> 234 <Processor>TextureProcessor</Processor> 235 </Compile> 236 </ItemGroup> 237 <ItemGroup> 238 <Compile Include="lol.png"> 239 <Name>lol</Name> 240 <Importer>TextureImporter</Importer> 241 <Processor>TextureProcessor</Processor> 242 </Compile> 243 </ItemGroup> 244 <ItemGroup> 245 <Compile Include="bricks.png"> 246 <Name>bricks</Name> 247 <Importer>TextureImporter</Importer> 248 <Processor>TextureProcessor</Processor> 249 </Compile> 250 </ItemGroup> 251 <ItemGroup> 252 <Compile Include="parallax-mountain-bg.png"> 253 <Name>parallax-mountain-bg</Name> 254 <Importer>TextureImporter</Importer> 255 <Processor>TextureProcessor</Processor> 256 </Compile> 257 </ItemGroup> 258 <ItemGroup> 259 <Compile Include="lol1.mp3"> 260 <Name>lol1</Name> 261 <Importer>Mp3Importer</Importer> 262 <Processor>SongProcessor</Processor> 263 </Compile> 264 </ItemGroup> 265 <ItemGroup> 266 <Compile Include="lol2.mp3"> 267 <Name>lol2</Name> 268 <Importer>Mp3Importer</Importer> 269 <Processor>SongProcessor</Processor> 270 </Compile> 271 </ItemGroup> 223 272 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 224 273 <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Note: See TracChangeset
for help on using the changeset viewer.