Commit e8d8f1d2 by william

feat: prettier

parent cc39b235
{
"ver": "1.0.1",
"uuid": "a185ebc5-5836-4de5-9fc5-dad679c7d751",
"uuid": "d908cd19-3adf-4674-b964-c93331ca93d9",
"downloadMode": 0,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "a6a7c1ba-95ff-44b0-a20c-f8dab80485a2",
"downloadMode": 0,
"subMetas": {}
}
\ No newline at end of file
......@@ -3903,7 +3903,7 @@
},
"_volume": 1,
"_mute": false,
"_loop": false,
"_loop": true,
"playOnLoad": false,
"preload": false
},
......
......@@ -2,10 +2,8 @@
cc.Class({
extends: cc.Component,
/** 游戏的全局变量 */
properties: {
/** 游戏节点的注册 */
/** 游戏节点的引用 */
// logo节点
logo: {
......@@ -19,6 +17,7 @@ cc.Class({
type: cc.Node,
},
// teacher节点
teacher: {
default: null,
type: cc.Node,
......@@ -44,7 +43,7 @@ cc.Class({
type: cc.Node,
},
// store number节点
// store_number节点
score_number: {
default: null,
type: cc.Label,
......@@ -118,10 +117,12 @@ cc.Class({
default: null,
type: cc.Node,
},
slider2: {
default: null,
type: cc.Node,
},
slider3: {
default: null,
type: cc.Node,
......@@ -140,6 +141,7 @@ cc.Class({
},
},
// 初始化节点
initNode: function() {
var self = this
self.hand.active = true
......@@ -147,12 +149,10 @@ cc.Class({
self.success.active = false
},
initData: function() {
// 初始化游戏数据
initData: function() {
this.score = 0; // 分数
this.timer = 30; // 每一盘游戏的总时间
this.leftLife = 3; // 剩余的命条数
this.swivelAnimationTime = 0.5; //转头动画时间 (单向)
this.flirtAnimationTime = 0.5; //摸的动画时间(单向)
this.gameState = 'waiting'; // 游戏的状态 waiting(待开始) action(游戏中) stop(被抓) over(分数总结)
......@@ -189,11 +189,11 @@ cc.Class({
var failureShare = cc.find('failure/share', this.node)
failureShare.getComponent('Share').game = this
// 将Game组件的实例传入成功的 Rank
// 将Game组件的实例传入游戏成功的 Rank
var successRank = cc.find('success/rank', this.node)
successRank.getComponent('Rank').game = this
// 将Game组件的实例传入失败的Rank
// 将Game组件的实例传入游戏失败的Rank
var failureRank = cc.find('failure/rank', this.node)
failureRank.getComponent('Rank').game = this
......@@ -216,7 +216,6 @@ cc.Class({
} else {
this.gameOver()
}
if(this.level.progress < 0.8 && this.level.progress > 0.2) {
this.level.barSprite.node.color = {
a: 1,
......@@ -248,9 +247,6 @@ cc.Class({
var isFlirting = this.hand.getComponent('Hand').isFlirting
var isSwiveling = this.teacher.getComponent('Teacher').isSwiveling
if (isFlirting) {
this.heartMusic.play()
}
return isSwiveling && isFlirting
},
......
// 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() {
......@@ -43,6 +31,7 @@ cc.Class({
// 当触碰到屏幕时,设置抚摸开关打开,并执行抚摸方法
self.node.on(cc.Node.EventType.TOUCH_START, (event) => {
// self.node.on(cc.Node.EventType.MOUSE_DOWN, (event) => {
self.game.heartMusic.play()
self.isFlirting = true
self.node.runAction(self.flirtingAction)
})
......@@ -50,6 +39,7 @@ cc.Class({
// 停止触摸屏幕时,设置抚摸开关关闭,停止抚摸
self.node.on(cc.Node.EventType.TOUCH_END, (event) => {
// self.node.on(cc.Node.EventType.MOUSE_UP, (event) => {
self.game.heartMusic.pause()
self.isFlirting = false
self.node.runAction(self.endFlirtingAction)
})
......@@ -61,7 +51,6 @@ cc.Class({
})
},
// LIFE-CYCLE CALLBACKS:
onLoad () {
// 初始化抚摸的动作
this.flirtingAction = this.flirtingAction()
......@@ -72,16 +61,11 @@ cc.Class({
this.isFlirting = false
// 抚摸停留时常
this.timer = 0
// 初始化屏幕点击监听
this.setTouchScreenControl()
},
start () {
},
update (dt) {
if (this.isFlirting) {
this.game.gainScore()
......
......@@ -2,12 +2,10 @@ cc.Class({
extends: cc.Component,
properties: {
},
navigateToRankPage: function () {
var self = this
console.info('跳转 rank page')
self.game.clickSound()
self.game.classroom.active = false
self.game.index.active = false
......
......@@ -2,7 +2,6 @@
cc.Class({
extends: cc.Component,
properties: {
},
......
......@@ -2,7 +2,6 @@ cc.Class({
extends: cc.Component,
properties: {
},
shareGame: function () {
......
// 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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment