Example #1
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKey(KeyCode.UpArrow) && snail.isItThisSnailTurn())
        {
            transform.Rotate(0, 0, -1f);
        }
        if (Input.GetKey(KeyCode.DownArrow) && snail.isItThisSnailTurn())
        {
            transform.Rotate(0, 0, 1f);
        }
        if (transform.rotation == Quaternion.Euler(0f, 0f, -90f))
        {
            transform.rotation = Quaternion.Euler(0f, 0f, -89f);

            if (transform.rotation == Quaternion.Euler(0f, 0f, 90f))
            {
                transform.rotation = Quaternion.Euler(0f, 0f, 89f);
            }

            /*
             * if (transform.rotation == Quaternion.Euler(0f,0,-90f))
             * {
             *  transform.rotation = Quaternion.Euler(0f, 0f, -89f);
             * }
             *
             * if (transform.rotation == Quaternion.Euler(0f,0,90f) )
             * {
             *  transform.rotation = Quaternion.Euler(0f, 0, 89f);
             * }
             */
        }
    }
Example #2
0
 void Update()
 {
     if (Input.GetKey(KeyCode.X) && snail.isItThisSnailTurn() && TimerScript.afterShootingTurn == false)
     {
         tempSpeed += 0.2f;
     }
     if (Input.GetKeyUp(KeyCode.X) == true && snail.isItThisSnailTurn() && TimerScript.afterShootingTurn == false)
     {
         Shoot();
         tempSpeed = 1;
         TimerScript.afterShootingTurn = true;
     }
     if (Input.GetKeyDown(KeyCode.Keypad1) && snail.isItThisSnailTurn())
     {
         weaponSprite.sprite = rifle;
     }
     if (Input.GetKeyDown(KeyCode.Keypad2) && snail.isItThisSnailTurn())
     {
         weaponSprite.sprite = rocketLauncher;
     }
 }