- Timestamp:
- 2015-06-25 19:17:53 (6 years ago)
- Location:
- 2015/26/ohjaajat/HillbillyRun/HillbillyRun/HillbillyRun
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
2015/26/ohjaajat/HillbillyRun/HillbillyRun/HillbillyRun/HillbillyRun/HillbillyRun.cs
r6390 r6392 207 207 private Image spikeLeftImage = LoadImage("spikeleft"); 208 208 209 private Image prisonerImage = LoadImage("prisoner"); 210 209 211 private Animation crawl; 210 212 private Animation blaze; … … 472 474 level.SetTileMethod(Color.FromHexCode("C600AC"), CreateSpike, spikeLeftImage); 473 475 476 level.SetTileMethod(Color.FromHexCode("BADA55"), CreatePrisoner); // Lempivärini. 477 474 478 level.Optimize(Color.Brown); //Color.Black //Tekee jännittäviä asioita wheatille, jos optimoidaan (tietysti). Jotenn. 475 479 level.Execute(TILE_SIZE, TILE_SIZE); … … 478 482 if (levelNumber == 2) 479 483 { 480 PhysicsObject lava = PhysicsObject.CreateStaticObject(300, Level.Height);484 GameObject lava = new GameObject(300, Level.Height); 481 485 lava.Image = lavaWallImage; 482 486 lava.X = Camera.ScreenToWorld(new Vector(-Window.Width / 2.0, 0)).X; 483 //lava.Y = Camera.ScreenToWorld(new Vector(0, 0)).Y; 484 Add(lava); 487 Add(lava, 3); 488 489 PhysicsObject lavaCollision = PhysicsObject.CreateStaticObject(50, Level.Height); 490 lavaCollision.IsVisible = false; 491 lavaCollision.Left = lava.Left; 492 lavaCollision.Tag = "lava"; 493 Add(lavaCollision); 485 494 486 495 var updateTimer = new Timer {Interval = 0.01}; … … 488 497 { 489 498 lava.Left = Camera.X - Window.Width / 2.0; 490 //lava.Y = Camera.ScreenToWorld(new Vector(0, 0)).Y;499 lavaCollision.Left = lava.Left; 491 500 }; 492 501 updateTimer.Start(); 493 502 } 503 } 504 505 void CreatePrisoner(Vector position, double width, double height) 506 { 507 GameObject prisoner = new GameObject(width * 1.2, height * 2); 508 prisoner.Position = position; 509 prisoner.Y -= height / 2.0; 510 prisoner.Image = prisonerImage; 511 Add(prisoner, 1); 494 512 } 495 513 … … 993 1011 }); 994 1012 1013 AddCollisionHandler(player, "lava", delegate(PhysicsObject p, PhysicsObject t) 1014 { 1015 player.Life.Value = player.Life.MinValue; 1016 }); 1017 995 1018 AddCollisionHandler(player, "worm", delegate(PhysicsObject p, PhysicsObject worm) 996 1019 {
Note: See TracChangeset
for help on using the changeset viewer.