示例#1
0
    public void DisableSuperSkill()
    {
        isUsingSuperFlight = false;
        isUsingSuperSpeed  = false;
        isUsingSuperTime   = false;

        // Remove the superskill trail
        TrailRenderer trailRenderer = gameObject.GetComponentInChildren <TrailRenderer>();

        trailRenderer.enabled = false;

        // Reset gravity to its orignal value
        gameObject.GetComponent <Rigidbody2D>().gravityScale = oriGravityScale;
        PteraMover.DeactivateTimeFreeze();
        CaveFlamePit.DeactivateTimeFreeze();
        Fireball.DeactivateTimeFreeze();
        DestroyByTime.DeactivateTimeFreeze();
        LaserBeam.DeactivateTimeFreeze();
        Saw.DeactivateTimeFreeze();
        LaserTurret.DeactivateTimeFreeze();
        Bat.DeactivateTimeFreeze();
        SwingingBoulder[] sb = FindObjectsOfType <SwingingBoulder>();
        sb[0].DeactivateTimeFreeze();
        sb[1].DeactivateTimeFreeze();
        sb[2].DeactivateTimeFreeze();
        sb[3].DeactivateTimeFreeze();
        sb[4].DeactivateTimeFreeze();
        sb[5].DeactivateTimeFreeze();
        sb[6].DeactivateTimeFreeze();
        RockController.DeactivateTimeFreeze();
        Turret.DeactivateTimeFreeze();
        PlayerController[] players = FindObjectsOfType <PlayerController>();
        foreach (PlayerController p in players)
        {
            p.timeFreezeActivated = false;
            p.GetComponent <Rigidbody2D>().isKinematic = false;
            p.anim.enabled = true;
        }
        GameObject[] FXs = GameObject.FindGameObjectsWithTag("FX");
        foreach (GameObject fx in FXs)
        {
            fx.GetComponent <ParticleSystem>().Play();
        }
        Arrow.DeactivateTimeFreeze();
        Puma.DeactivateTimeFreeze();
        Piranha.DeactivateTimeFreeze();
        Cobra.DeactivateTimeFreeze();
        Saw.DeactivateTimeFreeze();
        Banana.DeactivateTimeFreeze();
        BananaSpawn[] bs = FindObjectsOfType <BananaSpawn>();
        bs[0].DeactivateTimeFreeze();
        bs[1].DeactivateTimeFreeze();
        bs[2].DeactivateTimeFreeze();
    }
示例#2
0
    public void SuperTime()
    {
        // Next iteration
        PteraMover.ActivateTimeFreeze();
        CaveFlamePit.ActivateTimeFreeze();
        Fireball.ActivateTimeFreeze();
        DestroyByTime.ActivateTimeFreeze();
        LaserBeam.ActivateTimeFreeze();
        Saw.ActivateTimeFreeze();
        LaserTurret.ActivateTimeFreeze();
        SwingingBoulder[] sb = FindObjectsOfType <SwingingBoulder>();
        sb[0].ActivateTimeFreeze();
        sb[1].ActivateTimeFreeze();
        sb[2].ActivateTimeFreeze();
        sb[3].ActivateTimeFreeze();
        sb[4].ActivateTimeFreeze();
        sb[5].ActivateTimeFreeze();
        sb[6].ActivateTimeFreeze();
        RockController.ActivateTimeFreeze();
        Turret.ActivateTimeFreeze();
        PlayerController[] players = FindObjectsOfType <PlayerController>();
        foreach (PlayerController p in players)
        {
            if (p.playerNumber != playerNumber)
            {
                p.timeFreezeActivated = true;
                p.GetComponent <Rigidbody2D>().isKinematic = true;
                p.anim.enabled = false;
            }
        }
        GameObject[] FXs = GameObject.FindGameObjectsWithTag("FX");
        foreach (GameObject fx in FXs)
        {
            fx.GetComponent <ParticleSystem>().Pause();
        }
        Arrow.ActivateTimeFreeze();
        Puma.ActivateTimeFreeze();
        Piranha.ActivateTimeFreeze();
        Cobra.ActivateTimeFreeze();
        Saw.ActivateTimeFreeze();
        Banana.ActivateTimeFreeze();
        BananaSpawn[] bs = FindObjectsOfType <BananaSpawn>();
        Bat.ActivateTimeFreeze();
        bs[0].ActivateTimeFreeze();
        bs[1].ActivateTimeFreeze();
        bs[2].ActivateTimeFreeze();

        // Add a trail to show the use of a super skill
        TrailRenderer trailRenderer = gameObject.GetComponentInChildren <TrailRenderer>();

        trailRenderer.enabled = true;
    }
示例#3
0
        static void Main(string[] args)
        {
            //Cat cat1 = new Cat();
            //Cat cat2 = new Cat("Garfild", "orange");

            //cat1.Name = "Lucky";
            //Console.WriteLine(cat1.Name);
            //Console.WriteLine(cat2.Name);

            //Lion lion1 = new Lion();
            //Cat lion2 = new Lion();
            //Lion lion3 = new Lion("Leo", "yellow", 150.1);

            //if(lion2 is Cat)
            //{
            //    Console.WriteLine("Lion1 is a cat");
            //}
            //if (lion2 is Lion)
            //{
            //    Console.WriteLine("Lion 1 is a lion");
            //}

            //lion3.Hello();
            //string name = string.Empty;
            //Console.WriteLine("Enter your puma name");
            //name = Console.ReadLine();

            //double weight = 0;
            //do
            //{
            //    Console.WriteLine("Enter your puma weight");
            //    string weightStr = Console.ReadLine();
            //    double.TryParse(weightStr, out weight);
            //} while (weight <= 0);

            //while (true)
            //{
            //    Console.WriteLine("Enter your puma weight");
            //    string weightStr = Console.ReadLine();
            //    double.TryParse(weightStr, out weight);

            //    if (weight > 0)
            //    {
            //        break;
            //    }
            //}

            //Puma puma1 = new Puma(name, weight);

            while (true)
            {
                Puma puma1 = new Puma("Lucky", 80);

                if (puma1.IsWhite)
                {
                    Console.WriteLine(puma1.Information());
                    break;
                }
            }

            Console.ReadLine();
        }