最赞回答 / Eric429221
//檢測位置是否合法 var check = function(pos, x, y) { if (pos.x + x < 0) { return false; } else if (pos.x + x >= gameData.length) { return false; } else if (pos.y + y < 0) { return false; } ...
2018-01-11
最新回答 / 半世灬丿浮尘
var isPause = false;//是否暂停//绑定键盘事件var bindKeyEvent = function () {document.onkeydown = function (e) {if (!isPause) {if (e.keyCode == 38) {//upgame.rotate();} else if (e.keyCode == 39) {//rightgame.right();} else if (e.keyCode == 40) {// downgame.down();} ...
2017-12-21