Changeset 6307
- Timestamp:
- 2015-06-25 07:30:48 (7 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
r6303 r6307 596 596 PhysicsObject flame = new PhysicsObject(width * 1.4, height * 2); 597 597 flame.Y += mage.Height * 0.65; 598 //flame.Y = mage.Y + mage.Height;598 flame.X += mage.FacingDirection.GetVector().X + 30; 599 599 flame.Animation = new Animation(blaze); 600 600 flame.IgnoresPhysicsLogics = true; … … 605 605 brain.Speed = 20; 606 606 brain.FallsOffPlatforms = false; 607 mage.Brain = brain; 608 609 PhysicsObject trigger = PhysicsObject.CreateStaticObject(10, Level.Height); //A truly cool and efficient way to make the boogeyman react only to our closeness 610 trigger.Position = mage.Position - new Vector(Window.Width / 2, 0); 611 //trigger.Color = Color.Red; 612 trigger.IsVisible = false; 613 trigger.IgnoresCollisionResponse = true; 614 Add(trigger); 607 //mage.Brain = brain; 608 609 //PhysicsObject trigger = PhysicsObject.CreateStaticObject(10, Level.Height); //A truly cool and efficient way to make the boogeyman react only to our closeness 610 //trigger.Position = mage.Position - new Vector(Window.Width / 2, 0); 611 ////trigger.Color = Color.Red; 612 //trigger.IsVisible = false; 613 //trigger.IgnoresCollisionResponse = true; 614 //Add(trigger); 615 616 FollowerBrain attackBrain = new FollowerBrain("player"); 617 attackBrain.DistanceFar = Window.Width / 2.5; 618 attackBrain.DistanceClose = Window.Width / 2; 619 attackBrain.StopWhenTargetClose = false; 620 attackBrain.Speed = brain.Speed * 3; 621 attackBrain.FarBrain = brain; 622 mage.Brain = attackBrain; 615 623 616 624 // Taiotaan tulta välillä. … … 620 628 // TODO: Kävelyanimaatio pysähtyy jostain syystä tämän animaation jälkeen. 621 629 mage.PlayAnimation(firemageCastAnimation); 630 631 Timer.SingleShot(RandomGen.NextDouble(5, 8), delegate { mage.Brain = attackBrain; }); 622 632 623 633 Timer.SingleShot(1.5, … … 626 636 for (int i = 0; i < 6; i++) 627 637 { 628 CreateFlame(new Vector(mage.X + RandomGen.NextDouble(-300, 300), mage.Y + mage.Height * 1.5), 30, 60, false); 629 630 //PhysicsObject fire = new PhysicsObject(30, 60); 631 //fire.CanRotate = false; 632 //fire.Tag = "burn"; 633 //fire.Animation = new Animation(blaze) { FPS = RandomGen.NextInt(20, 26) }; 634 //fire.Animation.Step(RandomGen.NextInt(0, 12)); 635 //fire.Animation.Resume(); 636 //fire.X = mage.X + RandomGen.NextDouble(-300, 300); 637 //fire.Y = mage.Y + mage.Height * 1.5; 638 //fire.CollisionIgnoreGroup = 3; 639 //Add(fire); 640 641 //AddCollisionHandler(fire, "milkparticle", delegate(PhysicsObject c, PhysicsObject particle) 642 //{ 643 // particle.Destroy(); 644 // fire.Destroy(); 645 //}); 638 CreateFlame(new Vector(attackBrain.CurrentTarget.X + RandomGen.NextDouble(-300, 300), mage.Y + mage.Height * 1.5), 30, 60, false); 639 mage.Brain = brain; 646 640 } 647 641 }); 648 642 649 643 }; 644 645 attackBrain.DistanceToTarget.AddTrigger(Window.Width / 2, TriggerDirection.Down, delegate() 646 { 647 castTimer.Start(); 648 attackBrain.DistanceToTarget.RemoveTriggers(Window.Width/2); 649 }); 650 650 651 //castTimer.Start(); 651 652 … … 667 668 }); 668 669 669 AddCollisionHandler(trigger, "player", delegate(PhysicsObject a, PhysicsObject b) { castTimer.Start(); });670 //AddCollisionHandler(trigger, "player", delegate(PhysicsObject a, PhysicsObject b) { castTimer.Start(); }); 670 671 } 671 672 … … 880 881 if (player.Improvement == null) 881 882 { 882 883 883 CreateMilkParticles(player, 5, 100, 100, new Vector(0, player.Height/3), "tears"); 884 //for (int i = 0; i < 5; i++)885 //{886 // const double maxLife = 1.0;887 // PhysicsObject milkParticle = new PhysicsObject(5, 5, Shape.Circle);888 // milkParticle.Color = new Color(255, 255, 255, 128);889 // milkParticle.Position = player.Position + new Vector(0, player.Height / 3);890 // milkParticle.IgnoresCollisionResponse = true;891 // milkParticle.LifetimeLeft = TimeSpan.FromSeconds(maxLife);892 // Add(milkParticle);893 894 // // Väri muuttuu läpinäkyväksi.895 // var fadeTimer = new Timer { Interval = 0.07 };896 // fadeTimer.Timeout += delegate897 // {898 // byte c = 255;899 // milkParticle.Color = new Color(c, c, c, (byte)(128 * milkParticle.LifetimeLeft.TotalSeconds / maxLife));900 // };901 // fadeTimer.Start();902 // milkParticle.Destroyed += fadeTimer.Stop;903 904 // // Random lentonopeus.905 // var rx = RandomGen.NextDouble(-50, 50);906 // var ry = RandomGen.NextDouble(-50, 50);907 // milkParticle.Hit(new Vector(player.FacingDirection.GetVector().X * (100 + rx), 100 + ry));908 //}909 884 return; 910 885 }
Note: See TracChangeset
for help on using the changeset viewer.