コード例 #1
0
    void Update()
    {
        powerupTimer += Time.deltaTime;

        //if out of powerupDuration, then turn off powerup and display the powerup oncsreen again
        if (powerupTimer >= powerupDuration)
        {
            //take away the speed boost
            if (speedIsIncreased)
            {
                speedIsIncreased = false;
                player.SetSpeed(-speedIncrease);
                this.collider.enabled = true;
                this.renderer.enabled = true;
            }
        }
    }
コード例 #2
0
    void onPickup(ControllablePlayer player)
    {
        switch (powerType)
        {
        case Effect.SPEED:
            player.SetSpeed(speedIncrease);
            powerupTimer     = 0f;
            speedIsIncreased = true;
            break;

        default:
            print("that powerup is unavailable");
            break;
        }

        //star
        //immunity for 10 seconds
        //if there is a talent system this can either
        //increase to 20 seconds or
        //have 90 seconds of projectile protection or

        // more common drop timer (something to affect type of drops given
        //shield
        //absorbs a certain amount of damage
        //similair to star can be better or worse

        //wind, blows away enemies

        //magnet, pulls power ups 3 blocks away towards frogger

        //Hearts finish the level, collecting different types
        //froggers share heart pieces

        //are heart pieces randomly generated or not?
        //if heart pieces have fixed locations do the types of heart pieces at different locations change?
    }