Game/Assets/Scripts/Colidi.js
// Update is called once per frame
Update is called once per frame
Update is called once per frame
function Update () {
        transform.position.y = transform.position.y + 0.03 * direcao;
        transform.position.x = transform.position.x + 0.01 * direcao;
        if (transform.position.y > 22){
            transform.position.y = transform.position.y + 0.03 * direcao * -1;   
        } 
        if (transform.position.y < -22){
            transform.position.y = transform.position.y + 0.02 * direcao * -1;   
        } 
        if (transform.position.x > 22){
            transform.position.x = transform.position.x + 0.03 * direcao * -1;   
        } 
        if (transform.position.x < -22){
            transform.position.x = transform.position.x + 0.02 * direcao * -1;   
        }
		transform.rotation = _initialRotation;
	}
function Update ( ) { transform . position . y = transform . position . y + 0.03 * direcao ; transform . position . x = transform . position . x + 0.01 * direcao ; if ( transform . position . y > 22 ) { transform . position . y = transform . position . y + 0.03 * direcao * - 1 ; } if ( transform . position . y < - 22 ) { transform . position . y = transform . position . y + 0.02 * direcao * - 1 ; } if ( transform . position . x > 22 ) { transform . position . x = transform . position . x + 0.03 * direcao * - 1 ; } if ( transform . position . x < - 22 ) { transform . position . x = transform . position . x + 0.02 * direcao * - 1 ; } transform . rotation = _initialRotation ; }
Update is called once per frame
Update is called once per frame