Commit cc39b235 by william

feat: add action music

parent 2700aa4c
{
"ver": "1.0.1",
"uuid": "a6a7c1ba-95ff-44b0-a20c-f8dab80485a2",
"downloadMode": 0,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.0.0",
"uuid": "6090b59d-b68e-4425-ae70-d291ca8e3af2",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"subMetas": {
"btn-again": {
"ver": "1.0.3",
"uuid": "b9760d5c-3be4-4477-adcb-7dc11ffaae75",
"rawTextureUuid": "6090b59d-b68e-4425-ae70-d291ca8e3af2",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -1,
"offsetY": -2,
"trimX": 6,
"trimY": 10,
"width": 550,
"height": 108,
"rawWidth": 564,
"rawHeight": 124,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "1.0.0",
"uuid": "123ad958-ccc3-4310-9c8d-d4caa90c4904",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"subMetas": {
"btn-share": {
"ver": "1.0.3",
"uuid": "bd1cedb8-1632-442f-bd36-64f2657dff0f",
"rawTextureUuid": "123ad958-ccc3-4310-9c8d-d4caa90c4904",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 6,
"trimY": 8,
"width": 552,
"height": 108,
"rawWidth": 564,
"rawHeight": 124,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "1.0.0",
"uuid": "2692e93c-0077-4f62-9ef1-96527535deb9",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"subMetas": {
"btn-show": {
"ver": "1.0.3",
"uuid": "a832448c-48d1-4848-963f-6bbfab302024",
"rawTextureUuid": "2692e93c-0077-4f62-9ef1-96527535deb9",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": -4,
"trimX": 6,
"trimY": 12,
"width": 552,
"height": 108,
"rawWidth": 564,
"rawHeight": 124,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "1.0.0",
"uuid": "c1bf603b-29e3-4ad9-b332-7be2edfabdea",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"subMetas": {
"chart": {
"ver": "1.0.3",
"uuid": "d5dc6cc1-e18f-42ee-96de-d54e423d911e",
"rawTextureUuid": "c1bf603b-29e3-4ad9-b332-7be2edfabdea",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -1,
"offsetY": -12,
"trimX": 48,
"trimY": 103,
"width": 652,
"height": 778,
"rawWidth": 750,
"rawHeight": 960,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "1.0.0",
"uuid": "3284b7ab-7c6e-4d88-855b-ab2b0a228c18",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"subMetas": {
"data": {
"ver": "1.0.3",
"uuid": "d0e4df99-ac2c-4b0d-9b04-eae52b8e2138",
"rawTextureUuid": "3284b7ab-7c6e-4d88-855b-ab2b0a228c18",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -1,
"offsetY": 0,
"trimX": 2,
"trimY": 2,
"width": 194,
"height": 54,
"rawWidth": 200,
"rawHeight": 58,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "1.0.0",
"uuid": "52acb06b-35fa-42c1-a48c-190c283b935f",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"subMetas": {
"failImage": {
"ver": "1.0.3",
"uuid": "d1dfa86a-f3aa-4764-b9e8-eac1a6e8ca3f",
"rawTextureUuid": "52acb06b-35fa-42c1-a48c-190c283b935f",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": -1,
"trimX": 0,
"trimY": 3,
"width": 750,
"height": 462,
"rawWidth": 750,
"rawHeight": 466,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
assets/images/logo.png

14.2 KB | W: | H:

assets/images/logo.png

27.2 KB | W: | H:

assets/images/logo.png
assets/images/logo.png
assets/images/logo.png
assets/images/logo.png
  • 2-up
  • Swipe
  • Onion skin
{ {
"ver": "1.0.0", "ver": "1.0.0",
"uuid": "d3b617e9-e315-42a7-aaa4-7f1b67e9df35", "uuid": "5263ac39-6329-44a0-9072-27995d2e1e68",
"type": "sprite", "type": "sprite",
"wrapMode": "clamp", "wrapMode": "clamp",
"filterMode": "bilinear", "filterMode": "bilinear",
"subMetas": { "subMetas": {
"logo": { "logo": {
"ver": "1.0.3", "ver": "1.0.3",
"uuid": "26869b11-f810-4bbe-994e-793228a11892", "uuid": "7123ec22-5e64-49d2-9841-c87ffc49b634",
"rawTextureUuid": "d3b617e9-e315-42a7-aaa4-7f1b67e9df35", "rawTextureUuid": "5263ac39-6329-44a0-9072-27995d2e1e68",
"trimType": "auto", "trimType": "auto",
"trimThreshold": 1, "trimThreshold": 1,
"rotated": false, "rotated": false,
"offsetX": 0, "offsetX": 0,
"offsetY": 0, "offsetY": 1,
"trimX": 0, "trimX": 11,
"trimY": 0, "trimY": 10,
"width": 332, "width": 482,
"height": 110, "height": 210,
"rawWidth": 332, "rawWidth": 504,
"rawHeight": 110, "rawHeight": 232,
"borderTop": 0, "borderTop": 0,
"borderBottom": 0, "borderBottom": 0,
"borderLeft": 0, "borderLeft": 0,
......
{ {
"ver": "1.0.0", "ver": "1.0.0",
"uuid": "b6d7d820-6cd3-44b3-8b40-54693bedcde8", "uuid": "0167ae5c-9658-4bd6-a0b5-fd8c45cefdf8",
"type": "sprite", "type": "sprite",
"wrapMode": "clamp", "wrapMode": "clamp",
"filterMode": "bilinear", "filterMode": "bilinear",
"subMetas": { "subMetas": {
"heart": { "stupidHead": {
"ver": "1.0.3", "ver": "1.0.3",
"uuid": "203a4498-7630-44ec-b721-b71e8b43723c", "uuid": "b22e746a-2b44-4038-ad97-9b602b1020be",
"rawTextureUuid": "b6d7d820-6cd3-44b3-8b40-54693bedcde8", "rawTextureUuid": "0167ae5c-9658-4bd6-a0b5-fd8c45cefdf8",
"trimType": "auto", "trimType": "auto",
"trimThreshold": 1, "trimThreshold": 1,
"rotated": false, "rotated": false,
"offsetX": 0, "offsetX": 0,
"offsetY": -0.5, "offsetY": -2.5,
"trimX": 20, "trimX": 0,
"trimY": 5, "trimY": 5,
"width": 412, "width": 136,
"height": 43, "height": 387,
"rawWidth": 452, "rawWidth": 136,
"rawHeight": 52, "rawHeight": 392,
"borderTop": 0, "borderTop": 0,
"borderBottom": 0, "borderBottom": 0,
"borderLeft": 0, "borderLeft": 0,
......
...@@ -89,6 +89,30 @@ cc.Class({ ...@@ -89,6 +89,30 @@ cc.Class({
type: cc.AudioSource, type: cc.AudioSource,
}, },
// 点击音乐节点
clickMusic: {
default: null,
type: cc.AudioSource,
},
// 咆哮音乐
roarMusic: {
default: null,
type: cc.AudioSource,
},
// 报警音乐
policeMusic: {
default: null,
type: cc.AudioSource,
},
// 心跳音乐
heartMusic: {
default: null,
type: cc.AudioSource,
},
// slider节点 // slider节点
slider1: { slider1: {
default: null, default: null,
...@@ -108,6 +132,12 @@ cc.Class({ ...@@ -108,6 +132,12 @@ cc.Class({
default: null, default: null,
type: cc.SpriteFrame type: cc.SpriteFrame
}, },
// 排行榜节点
rank: {
default: null,
type: cc.Node,
},
}, },
initNode: function() { initNode: function() {
...@@ -121,7 +151,7 @@ cc.Class({ ...@@ -121,7 +151,7 @@ cc.Class({
initData: function() { initData: function() {
// 初始化游戏数据 // 初始化游戏数据
this.score = 0; // 分数 this.score = 0; // 分数
this.timer = 3; // 每一盘游戏的总时间 this.timer = 30; // 每一盘游戏的总时间
this.leftLife = 3; // 剩余的命条数 this.leftLife = 3; // 剩余的命条数
this.swivelAnimationTime = 0.5; //转头动画时间 (单向) this.swivelAnimationTime = 0.5; //转头动画时间 (单向)
this.flirtAnimationTime = 0.5; //摸的动画时间(单向) this.flirtAnimationTime = 0.5; //摸的动画时间(单向)
...@@ -143,19 +173,37 @@ cc.Class({ ...@@ -143,19 +173,37 @@ cc.Class({
var hand = cc.find('hand', this.node) var hand = cc.find('hand', this.node)
hand.getComponent('Hand').game = this hand.getComponent('Hand').game = this
// 将Game组件的实例传入playAgain // 将Game组件的实例传入成功的playAgain
var successPlayAgain = cc.find('success/playAgain', this.node) var successPlayAgain = cc.find('success/playAgain', this.node)
successPlayAgain.getComponent('Restart').game = this successPlayAgain.getComponent('Restart').game = this
// 将Game组件的实例传入失败的playAgain
var failurePlayAgain = cc.find('failure/playAgain', this.node) var failurePlayAgain = cc.find('failure/playAgain', this.node)
failurePlayAgain.getComponent('Restart').game = this failurePlayAgain.getComponent('Restart').game = this
// 将Game组件的实例传入成功的Share
var successShare = cc.find('success/share', this.node)
successShare.getComponent('Share').game = this
// 将Game组件的实例传入失败的Share
var failureShare = cc.find('failure/share', this.node)
failureShare.getComponent('Share').game = this
// 将Game组件的实例传入成功的 Rank
var successRank = cc.find('success/rank', this.node)
successRank.getComponent('Rank').game = this
// 将Game组件的实例传入失败的Rank
var failureRank = cc.find('failure/rank', this.node)
failureRank.getComponent('Rank').game = this
// 将Game组件的实例传入排行榜Rank
var RankTop = cc.find('rank/playAgain', this.node)
RankTop.getComponent('Restart').game = this
// 播放背景音乐 // 播放背景音乐
this.playBackgroundMusic() this.playBackgroundMusic()
// 执行轮播图
}, },
// 更改时间进度条 // 更改时间进度条
...@@ -171,17 +219,17 @@ cc.Class({ ...@@ -171,17 +219,17 @@ cc.Class({
if(this.level.progress < 0.8 && this.level.progress > 0.2) { if(this.level.progress < 0.8 && this.level.progress > 0.2) {
this.level.barSprite.node.color = { this.level.barSprite.node.color = {
a: 255, a: 1,
b: 234, b: 64,
g: 56, g: 178,
r: 241 r: 239
} }
} else if (this.level.progress <= 0.2) { } else if (this.level.progress <= 0.2) {
this.level.barSprite.node.color = { this.level.barSprite.node.color = {
a: 255, a: 1,
b: 0, b: 75,
g: 0, g: 76,
r: 255, r: 232,
} }
} }
}, },
...@@ -190,7 +238,7 @@ cc.Class({ ...@@ -190,7 +238,7 @@ cc.Class({
gainScore: function() { gainScore: function() {
var isYelling = this.teacher.getComponent('Teacher').isYelling var isYelling = this.teacher.getComponent('Teacher').isYelling
if (!isYelling) { if (!isYelling) {
this.score += 1; this.score += 3;
this.score_number.string = this.score.toString(); this.score_number.string = this.score.toString();
} }
}, },
...@@ -200,16 +248,42 @@ cc.Class({ ...@@ -200,16 +248,42 @@ cc.Class({
var isFlirting = this.hand.getComponent('Hand').isFlirting var isFlirting = this.hand.getComponent('Hand').isFlirting
var isSwiveling = this.teacher.getComponent('Teacher').isSwiveling var isSwiveling = this.teacher.getComponent('Teacher').isSwiveling
if (isFlirting) {
this.heartMusic.play()
}
return isSwiveling && isFlirting return isSwiveling && isFlirting
}, },
// 添加背景音乐 // 播放背景音乐
playBackgroundMusic: function() { playBackgroundMusic: function() {
this.bgMusic.play() this.bgMusic.play()
}, },
// 停止背景音乐
stopBackgroundMusic: function() {
this.bgMusic.pause()
},
// 添加点击音效
clickSound: function () {
this.clickMusic.play()
},
// 播发咆哮音效
playRoarMusic: function() {
this.roarMusic.play()
},
// 播放报警音乐
playPoliceMusic: function() {
this.policeMusic.play()
},
// 播放心跳音乐
playHeartMusic: function() {
this.heartMusic.play()
},
// 游戏帧循环 // 游戏帧循环
update: function(dt) { update: function(dt) {
if (this.gameState === 'action') { if (this.gameState === 'action') {
......
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
self.game.board.active = false
self.game.teacher.active = false
self.game.failure.active = false
self.game.success.active = false
self.game.rank.active = true
self.game.gameState = 'stop'
},
onLoad: function () {
var self = this
self.node.on(cc.Node.EventType.TOUCH_START, (event) => {
this.navigateToRankPage()
})
}
});
{
"ver": "1.0.5",
"uuid": "fbe28a06-680d-4843-8b07-4fcb8cbd3072",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
...@@ -8,11 +8,15 @@ cc.Class({ ...@@ -8,11 +8,15 @@ cc.Class({
}, },
restartGame: function() { restartGame: function() {
var self = this; var self = this
self.game.clickSound()
self.game.startGame() self.game.startGame()
}, },
onLoad: function() { onLoad: function() {
this.node.on('click', this.restartGame, this) var self = this
self.node.on(cc.Node.EventType.TOUCH_START, (event) => {
this.restartGame()
})
} }
}); });
cc.Class({
extends: cc.Component,
properties: {
},
shareGame: function () {
var self = this
self.game.clickSound()
},
onLoad: function () {
var self = this
self.node.on(cc.Node.EventType.TOUCH_START, (event) => {
this.shareGame()
})
}
});
\ No newline at end of file
{
"ver": "1.0.5",
"uuid": "906785ee-cf90-47d6-9e02-acd395976964",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
...@@ -9,6 +9,7 @@ cc.Class({ ...@@ -9,6 +9,7 @@ cc.Class({
setTouchBtnListener: function () { setTouchBtnListener: function () {
var self = this; var self = this;
self.node.on(cc.Node.EventType.TOUCH_START, function (event) { self.node.on(cc.Node.EventType.TOUCH_START, function (event) {
self.game.clickSound()
self.game.classroom.active = true self.game.classroom.active = true
self.game.index.active = false self.game.index.active = false
self.game.board.active = true self.game.board.active = true
......
...@@ -109,11 +109,14 @@ cc.Class({ ...@@ -109,11 +109,14 @@ cc.Class({
this.isYelling = true this.isYelling = true
var gameFail = cc.callFunc(function() { var gameFail = cc.callFunc(function() {
this.game.gameFail() this.game.gameFail()
this.game.playPoliceMusic()
}, this) }, this)
var action = cc.sequence( var action = cc.sequence(
cc.moveTo(0.2, cc.p(260, -30)), cc.moveTo(0.2, cc.p(260, -30)),
cc.delayTime(40), this.game.stopBackgroundMusic(),
this.game.playRoarMusic(),
cc.delayTime(2.5),
gameFail, gameFail,
) )
......
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