Ejemplo n.º 1
0
    /*
     *  SET BALL SPEED
     *  PARAM: int s, number corresponding to the speed. 0 = slow, 1 = normal, 2 = fast
     *  DESCR: Randomly picks a speed for this ball.
     */
    public void SetBallSpeed(int s)
    {
        switch (s)
        {
        case 0:
            speedY = -.7f;
            Debug.Log("Slow");
            break;

        case 1:
            speedY = -.8f;
            Debug.Log("Normal");
            break;

        case 2:
            speedY = -.9f;
            Debug.Log("Fast");
            break;

        case 3:
            //Really fast
            speedY = -1f;
            Debug.Log("NYOOM");
            break;

        default:
            Debug.Log("Oh shit");
            break;
        }
        speedY *= boundary.getCamSize();
    }
Ejemplo n.º 2
0
    protected void SetSize()
    {
        bounds = GameObject.Find("Game Master").GetComponent <ObjBoundary>();
        Vector3 oldSize = this.transform.localScale;
        float   s       = bounds.getCamSize();

        this.transform.localScale = new Vector3(bounds.getScreenWidth() / s * oldSize.x, bounds.getScreenWidth() / s * oldSize.y, 1);
    }
Ejemplo n.º 3
0
 void SetSize()
 {
     size = 30f / (boundary.getCamSize() + 8f);
     Debug.Log(size);
     this.transform.localScale = new Vector3(size, size, size);
 }