Untitled

mail@pastecode.io avatar
unknown
plain_text
10 months ago
945 B
7
Indexable
Never
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PuyoFall : MonoBehaviour
{
    int set = 1;
    int preSet = 0;
    void Start()
    {
        if (transform.position.y == 5.5)
        {
            (set == set + 1);
            (preSet == preSet + 1);
        }
    }
    void Update()
    {
        if (set == preSet + 1)
            if (transform.position.y > -5.5)
                transform.Translate(0, -0.05f, 0);

        if (Input.GetKey(KeyCode.LeftArrow))
            if (transform.position.x > -14.5)
                if (transform.position.y > -5.5)
                    transform.Translate(-1, 0, 0);

        if (Input.GetKey(KeyCode.RightArrow))
            if (transform.position.x < -9.5)
                if (transform.position.y > -5.5)
                    transform.Translate(1, 0, 0);
    }
    void OnTriggerEnter(Collider other)
    {

    }

}
Leave a Comment