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
a456cd7e
Commit
a456cd7e
authored
May 05, 2018
by
william
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: init Game.js
parent
ec69a80b
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
226 additions
and
42 deletions
+226
-42
game.fire
assets/game.fire
+126
-13
start_btn.png
assets/images/start_btn.png
+0
-0
start_btn.png.meta
assets/images/start_btn.png.meta
+1
-1
Game.js
assets/scripts/Game.js
+69
-28
Start.js
assets/scripts/Start.js
+20
-0
Start.js.meta
assets/scripts/Start.js.meta
+10
-0
No files found.
assets/game.fire
View file @
a456cd7e
...
...
@@ -68,17 +68,20 @@
"__id__": 9
},
{
"__id__": 1
1
"__id__": 1
4
},
{
"__id__": 1
3
"__id__": 1
6
}
],
"_tag": -1,
"_active": true,
"_components": [
{
"__id__": 15
"__id__": 18
},
{
"__id__": 19
}
],
"_prefab": null,
...
...
@@ -308,7 +311,7 @@
"_contentSize": {
"__type__": "cc.Size",
"width": 160,
"height":
8
0
"height":
12
0
},
"_rotationX": 0,
"_rotationY": 0,
...
...
@@ -342,7 +345,7 @@
"_N$file": null,
"_isSystemFontUsed": true,
"_spacingX": 0,
"_N$string": "在下课前快速撩妹\n避免被老师发现",
"_N$string": "
点击屏幕开始撩妹\n
在下课前快速撩妹\n避免被老师发现",
"_N$horizontalAlign": 1,
"_N$verticalAlign": 1,
"_N$fontFamily": "Arial",
...
...
@@ -350,17 +353,24 @@
},
{
"__type__": "cc.Node",
"_name": "
btn-start
",
"_name": "
start_btn
",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [],
"_children": [
{
"__id__": 10
}
],
"_tag": -1,
"_active": true,
"_components": [
{
"__id__": 10
"__id__": 12
},
{
"__id__": 13
}
],
"_prefab": null,
...
...
@@ -401,6 +411,68 @@
"groupIndex": 0
},
{
"__type__": "cc.Node",
"_name": "Start",
"_objFlags": 0,
"_parent": {
"__id__": 9
},
"_children": [],
"_tag": -1,
"_active": true,
"_components": [
{
"__id__": 11
}
],
"_prefab": null,
"_id": "f6tbdlSzFHwKHIkKiKfGBl",
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_cascadeOpacityEnabled": true,
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
},
"_rotationX": 0,
"_rotationY": 0,
"_scaleX": 1,
"_scaleY": 1,
"_position": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_skewX": 0,
"_skewY": 0,
"_localZOrder": 0,
"_globalZOrder": 0,
"_opacityModifyRGB": false,
"groupIndex": 0
},
{
"__type__": "729abdON3JFXqpKBchOOYfX",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 10
},
"_enabled": true,
"isOpenGame": false
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
...
...
@@ -427,6 +499,16 @@
"_atlas": null
},
{
"__type__": "729abdON3JFXqpKBchOOYfX",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 9
},
"_enabled": true,
"isOpenGame": false
},
{
"__type__": "cc.Node",
"_name": "classroom",
"_objFlags": 0,
...
...
@@ -435,10 +517,10 @@
},
"_children": [],
"_tag": -1,
"_active":
tru
e,
"_active":
fals
e,
"_components": [
{
"__id__": 1
2
"__id__": 1
5
}
],
"_prefab": null,
...
...
@@ -483,7 +565,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
1
"__id__": 1
4
},
"_enabled": true,
"_spriteFrame": {
...
...
@@ -516,7 +598,7 @@
"_active": true,
"_components": [
{
"__id__": 1
4
"__id__": 1
7
}
],
"_prefab": null,
...
...
@@ -561,7 +643,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
3
"__id__": 1
6
},
"_enabled": true,
"_spriteFrame": {
...
...
@@ -597,5 +679,35 @@
},
"_fitWidth": false,
"_fitHeight": true
},
{
"__type__": "e4c9b01WKRDtYbVX2Ed1Nfl",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"score": 0,
"time": 60,
"leftLife": 3,
"swivelAnimationTime": 0.2,
"flirtAnimationTime": 0.2,
"gameState": "waiting",
"logo": {
"__id__": 5
},
"subtitle": {
"__id__": 7
},
"start_btn": {
"__id__": 9
},
"classroom": {
"__id__": 14
},
"hand": {
"__id__": 16
}
}
]
\ No newline at end of file
assets/images/
btn-start
.png
→
assets/images/
start_btn
.png
View file @
a456cd7e
File moved
assets/images/
btn-start
.png.meta
→
assets/images/
start_btn
.png.meta
View file @
a456cd7e
...
...
@@ -5,7 +5,7 @@
"wrapMode": "clamp",
"filterMode": "bilinear",
"subMetas": {
"
btn-start
": {
"
start_btn
": {
"ver": "1.0.3",
"uuid": "39ffe8bc-c233-4562-94b9-3c2f2c82b452",
"rawTextureUuid": "ac77b207-d6ae-4829-acdc-352b6e8a2153",
...
...
assets/scripts/Game.js
View file @
a456cd7e
// 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
:
{
// foo: {
// // ATTRIBUTES:
// default: null, // The default value will be used only when the component attaching
// // to a node for the first time
// type: cc.SpriteFrame, // optional, default is typeof default
// serializable: true, // optional, default is true
// },
// bar: {
// get () {
// return this._bar;
// },
// set (value) {
// this._bar = value;
// }
// },
/** 游戏节点的注册 */
// logo节点
logo
:
{
default
:
null
,
type
:
cc
.
Node
,
},
// LIFE-CYCLE CALLBACKS:
// subtitle节点
subtitle
:
{
default
:
null
,
type
:
cc
.
Node
,
},
// onLoad () {},
// btn_start节点
start_btn
:
{
default
:
null
,
type
:
cc
.
Node
,
},
start
()
{
// classroom节点
classroom
:
{
default
:
null
,
type
:
cc
.
Node
,
},
// hand节点
hand
:
{
default
:
null
,
type
:
cc
.
Node
,
},
},
// update (dt) {},
onLoad
:
function
()
{
// 初始化游戏数据
this
.
score
=
0
;
// 分数
this
.
timer
=
60
;
// 每一盘游戏的总时间
this
.
leftLife
=
3
;
// 剩余的命条数
this
.
gameState
=
"waitting"
;
// 游戏的状态 waiting(待开始) action(游戏中) stop(被抓) over(分数总结)
this
.
swivelAnimationTime
=
0.5
;
//转头动画时间 (单向)
this
.
flirtAnimationTime
=
0.5
;
//摸的动画时间(单向)
// 奖Game组件的实例传入开始按钮
var
startBtn
=
this
.
node
.
getChildByName
(
"start_btn"
);
startBtn
.
getComponent
(
'Start'
).
game
=
this
;
},
// 添加分数
gainScore
:
function
()
{
this
.
score
+=
1
;
},
// 游戏帧循环
update
:
function
(
dt
)
{
},
// 游戏开始
startGame
:
function
()
{
},
// 游戏暂停
stopGame
:
function
()
{
},
// 游戏结束
gameOver
:
function
()
{
},
});
assets/scripts/Start.js
0 → 100644
View file @
a456cd7e
cc
.
Class
({
extends
:
cc
.
Component
,
properties
:
{
isOpenGame
:
false
},
setTouchBtnListener
:
function
()
{
var
self
=
this
;
self
.
node
.
on
(
cc
.
Node
.
EventType
.
MOUSE_DOWN
,
function
(
event
)
{
self
.
game
.
classroom
.
active
=
true
})
},
onLoad
:
function
()
{
// 初始化跳跃动作
this
.
setTouchBtnListener
()
},
});
assets/scripts/Start.js.meta
0 → 100644
View file @
a456cd7e
{
"ver": "1.0.5",
"uuid": "729ab74e-3772-455e-aa4a-05c84e3987d7",
"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