Untitled

 avatar
unknown
plain_text
2 years ago
1.4 kB
19
Indexable
using System.Collections;
using System.Collections.Generic;
using System.Numerics;
using UnityEngine;
using UnityEngine.UIElements;

public class PuyoScript : MonoBehaviour
{

    private int dropSet = 1;
    private int preDropSet = 0;
    private bool Falling = true;
    private bool Rotating = true;
    void Start()
    {
    }

    // Update is called once per frame
    void Update()
    {if (transform.position.y > -5)
    if (transform.rotation.x == 0)
    transform.Translate(0, -1, 0);
    else if (transform.rotation.x == 90)
    transform.Translate(1, 0, 0);
    else if (transform.rotation.x == 180)
    transform.Translate(0, 1, 0);
    else if (transform.rotation.x == -90)
    transform.Translate(-1, 0, 0);
    if (Input.GetKey(KeyCode.RightArrow))
    if (transform.position.x < -9.5)
    if (Falling == true)
    {transform.Translate(1, 0, 0);}
    if (Input.GetKey(KeyCode.LeftArrow))
    if (transform.position.x > -14.5)
    if (Falling == true)
    {transform.Translate(-1, 0, 0);}
    if (Input.GetKeyDown(KeyCode.Z))
    if (Rotating == true)
    {transform.Rotate(0, 0, 90);}
    if (Input.GetKeyDown(KeyCode.X))
    if (Rotating == true)
    {transform.Rotate(0, 0, -90);}}

    private void OnTriggerEnter2D (Collider2D collider)
    {Falling = false;
    Rotating = false;}
    }
Editor is loading...
Leave a Comment