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 7f2def7 commit 1b9b8dc
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 14 deletions.
2 changes: 1 addition & 1 deletion 2k.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no">
<style>
* {
margin: 0;
Expand Down
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.

2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no">
<style>
* {
margin: 0;
Expand Down
15 changes: 4 additions & 11 deletions src/src.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,29 +71,22 @@ onkeyup = (v, n, y, A) => {

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

ontouchmove = (v, n, y, A) => {
移动 = true;
v.preventDefault();
n = v.touches[0];
x = n.pageX;
y = n.pageY;
if (x - 开始X < -50) ontouchstart(v, 65);
if (x - 开始X > 50) ontouchstart(v, 68);
// if (y - 开始Y < -50) ontouchstart(v, 87);
if (y - 开始Y > 50) ontouchstart(v, 83);
};

ontouchend = (v, n, y, A) => {
if (移动 == false) ontouchstart(v, 87);
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);
};

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

0 comments on commit 1b9b8dc

Please sign in to comment.