예제 #1
0
    void Update()
    {
        // read the input from the controller, and send it straight to the kart controller
        kart.Thrust   = Input.GetAxis("Vertical");
        kart.Steering = Input.GetAxis("Horizontal");


        // debug controls for triggering various things
        if (Input.GetKeyDown(KeyCode.S))
        {
            kart.Spin(2.0f);
        }

        if (Input.GetKeyDown(KeyCode.W))
        {
            kart.Wiggle(2.0f);
        }

        if (Input.GetKeyDown(KeyCode.J))
        {
            kart.Jump(1.0f);
        }

        if (Input.GetKeyDown(KeyCode.B))
        {
            kart.SpeedBoost();
        }

        if (Input.GetKeyDown(KeyCode.P))
        {
            kart.SpeedPenalty();
        }
    }
예제 #2
0
 protected override void OnPickupCollected(KartController kart)
 {
     kart.Jump(1.0f);
 }