Skip to content

Commit

Permalink
`
Browse files Browse the repository at this point in the history
  • Loading branch information
fc01 authored and fc01 committed Aug 7, 2017
1 parent 0b70dcf commit 84f79b6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
2 changes: 1 addition & 1 deletion 2k.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 15 additions & 7 deletions src/src.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,24 +69,32 @@ onkeyup = (v, n, y, A) => {
};


开始X = 0;
开始Y = 0;
开始X = NaN;
开始Y = NaN;
ontouchstart = (v, n, y, A) => {
v = v.touches[0];
开始X = v.pageX;
开始Y = v.pageY;
onkeydown({ keyCode: n });
};

ontouchend = (v, n, y, A) => {
if (!isNaN(开始X)) xxx(87);
};

xxx = (v, n, y, A) => {
onkeydown({ keyCode: v });
开始X = NaN;
};

ontouchmove = (v, n, y, A) => {
v.preventDefault();
n = v.touches[0];
x = n.pageX;
y = n.pageY;
if (x - 开始X < -25) ontouchstart(v, 65);
if (x - 开始X > 25) ontouchstart(v, 68);
if (y - 开始Y < -25) ontouchstart(v, 87);
if (y - 开始Y > 25) ontouchstart(v, 83);
if (x - 开始X < -50) xxx(65);
if (x - 开始X > 50) xxx(68);
if (y - 开始Y < -100) { 开始X = NaN; 倒流 = !倒流; }
if (y - 开始Y > 50) xxx(83);
};

渲染 = (v, n, y, A) => { //时间
Expand Down

0 comments on commit 84f79b6

Please sign in to comment.