Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fucking_flirt
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
william
fucking_flirt
Commits
23f7def1
Commit
23f7def1
authored
May 05, 2018
by
Tulip Li
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat hand
parent
343efb3b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
158 additions
and
23 deletions
+158
-23
game.fire
assets/game.fire
+64
-23
Hand.js
assets/scripts/Hand.js
+84
-0
Hand.js.meta
assets/scripts/Hand.js.meta
+10
-0
No files found.
assets/game.fire
View file @
23f7def1
...
...
@@ -74,23 +74,23 @@
"__id__": 19
},
{
"__id__": 2
3
"__id__": 2
4
},
{
"__id__": 2
5
"__id__": 2
7
},
{
"__id__": 2
6
"__id__": 2
8
}
],
"_tag": -1,
"_active": true,
"_components": [
{
"__id__": 2
7
"__id__": 2
9
},
{
"__id__":
28
"__id__":
30
}
],
"_prefab": null,
...
...
@@ -227,7 +227,7 @@
}
],
"_tag": -1,
"_active":
tru
e,
"_active":
fals
e,
"_components": [],
"_prefab": null,
"_id": "11Whf+9qZFC6iWPyh0zx07",
...
...
@@ -525,8 +525,8 @@
"_cascadeOpacityEnabled": true,
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.
5
,
"y":
0.5
"x": 0.
47762530211413157
,
"y":
-2.3276772817033287
},
"_contentSize": {
"__type__": "cc.Size",
...
...
@@ -539,8 +539,8 @@
"_scaleY": 0.6,
"_position": {
"__type__": "cc.Vec2",
"x":
2
,
"y":
182
"x":
0
,
"y":
0
},
"_skewX": 0,
"_skewY": 0,
...
...
@@ -584,7 +584,7 @@
},
"_children": [],
"_tag": -1,
"_active":
fals
e,
"_active":
tru
e,
"_components": [
{
"__id__": 16
...
...
@@ -857,7 +857,7 @@
},
{
"__type__": "cc.Node",
"_name": "
scor
e",
"_name": "
lif
e",
"_objFlags": 0,
"_parent": {
"__id__": 19
...
...
@@ -867,7 +867,7 @@
"_active": true,
"_components": [],
"_prefab": null,
"_id": "
91m1cv1EdIX4yug893AJz7
",
"_id": "
bdSU9wyDZNh7HtK8tnUXyL
",
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
...
...
@@ -905,7 +905,7 @@
},
{
"__type__": "cc.Node",
"_name": "
lif
e",
"_name": "
scor
e",
"_objFlags": 0,
"_parent": {
"__id__": 19
...
...
@@ -913,9 +913,13 @@
"_children": [],
"_tag": -1,
"_active": true,
"_components": [],
"_components": [
{
"__id__": 23
}
],
"_prefab": null,
"_id": "b
dSU9wyDZNh7HtK8tnUXyL
",
"_id": "b
1uW/e8tpKs59VVZbffaZS
",
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
...
...
@@ -952,6 +956,30 @@
"groupIndex": 0
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 22
},
"_enabled": true,
"_spriteFrame": null,
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_atlas": null
},
{
"__type__": "cc.Node",
"_name": "hand",
"_objFlags": 0,
...
...
@@ -963,7 +991,10 @@
"_active": true,
"_components": [
{
"__id__": 24
"__id__": 25
},
{
"__id__": 26
}
],
"_prefab": null,
...
...
@@ -979,8 +1010,8 @@
"_cascadeOpacityEnabled": true,
"_anchorPoint": {
"__type__": "cc.Vec2",
"x":
0.5
,
"y":
0.
5
"x":
-0.35271691256388976
,
"y":
2.530959379050544
5
},
"_contentSize": {
"__type__": "cc.Size",
...
...
@@ -993,8 +1024,8 @@
"_scaleY": 0.4,
"_position": {
"__type__": "cc.Vec2",
"x":
104
,
"y":
-34
0
"x":
0
,
"y": 0
},
"_skewX": 0,
"_skewY": 0,
...
...
@@ -1008,7 +1039,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
3
"__id__": 2
4
},
"_enabled": true,
"_spriteFrame": {
...
...
@@ -1030,6 +1061,15 @@
"_atlas": null
},
{
"__type__": "e6d845SY8hNwLgiBI/kYtQY",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 24
},
"_enabled": true
},
{
"__type__": "cc.Node",
"_name": "failure",
"_objFlags": 0,
...
...
@@ -1162,7 +1202,7 @@
"__id__": 15
},
"hand": {
"__id__": 2
3
"__id__": 2
4
}
}
]
\ No newline at end of file
assets/scripts/Hand.js
0 → 100644
View file @
23f7def1
// Learn cc.Class:
// - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/class.html
// - [English] http://www.cocos2d-x.org/docs/creator/en/scripting/class.html
// Learn Attribute:
// - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/reference/attributes.html
// - [English] http://www.cocos2d-x.org/docs/creator/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
// - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/life-cycle-callbacks.html
// - [English] http://www.cocos2d-x.org/docs/creator/en/scripting/life-cycle-callbacks.html
cc
.
Class
({
extends
:
cc
.
Component
,
properties
:
{
// isFlirting: false,
// timer: 0,
},
flirtingAction
:
function
()
{
// 1.把手放上去 3.过不定时时间,女生showMessage ‘老师,这里有人骚扰’
return
cc
.
moveTo
(
0.1
,
cc
.
p
(
-
30
,
70
))
// 2.加分
// let intervalId = setInterval(()=> {
// // 加上跟老师的判断
// if(isFlirting && !teachers.isSwivel) {
// this.config.score = this.config.score + this.timer++
// } else {
// clearInterval(intervalId)
// }
// }, 1000)
// 3
// femaleStudent.showMessage(messageList[0,1,2])
},
endFlirtingAction
:
function
()
{
return
cc
.
moveTo
(
0.1
,
cc
.
p
(
0
,
0
))
},
setTouchScreenControl
:
function
()
{
var
self
=
this
// 添加屏幕点击事件监听
// 当触碰到屏幕时,设置抚摸开关打开,并执行抚摸方法
self
.
node
.
on
(
cc
.
Node
.
EventType
.
TOUCH_START
,
(
event
)
=>
{
// self.node.on(cc.Node.EventType.MOUSE_DOWN, (event) => {
self
.
isFlirting
=
true
self
.
node
.
runAction
(
self
.
flirtingAction
)
})
// 停止触摸屏幕时,设置抚摸开关关闭,停止抚摸
self
.
node
.
on
(
cc
.
Node
.
EventType
.
TOUCH_END
,
(
event
)
=>
{
// self.node.on(cc.Node.EventType.MOUSE_UP, (event) => {
self
.
isFlirting
=
false
self
.
node
.
runAction
(
self
.
endFlirtingAction
)
})
},
// LIFE-CYCLE CALLBACKS:
onLoad
()
{
// 初始化抚摸的动作
this
.
flirtingAction
=
this
.
flirtingAction
()
// 初始化停止抚摸的动作
this
.
endFlirtingAction
=
this
.
endFlirtingAction
()
// this.node.runAction(this.flirtingAction)
// 抚摸的开关
this
.
isFlirting
=
false
// 抚摸停留时常
this
.
timer
=
0
// 初始化屏幕点击监听
this
.
setTouchScreenControl
()
},
start
()
{
},
update
(
dt
)
{
if
(
this
.
isFlirting
)
{
this
.
game
.
gainScore
()
}
},
});
assets/scripts/Hand.js.meta
0 → 100644
View file @
23f7def1
{
"ver": "1.0.5",
"uuid": "e6d84e52-63c8-4dc0-b822-048fe462d418",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
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