Changeset 6220 for 2015/26/ohjaajat/HillbillyRun/HillbillyRun/HillbillyRun/HillbillyRun/HillbillyRun.cs
- Timestamp:
- 2015-06-24 08:28:11 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
2015/26/ohjaajat/HillbillyRun/HillbillyRun/HillbillyRun/HillbillyRun/HillbillyRun.cs
r6219 r6220 280 280 bottomCamLimit = Level.Bottom + Window.Height / 2.0; 281 281 282 //Camera.X = cameraTargetX = players[0].X;283 //Camera.ZoomToLevel();284 282 Camera.X = cameraTargetX = leftCamLimit; 285 283 … … 382 380 void CreateCrawly(Vector position, double width, double height) 383 381 { 384 PlatformCharacter crawly = new PlatformCharacter(width * 2, height );382 PlatformCharacter crawly = new PlatformCharacter(width * 2, height * 0.6); 385 383 crawly.Position = position; 386 384 crawly.Color = Color.Gray; 387 crawly.Animation = crawl; 388 crawly.Animation.Start(); 385 crawly.Animation = new Animation(crawl); 386 crawly.Animation.FPS = RandomGen.NextInt(18, 24); 387 crawly.Animation.Step(RandomGen.NextInt(0, 16)); 388 crawly.Animation.Resume(); 389 389 crawly.Tag = "burn"; 390 390 crawly.CollisionIgnoreGroup = 3; 391 Add(crawly); 391 Add(crawly, 1); 392 393 GameObject flame = new GameObject(width * 1.4, height * 2); 394 flame.Animation = new Animation(blaze) { FPS = RandomGen.NextInt(20, 26) }; 395 flame.Animation.Step(RandomGen.NextInt(0, 12)); 396 flame.Animation.Resume(); 397 Add(flame); 398 399 // Pakko liikutella näin koska lapsioliona liekki näkyisi ryömijän päällä. 400 Timer flameMover = new Timer { Interval = 0.05 }; 401 flameMover.Timeout += delegate 402 { 403 double hieman = height * 0.75; 404 flame.Position = crawly.Position + new Vector(0, hieman); 405 }; 406 flameMover.Start(); 392 407 393 408 PlatformWandererBrain brain = new PlatformWandererBrain(); … … 396 411 397 412 crawly.Brain = brain; 413 414 // Sammuu törmätessään maitoon. 415 AddCollisionHandler(crawly, "milkparticle", delegate(PhysicsObject c, PhysicsObject particle) 416 { 417 particle.Destroy(); 418 crawly.Brain = null; 419 crawly.Tag = ""; 420 flame.Destroy(); 421 }); 398 422 } 399 423 … … 443 467 } 444 468 445 446 469 private void CreateDummy(Vector position, double width, double height, Color color) 447 470 {
Note: See TracChangeset
for help on using the changeset viewer.