コード例 #1
0
    // Update is called once per frame
    void Update()
    {
        point = CtrlGamePlay.PositonToPointMatrix(transform.position.x, transform.position.y);

        if (Input.GetKeyDown(KeyCode.B))
        {
            string s = Shape.Render(Shape.RotationMaxtrix(CtrlData.Cube_3, roll));
            Debug.Log(s);
        }
        if (Input.GetKeyDown(KeyCode.D))
        {
            int[,] type10 = new int[1, 1]
            {
                { 1 },
            };

            //  string ss = Shape.Render(Shape.RotationMaxtrix(type10, i));

            type = CtrlGamePlay.Ins.MatrixToType(type10);


            //  type =  CtrlGamePlay.Ins.MatrixToType(type10);
            //   isCorrect = CtrlGamePlay.Ins.isTypeOf(TypeShape.crossBar_3,Shape.Clone(type10));



            //  roll = CtrlGamePlay.RollShape(type, type1);
        }
        Vector2 pos = CtrlGamePlay.PositonToPointMatrix(transform.position.x, transform.position.y);

        row    = (int)pos.x;
        column = (int)pos.y;
        // isCorrect = CtrlGamePlay.IsPushShapeCorrect(CtrlGamePlay.Ins.Board,row, column);
    }
コード例 #2
0
ファイル: Shape.cs プロジェクト: hungpro2341999/BrickDom
    // Update is called once per frame
    void Update()
    {
        if (ClickUI.clickPause)
        {
            return;
        }
        if (GameManager.Ins.isGamePause || GameManager.Ins.isGameOver)
        {
            return;
        }
        Point = CtrlGamePlay.PositonToPointMatrix(transform.position.x, transform.position.y);

        if (SpriteUse != null)
        {
            if (!SpriteUse.enabled)
            {
                SpriteUse.enabled = true;
            }
        }

        PushToBoard();

        if (Input.GetKeyDown(KeyCode.W))
        {
            SceneManager.LoadScene(SceneManager.GetActiveScene().name);
        }

        if (isClick)
        {
            Vector3 pos = PosTarget;

            pos.x = Mathf.Clamp(pos.x, ClampMoveMinX, ClampMoveMaxX);

            PosTarget = pos;

            transform.position = Vector3.MoveTowards(transform.position, PosTarget, Time.deltaTime * Speed);
        }
        if (ListShape.Count <= 0)
        {
            DestroyAllCubeAndShape();
        }
        if (isMovingDown)
        {
            Vector3 pos = transform.position;

            pos.y = Mathf.MoveTowards(pos.y, ClampMoveDown, Time.deltaTime * CtrlGamePlay.Ins.SpeedMoveDown + Time.deltaTime);

            transform.position = pos;
            if (transform.position.y <= ClampMoveDown)
            {
                int offset = Mathf.RoundToInt((CtrlGamePlay.Ins.initPoint.y - transform.position.y) / CtrlGamePlay.Ins.offsetY);
                transform.position = new Vector2(transform.position.x, CtrlGamePlay.Ins.initPoint.y - offset * CtrlGamePlay.Ins.offsetY);


                isMovingDown = false;
            }
        }
    }
コード例 #3
0
ファイル: Shape.cs プロジェクト: hungpro2341999/BrickDom
    public void InitPoint()
    {
        isClick  = true;
        m_isMove = true;
        posInit  = transform.position;

        PointInitCheck = CtrlGamePlay.PositonToPointMatrix(transform.position.x, transform.position.y);
        //   CtrlGamePlay.Ins.TextPointInit.text = "Init : " + PointInitCheck.x + "  " + PointInitCheck.y;
    }