- Timestamp:
- 2014-07-03 11:13:35 (9 years ago)
- Location:
- 2014/27/OttoR
- Files:
-
- 4 added
- 4 deleted
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
2014/27/OttoR/GrazyGunFighters/GrazyGunFighters/GrazyGunFighters/GrazyGunFighters.cs
r5304 r5336 21 21 IntMeter pisteLaskuri; 22 22 IntMeter pisteLaskuri2; 23 IntMeter kranulaskuri; 23 24 24 25 const double nopeus = 147; 25 const double hyppyNopeus = 7 20;26 const double hyppyNopeus = 760; 26 27 const int RUUDUN_KOKO = 40; 27 28 … … 33 34 AssaultRifle pelaajan2Ase; 34 35 35 36 DoubleMeter alaspainLaskuri; 37 Timer aikaLaskuri; 38 36 39 37 40 Image pelikuva = LoadImage("Solttu2"); … … 48 51 public override void Begin() 49 52 { 53 IsFullScreen = true; 50 54 LuoAlkuvalikko(); 51 55 } … … 58 62 LuoElamaLaskuri(); 59 63 LuoElamaLaskuri2(); 64 LuoAikaLaskuri(); 60 65 61 66 soltunkävely = LoadAnimation("Solttu1 animaatio"); … … 70 75 LuoPistelaskuri(); 71 76 LuoPistelaskuri2(); 77 Luokranulaskuri(); 72 78 73 79 Camera.ZoomFactor = -30.0; … … 83 89 pisteNaytto.Y = Screen.Top - 100; 84 90 pisteNaytto.TextColor = Color.White; 91 pisteNaytto.TextScale *= 3; 85 92 pisteNaytto.Color = Color.Blue; 86 93 … … 98 105 pisteNaytto.TextColor = Color.White; 99 106 pisteNaytto.Color = Color.Red; 100 107 pisteNaytto.TextScale *= 3; 101 108 pisteNaytto.BindTo(pisteLaskuri2); 102 109 Add(pisteNaytto); … … 166 173 } 167 174 175 176 168 177 void HeitaKranaatti(PlatformCharacter pelaaja) 169 178 { 179 180 if (kranulaskuri.Value <= 0) 181 { 182 return; 183 } 170 184 Grenade kranu = new Grenade(10.0); 171 185 pelaaja.Throw(kranu, Angle.FromDegrees(40), 10500); 172 kranu.Explosion.MaxRadius = 96;186 kranu.Explosion.MaxRadius = 100; 173 187 kranu.Explosion.AddShockwaveHandler("vihollinen", KranaattiOsui); 174 188 kranu.CollisionIgnoreGroup = 1; 175 189 kranu.Image = putkipommi; 190 kranulaskuri.Value--; 176 191 } 177 192 … … 188 203 } 189 204 205 206 void Luokranulaskuri() 207 { 208 kranulaskuri = new IntMeter(3); 209 210 Label pisteNaytto = new Label(); 211 pisteNaytto.X = Screen.Left + 100; 212 pisteNaytto.Y = Screen.Top - 100; 213 pisteNaytto.TextColor = Color.White; 214 pisteNaytto.Color = Color.Blue; 215 216 pisteNaytto.BindTo(kranulaskuri); 217 Add(pisteNaytto); 218 } 219 190 220 void KranaattiOsui(IPhysicsObject rajahdyksenKohde, Vector v) 191 221 { … … 195 225 void RäjähdysOsui(IPhysicsObject rajahdyksenKohde, Vector v) 196 226 { 197 Teevahinkoa(rajahdyksenKohde, 15); 227 Teevahinkoa(rajahdyksenKohde, 25); 228 } 229 230 void PommiOsui(IPhysicsObject rajahdyksenKohde, Vector v) 231 { 232 Teevahinkoa(rajahdyksenKohde, 100); 198 233 } 199 234 … … 235 270 taso3.Image = tasokuva; 236 271 taso3.Color = Color.Blue; 237 taso3. CollisionIgnoreGroup = 1;272 taso3.IgnoresCollisionResponse = true; 238 273 taso3.Tag = "myrkky"; 239 274 … … 296 331 pelaaja2.Mass = 4.0; 297 332 pelaaja2.Image = pelikuva; 298 pelaaja2.Animation = new Animation(soltunkävely2);299 333 pelaaja2.AnimWalk = new Animation(soltunkävely2); 300 334 pelaaja2.AnimIdle = new Animation(seiso2); … … 326 360 if (myrkky.Tag.Equals("myrkky")) 327 361 { 328 362 Teevahinkoa(pelaaja, 10); 329 363 } 330 364 } … … 333 367 { 334 368 ammus.Destroy(); 335 Explosion räjähdys = new Explosion( 50);369 Explosion räjähdys = new Explosion(70); 336 370 räjähdys.Position = ammus.Position; 337 371 räjähdys.AddShockwaveHandler("vihollinen", RäjähdysOsui); … … 344 378 { 345 379 Keyboard.Listen(Key.F1, ButtonState.Pressed, ShowControlHelp, "Näytä ohjeet"); 346 Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, " Lopeta peli");380 Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Begin"); 347 381 348 382 Keyboard.Listen(Key.Left, ButtonState.Down, Liikuta, "Liikkuu vasemmalle", pelaaja1, -nopeus); … … 427 461 } 428 462 463 void LuoAikaLaskuri() 464 { 465 alaspainLaskuri = new DoubleMeter(2*60+25); 466 467 aikaLaskuri = new Timer(); 468 aikaLaskuri.Interval = 0.1; 469 aikaLaskuri.Timeout += LaskeAlaspain; 470 aikaLaskuri.Start(); 471 472 Label aikaNaytto = new Label(); 473 aikaNaytto.TextColor = Color.White; 474 aikaNaytto.TextScale *= 4; 475 aikaNaytto.DecimalPlaces = 1; 476 aikaNaytto.Y = Screen.Top - 100; 477 aikaNaytto.BindTo(alaspainLaskuri); 478 Add(aikaNaytto); 479 } 480 481 void LaskeAlaspain() 482 { 483 alaspainLaskuri.Value -= 0.1; 484 485 if (alaspainLaskuri.Value <= 0) 486 { 487 MessageDisplay.Add("Aika loppui..."); 488 aikaLaskuri.Stop(); 489 490 Explosion räjähdys = new Explosion(2500); 491 räjähdys.Y = Level.Bottom + 50; 492 Add(räjähdys); 493 räjähdys.AddShockwaveHandler("vihollinen", delegate (IPhysicsObject k, Vector v) { 494 //PommiOsui(k, v); 495 496 Label gameover = new Label("Victory!"); 497 gameover.TextScale *= 4; 498 gameover.TextColor = pisteLaskuri.Value > pisteLaskuri2.Value? Color.Blue:Color.Red; 499 Add(gameover); 500 Pause(); 501 }); 502 } 503 } 429 504 430 505 -
2014/27/OttoR/GrazyGunFighters/GrazyGunFighters/GrazyGunFighters/obj/x86/Debug/ContentPipeline-{DD67BAE4-E735-4BE9-A36E-568B0F9EC985}.xml
r5304 r5336 45 45 <Options>None</Options> 46 46 <Output>C:\MyTemp\OttoR\GrazyGunFighters\GrazyGunFighters\GrazyGunFighters\bin\x86\Debug\Content\kentta1.xnb</Output> 47 <Time>2014-07-0 2T14:45:32.9371863+03:00</Time>47 <Time>2014-07-03T09:39:22.6842053+03:00</Time> 48 48 </Item> 49 49 <Item> … … 82 82 <Output>C:\MyTemp\OttoR\GrazyGunFighters\GrazyGunFighters\GrazyGunFighters\bin\x86\Debug\Content\Solttu1 animaatio\3_0.xnb</Output> 83 83 <Time>2014-07-01T10:24:14.9742535+03:00</Time> 84 </Item>85 <Item>86 <Source>Solttu hyppy.png</Source>87 <Name>Solttu hyppy</Name>88 <Importer>TextureImporter</Importer>89 <Processor>TextureProcessor</Processor>90 <Options>None</Options>91 <Output>C:\MyTemp\OttoR\GrazyGunFighters\GrazyGunFighters\GrazyGunFighters\bin\x86\Debug\Content\Solttu hyppy.xnb</Output>92 <Time>2014-07-01T10:38:09.840031+03:00</Time>93 84 </Item> 94 85 <Item> -
2014/27/OttoR/GrazyGunFighters/GrazyGunFighters/GrazyGunFighters/obj/x86/Debug/GrazyGunFighters.csproj.FileListAbsolute.txt
r5304 r5336 16 16 C:\MyTemp\OttoR\GrazyGunFighters\GrazyGunFighters\GrazyGunFighters\bin\x86\Debug\Content\Solttu1 animaatio\2_0.xnb 17 17 C:\MyTemp\OttoR\GrazyGunFighters\GrazyGunFighters\GrazyGunFighters\bin\x86\Debug\Content\Solttu1 animaatio\3_0.xnb 18 C:\MyTemp\OttoR\GrazyGunFighters\GrazyGunFighters\GrazyGunFighters\bin\x86\Debug\Content\Solttu hyppy.xnb19 18 C:\MyTemp\OttoR\GrazyGunFighters\GrazyGunFighters\GrazyGunFighters\bin\x86\Debug\Content\taustamusa.xnb 20 19 C:\MyTemp\OttoR\GrazyGunFighters\GrazyGunFighters\GrazyGunFighters\bin\x86\Debug\Content\taustamusa.wma -
2014/27/OttoR/GrazyGunFighters/GrazyGunFighters/GrazyGunFighters/obj/x86/Debug/cachefile-{DD67BAE4-E735-4BE9-A36E-568B0F9EC985}-targetpath.txt
r5304 r5336 8 8 Content\Solttu1 animaatio\2_0.xnb 9 9 Content\Solttu1 animaatio\3_0.xnb 10 Content\Solttu hyppy.xnb11 10 Content\taustamusa.xnb 12 11 Content\taustamusa.wma -
2014/27/OttoR/GrazyGunFighters/GrazyGunFighters/GrazyGunFightersContent/GrazyGunFightersContent.contentproj
r5304 r5336 84 84 </ItemGroup> 85 85 <ItemGroup> 86 <Compile Include="Solttu hyppy.png">87 <Name>Solttu hyppy</Name>88 <Importer>TextureImporter</Importer>89 <Processor>TextureProcessor</Processor>90 </Compile>91 </ItemGroup>92 <ItemGroup>93 86 <Compile Include="taustamusa.mp3"> 94 87 <Name>taustamusa</Name>
Note: See TracChangeset
for help on using the changeset viewer.