예제 #1
0
    /*
     * TODO:
     *  2.        PROPOSITION: Divide the force over several frames so that it looks as if it is burning opposite? - when deaccelerating
     *  3.
     *  5.        möjligen en dynamisk dt variabel med inverst förhållande till velocity
     *
     *
     */

    void Awake()
    {
        camera2DFollowSC = GameObject.Find("Main Camera").GetComponent <Camera2DFollow>();
        overlord         = GameObject.Find("Overlord");
        overlordSC       = overlord.GetComponent <overlordScript>();
        bodyBeingOrbited = GameObject.FindGameObjectWithTag("orbitingCelestial");                      //initial orbit around celestial with tag "startOrbit" now called bodyBeingOrbited
        oldCelestial     = bodyBeingOrbited;
        trajectoryLine   = GetComponent <LineRenderer>();
        playerRigidbody  = GetComponent <Rigidbody2D>();
        playerWeight     = playerRigidbody.mass;
        celestialMass    = bodyBeingOrbited.GetComponent <celestialScript>().mass;
        score            = 0;
    }
예제 #2
0
 // Use this for initialization
 void Start()
 {
     rotationalSpeed = Random.Range(-3, 3);
     col             = GetComponent <CircleCollider2D>();
     overlord        = GameObject.Find("Overlord").GetComponent <overlordScript>();
 }