Ejemplo n.º 1
0
    void FixedUpdate()
    {
        movePlayer();
        player.setPosX(player.transform.position.x);
        if (player.getPosX() > speedMilestoneCount)
        {
            speedMilestoneCount   += speedIncreaseMilestone;
            speedIncreaseMilestone = speedIncreaseMilestone * speedMultiplier;

            player.setVel(player.getVel() * speedMultiplier);
            //Debug.Log (player.getVel ());
        }
        rgb.velocity = new Vector2(player.getVel(), 0);

        //Check player's velocity so flying animation is activated (or disabled)
        myAnim.SetFloat("speed", rgb.velocity.x);
    }
Ejemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        player              = FindObjectOfType <FlyingPlayer> ();
        state               = 0;
        centerPos           = tr.position.y;
        upperLim            = centerPos + 1.3f;
        buttomLim           = centerPos - 1.3f;
        speedMilestoneCount = speedIncreaseMilestone;
        player.setVel(maxVel);

        //rgb = GetComponent<Rigidbody2D> ();
        //tr = GetComponent<Transform> ();
        moveSpeedStore              = player.getVel();
        speedMilestoneCountStore    = speedMilestoneCount;
        speedIncreaseMilestoneStore = speedIncreaseMilestone;
    }