Changeset 6472
- Timestamp:
- 2015-06-26 13:28:43 (8 years ago)
- Location:
- 2014/30/MitjaK/Attack to Agora/Attack to Agora
- Files:
-
- 1 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
2014/30/MitjaK/Attack to Agora/Attack to Agora/Attack to Agora/Attack to Agora/Attack_to_Agora.cs
r6471 r6472 46 46 const double VIHOLLISEN_TORMAYSDMG = 4.0; 47 47 48 int kenttaNro = 1 8;48 int kenttaNro = 1; 49 49 50 50 /// <summary> … … 58 58 /// </summary> 59 59 const int VIIMEINEN_KENTTA = 19; 60 60 61 61 #region yleiset toiminnot 62 62 public override void Begin() 63 63 { 64 SetWindowSize(1366, 768 );64 SetWindowSize(1366, 768, true); 65 65 LataaContent(); 66 66 AloitusAnimaatio(); … … 270 270 asemiesLiikkuu = LoadAnimation("asemiesliikkuu"); 271 271 tuliAnimaatio = LoadAnimation("tulianimaatio"); 272 tuliAnimaatioFlipped = Animation.Mirror(tuliAnimaatio); 272 273 } 273 274 -
2014/30/MitjaK/Attack to Agora/Attack to Agora/Attack to Agora/Attack to Agora/Attack_to_Agora_mitja.cs
r6471 r6472 23 23 Image ajHBarFull = LoadImage("ajheathbarfull"); 24 24 Animation tuliAnimaatio; 25 Animation tuliAnimaatioFlipped; 25 26 bool tekeekoTulidamagea = false; 26 27 const double TULEN_DMG = 0.1; 27 const double TULEN_ETAISYYS = 300.0; 28 const double AJ_NOPEUS = 300.0; 29 bool isAJFlipped = false; 28 const double TULEN_ETAISYYS = 200.0; 29 const double AJ_NOPEUS = 100.0; 30 bool ajGoingRight = true; 31 bool pelaajaAskenOikealla = false; 30 32 31 33 Elava currentBoss; … … 245 247 anttijussibossFlipped = Image.Mirror(anttijussiboss); 246 248 247 Elava anttiJussi = new Elava(anttijussiboss, 1000 ); //hp 10000?249 Elava anttiJussi = new Elava(anttijussiboss, 10000); //hp 10000? 248 250 anttiJussi.Kuoli += AJDefeated; 249 251 anttiJussi.Size *= 0.2; … … 275 277 fireT.Timeout += delegate 276 278 { 277 tuli.Left = anttiJussi.Right; 278 tuli.Y = anttiJussi.Y + 80; 279 if (ajGoingRight) 280 { 281 tuli.Left = anttiJussi.Right; 282 tuli.Y = anttiJussi.Y + 80; 283 } 284 else 285 { 286 tuli.Right = anttiJussi.Left; 287 tuli.Y = anttiJussi.Y + 80; 288 } 279 289 }; 280 290 fireT.Start(); … … 307 317 if (tekeekoTulidamagea) 308 318 { 309 double distance = Vector.Distance(new Vector(tuli.Left, tuli.Y), taistelija.Position); 319 double distance; 320 if (ajGoingRight) 321 distance = Vector.Distance(new Vector(tuli.Left, tuli.Y), taistelija.Position); 322 else 323 distance = Vector.Distance(new Vector(tuli.Right, tuli.Y), taistelija.Position); 324 310 325 if (distance < TULEN_ETAISYYS) 311 326 { … … 318 333 { 319 334 currentBoss.Velocity = new Vector(-AJ_NOPEUS, currentBoss.Velocity.Y); 335 ajGoingRight = false; 320 336 } 321 337 else 322 338 { 323 339 currentBoss.Velocity = new Vector(AJ_NOPEUS, currentBoss.Velocity.Y); 340 ajGoingRight = true; 324 341 } 342 } 343 344 if (ajGoingRight && !pelaajaAskenOikealla) 345 { 346 currentBoss.Image = anttijussiboss; 347 tuli.Animation = tuliAnimaatio; 348 tuli.Animation.Start(); 349 pelaajaAskenOikealla = true; 350 } 351 if (!ajGoingRight && pelaajaAskenOikealla) 352 { 353 currentBoss.Image = anttijussibossFlipped; 354 tuli.Animation = tuliAnimaatioFlipped; 355 tuli.Animation.Start(); 356 pelaajaAskenOikealla = false; 325 357 } 326 358 }; -
2014/30/MitjaK/Attack to Agora/Attack to Agora/Attack to Agora/Attack to AgoraContent/Attack to AgoraContent.contentproj
r6443 r6472 428 428 </ItemGroup> 429 429 <ItemGroup> 430 <Compile Include="anttijussiboss.png">431 <Name>anttijussiboss</Name>432 <Importer>TextureImporter</Importer>433 <Processor>TextureProcessor</Processor>434 </Compile>435 </ItemGroup>436 <ItemGroup>437 430 <Compile Include="LMGfire.wav"> 438 431 <Name>LMGfire</Name> … … 489 482 <Importer>AnimationImporter</Importer> 490 483 <Processor>AnimationContentProcessor</Processor> 484 </Compile> 485 </ItemGroup> 486 <ItemGroup> 487 <Compile Include="anttijussiboss.png"> 488 <Name>anttijussiboss</Name> 489 <Importer>TextureImporter</Importer> 490 <Processor>TextureProcessor</Processor> 491 </Compile> 492 </ItemGroup> 493 <ItemGroup> 494 <Compile Include="ydinpommi.png"> 495 <Name>ydinpommi</Name> 496 <Importer>TextureImporter</Importer> 497 <Processor>TextureProcessor</Processor> 498 </Compile> 499 </ItemGroup> 500 <ItemGroup> 501 <Compile Include="kentta19.png"> 502 <Name>kentta19</Name> 503 <Importer>TextureImporter</Importer> 504 <Processor>TextureProcessor</Processor> 505 </Compile> 506 </ItemGroup> 507 <ItemGroup> 508 <Compile Include="kentta19pohja.png"> 509 <Name>kentta19pohja</Name> 510 <Importer>TextureImporter</Importer> 511 <Processor>TextureProcessor</Processor> 491 512 </Compile> 492 513 </ItemGroup> -
2014/30/MitjaK/Attack to Agora/Attack to Agora/Muokattu Jypeli/Game/Game.cs
r6440 r6472 1368 1368 if ( Level.Background.Image != null && !Level.Background.MovesWithCamera ) 1369 1369 { 1370 Renderer.LightingEnabled = true;1371 1370 SpriteBatch spriteBatch = Jypeli.Graphics.SpriteBatch; 1372 1371 spriteBatch.Begin( SpriteSortMode.Deferred, BlendState.AlphaBlend ); 1373 1372 spriteBatch.Draw( Level.Background.Image.XNATexture, new XnaRectangle( 0, 0, (int)screen.Width, (int)screen.Height ), XnaColor.White ); 1374 1373 spriteBatch.End(); 1375 Renderer.LightingEnabled = false;1376 1374 } 1377 1375 … … 1381 1379 * Matrix.CreateScale( (float)Camera.ZoomFactor, (float)Camera.ZoomFactor, 1f ); 1382 1380 1381 Renderer.LightingEnabled = true; 1383 1382 // If the background should move with camera, draw it here. 1384 1383 Level.Background.Draw( worldMatrix, Matrix.Identity ); 1384 Renderer.LightingEnabled = false; 1385 1385 1386 1386 if ( DrawPerimeter )
Note: See TracChangeset
for help on using the changeset viewer.