Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
z_05_xcx
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
template admin
z_05_xcx
Commits
9c475095
Commit
9c475095
authored
Oct 09, 2020
by
范雪寒
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 修改了判定范围、画笔的宽度,现在可以连笔了
parent
9194730d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
9 deletions
+28
-9
n_xuan1.js
play/assets/tmpGame/scene_2/n_xuan1.js
+17
-2
utils.js
play/assets/tmpGame/script/utils.js
+9
-5
project.json
play/settings/project.json
+1
-1
wechatgame.json
play/settings/wechatgame.json
+1
-1
No files found.
play/assets/tmpGame/scene_2/n_xuan1.js
View file @
9c475095
...
...
@@ -13,6 +13,7 @@ import {
asyncPlayDragonBoneAnimation
,
asyncPlayEffectByUrl
,
RandomInt
,
Between
,
http
,
dateFormat
,
formatSeconds
,
...
...
@@ -633,7 +634,7 @@ cc.Class({
.
start
();
}
if
(
this
.
checkPointInCircle
(
this
.
sharkNode
,
pos2
,
5
0
))
{
if
(
this
.
checkPointInCircle
(
this
.
sharkNode
,
pos2
,
13
0
))
{
this
.
_status
.
currentStrokeStageIdx
++
if
(
this
.
getCurrentCheckPos
()
===
null
)
{
this
.
drawCompleteLine
(
this
.
_status
.
currentStrokeIdx
);
...
...
@@ -644,7 +645,7 @@ cc.Class({
this
.
showOver
();
}
this
.
updateArrows
(
this
.
_status
.
currentStrokeIdx
);
this
.
onSharkMoveEnd
(
event
);
//
this.onSharkMoveEnd(event);
}
}
...
...
@@ -909,8 +910,21 @@ cc.Class({
this
.
_moveCount
=
0
const
drawGraphyNode
=
cc
.
find
(
'
Canvas/letterNodeBase/DrawMaskNode/DrawGraphyNodeCurrent
'
)
const
graph
=
drawGraphyNode
.
getComponent
(
cc
.
Graphics
);
graph
.
lineWidth
=
120
;
const
location
=
event
.
getLocation
();
const
pos
=
drawGraphyNode
.
convertToNodeSpaceAR
(
location
);
if
(
!
this
.
_lastPos
)
{
this
.
_lastPos
=
{
x
:
pos
.
x
,
y
:
pos
.
y
};
}
else
{
const
offsetX
=
pos
.
x
-
this
.
_lastPos
.
x
;
const
offsetY
=
pos
.
y
-
this
.
_lastPos
.
y
;
if
((
-
10
<
offsetX
&&
offsetX
<
10
)
&&
(
-
10
<
offsetY
&&
offsetY
<
10
))
{
return
;
}
this
.
_lastPos
=
{
x
:
pos
.
x
,
y
:
pos
.
y
};
}
graph
.
lineTo
(
pos
.
x
,
pos
.
y
);
graph
.
stroke
();
},
...
...
@@ -919,6 +933,7 @@ cc.Class({
const
drawGraphyNode
=
cc
.
find
(
'
Canvas/letterNodeBase/DrawMaskNode/DrawGraphyNodeCurrent
'
)
const
graph
=
drawGraphyNode
.
getComponent
(
cc
.
Graphics
);
graph
.
clear
();
this
.
_lastPos
=
null
;
},
addDrawListeners
()
{
...
...
play/assets/tmpGame/script/utils.js
View file @
9c475095
...
...
@@ -52,6 +52,10 @@ export function RandomInt(a, b = 0) {
return
Math
.
floor
(
Math
.
random
()
*
(
max
-
min
)
+
min
);
}
export
function
Between
(
a
,
b
,
c
)
{
return
[
a
,
b
,
c
].
sort
((
a
,
b
)
=>
a
-
b
)[
1
];
}
export
function
randomSortByArr
(
arr
)
{
const
newArr
=
[];
const
tmpArr
=
arr
.
concat
();
...
...
@@ -138,14 +142,14 @@ export function formatSeconds(value) {
theTime1
=
parseInt
(
theTime1
%
60
);
}
}
var
result
=
""
+
parseInt
(
theTime
);
//秒
if
(
10
>
theTime
>
0
)
{
result
=
"
0
"
+
parseInt
(
theTime
);
//秒
}
else
{
result
=
""
+
parseInt
(
theTime
);
//秒
}
if
(
10
>
theTime1
>
0
)
{
result
=
"
0
"
+
parseInt
(
theTime1
)
+
"
:
"
+
result
;
//分,不足两位数,首位补充0,
}
else
{
...
...
@@ -162,9 +166,9 @@ export async function http(type, url, data) {
console
.
log
(
'
type:
'
,
type
);
console
.
log
(
'
url:
'
,
url
);
console
.
log
(
'
data:
'
,
data
);
return
new
Promise
((
resolve
,
reject
)
=>
{
let
xhr
=
new
XMLHttpRequest
();
xhr
.
onreadystatechange
=
function
()
{
if
(
xhr
.
readyState
==
4
&&
(
xhr
.
status
>=
200
&&
xhr
.
status
<
400
))
{
...
...
@@ -176,7 +180,7 @@ export async function http(type, url, data) {
}
};
xhr
.
open
(
type
,
url
,
true
);
xhr
.
setRequestHeader
(
"
Content-Type
"
,
"
application/json; charset=utf-8
"
);
xhr
.
setRequestHeader
(
"
Content-Type
"
,
"
application/json; charset=utf-8
"
);
xhr
.
send
(
JSON
.
stringify
(
data
));
});
}
play/settings/project.json
View file @
9c475095
...
...
@@ -37,5 +37,5 @@
"enable"
:
false
}
},
"last-module-event-record-time"
:
160
084929044
8
"last-module-event-record-time"
:
160
222829187
8
}
play/settings/wechatgame.json
View file @
9c475095
{
"appid"
:
"wx
e5b8afe35e915c1c
"
,
"appid"
:
"wx
a082c58c5b503561
"
,
"orientation"
:
"landscape"
,
"separate_engine"
:
false
,
"REMOTE_SERVER_ROOT"
:
""
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment