viernes, 23 de mayo de 2025

Enlace FlappyBird

https://mega.nz/folder/4fJ0VYLJ#h869LwEpSYmRBNxUBha8Cg


using UnityEngine;

public class FlappyBird : MonoBehaviour
{
    // Start is called once before the first execution of Update after the MonoBehaviour is created

    public float velocity =2;
    public Rigidbody2D rd2D;

    public float rotationSpeed = 25;
    void Start()
    {
       
    }

    // Update is called once per frame
    void Update()
    {
if (Input.GetMouseButtonDown(0))
    {

        rd2D.linearVelocity = Vector2.up * velocity;
    }

transform.rotation = Quaternion.Euler(0,0,rd2D.linearVelocity.y * rotationSpeed * Time.deltaTime * 100);
    }
}

No hay comentarios.:

Publicar un comentario