Beispiel #1
0
 public override void OnChildTriggerStay(Collider2D collision)
 {
     base.OnChildTriggerStay(collision);
     if (collision.gameObject.layer == 13)
     {
         TurtleShell turtleShell = collision.transform.parent.gameObject.GetComponent <TurtleShell>();
         if (turtleShell && turtleShell.isMoving)
         {
             if (collision.transform.position.x >= transform.position.x)
             {
                 Killed(true);
             }
             else
             {
                 Killed(false);
             }
         }
     }
 }
Beispiel #2
0
        protected override bool OnPerish(ActorBase collider)
        {
            CreateParticleDebris();

            TurtleShell shell = new TurtleShell(speedX * 1.1f, 1.1f);

            shell.OnAttach(new ActorInstantiationDetails {
                Api    = api,
                Pos    = Transform.Pos,
                Params = new[] { (ushort)2 }
            });
            api.AddActor(shell);

            Explosion.Create(api, Transform.Pos, Explosion.SmokeGray);

            api.PlayCommonSound(this, "Splat");

            api.BroadcastLevelText(endText);

            return(base.OnPerish(collider));
        }
Beispiel #3
0
        protected override bool OnPerish(ActorBase collider)
        {
            CreateParticleDebris();

            TurtleShell shell = new TurtleShell(speedX * 1.1f, 1.1f);

            shell.OnActivated(new ActorActivationDetails {
                LevelHandler = levelHandler,
                Pos          = Transform.Pos,
                Params       = new[] { (ushort)2 }
            });
            levelHandler.AddActor(shell);

            Explosion.Create(levelHandler, Transform.Pos, Explosion.SmokeGray);

            levelHandler.PlayCommonSound("Splat", Transform.Pos);

            levelHandler.BroadcastLevelText(levelHandler.GetLevelText(endText));

            return(base.OnPerish(collider));
        }