为了账号安全,请及时绑定邮箱和手机立即绑定

ReferenceError: Square is not defined

var Square1 = function () {
    Square.call(this);
    //旋转数组
    this.rotates = [
        [
            [0,2,0,0],
            [0,2,0,0],
            [0,2,0,0],
            [0,2,0,0]
        ],
        [
            [0,0,0,0],
            [2,2,2,2],
            [0,0,0,0],
            [0,0,0,0]
        ],
        [
            [0,2,0,0],
            [0,2,0,0],
            [0,2,0,0],
            [0,2,0,0]
        ],
        [
            [0,0,0,0],
            [2,2,2,2],
            [0,0,0,0],
            [0,0,0,0]
        ]
    ];
}
Square1.prototype = Square.prototype;

var Square2 = function () {
    Square.call(this);
    //旋转数组
    this.rotates = [
        [
            [0,2,0,0],
            [2,2,2,0],
            [0,0,0,0],
            [0,0,0,0]
        ],
        [
            [2,0,0,0],
            [2,2,0,0],
            [2,0,0,0],
            [0,0,0,0]
        ],
        [
            [2,2,2,0],
            [0,2,0,0],
            [0,0,0,0],
            [0,0,0,0]
        ],
        [
            [0,2,0,0],
            [2,2,0,0],
            [0,2,0,0],
            [0,0,0,0]
        ]
    ];
}
Square2.prototype = Square.prototype;


var Square3 = function () {
    Square.call(this);
    //旋转数组
    this.rotates = [
        [
            [2,2,2,0],
            [0,0,2,0],
            [0,0,0,0],
            [0,0,0,0]
        ],
        [
            [0,2,0,0],
            [0,2,0,0],
            [2,2,0,0],
            [0,0,0,0]
        ],
        [
            [2,0,0,0],
            [2,2,2,0],
            [0,0,0,0],
            [0,0,0,0]
        ],
        [
            [2,2,0,0],
            [2,0,0,0],
            [2,0,0,0],
            [0,0,0,0]
        ]
    ];
}
Square3.prototype = Square.prototype;



var Square4 = function () {
    Square.call(this);
    //旋转数组
    this.rotates = [
        [
            [2,2,2,0],
            [2,0,0,0],
            [0,0,0,0],
            [0,0,0,0]
        ],
        [
            [2,2,0,0],
            [0,2,0,0],
            [0,2,0,0],
            [0,0,0,0]
        ],
        [
            [0,0,2,0],
            [2,2,2,0],
            [0,0,0,0],
            [0,0,0,0]
        ],
        [
            [2,0,0,0],
            [2,0,0,0],
            [2,2,0,0],
            [0,0,0,0]
        ]
    ];
}
Square4.prototype = Square.prototype;



var Square5 = function () {
    Square.call(this);
    //旋转数组
    this.rotates = [
        [
            [2,2,0,0],
            [2,2,0,0],
            [0,0,0,0],
            [0,0,0,0]
        ],
        [
            [2,2,0,0],
            [2,2,0,0],
            [0,0,0,0],
            [0,0,0,0]
        ],
        [
            [2,2,0,0],
            [2,2,0,0],
            [0,0,0,0],
            [0,0,0,0]
        ],
        [
            [2,2,0,0],
            [2,2,0,0],
            [0,0,0,0],
            [0,0,0,0]
        ]
    ];
}
Square5.prototype = Square.prototype;


var Square6 = function () {
    Square.call(this);
    //旋转数组
    this.rotates = [
        [
            [0,2,2,0],
            [2,2,0,0],
            [0,0,0,0],
            [0,0,0,0]
        ],
        [
            [2,0,0,0],
            [2,2,0,0],
            [0,2,0,0],
            [0,0,0,0]
        ],
        [
            [0,2,2,0],
            [2,2,0,0],
            [0,0,0,0],
            [0,0,0,0]
        ],
        [
            [2,0,0,0],
            [2,2,0,0],
            [0,2,0,0],
            [0,0,0,0]
        ]
    ];
}
Square6.prototype = Square.prototype;


var Square7 = function () {
    Square.call(this);
    //旋转数组
    this.rotates = [
        [
            [2,2,0,0],
            [0,2,2,0],
            [0,0,0,0],
            [0,0,0,0]
        ],
        [
            [0,2,0,0],
            [2,2,0,0],
            [2,0,0,0],
            [0,0,0,0]
        ],
        [
            [2,2,0,0],
            [0,2,2,0],
            [0,0,0,0],
            [0,0,0,0]
        ],
        [
            [0,2,0,0],
            [2,2,0,0],
            [2,0,0,0],
            [0,0,0,0]
        ]
    ];
}
Square7.prototype = Square.prototype;

var SquareFactory = function () {}
SquareFactory.prototype.make = function (index,dir) {
    var s;
    index = index + 1;
    switch (index) {
        case 1:
            s = new Square1();
            break;
        case 2:
            s = new Square2();
            break;
        case 3:
            s = new Square3();
            break;
        case 4:
            s = new Square4();
            break;
        case 5:
            s = new Square5();
            break;
        case 6:
            s = new Square6();
            break;
        case 7:
            s = new Square7();
            break;
        default:
            break;
    }
    s.origin.x = 0;
    s.origin.y =3;
    s.rotate(dir);
    return s;
}


正在回答

0 回答

举报

0/150
提交
取消

ReferenceError: Square is not defined

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信