Commit 281d7037 by william

feat: add result image at game success

parent 7e654e47
assets/images/hand.png

43.4 KB | W: | H:

assets/images/hand.png

51.1 KB | W: | H:

assets/images/hand.png
assets/images/hand.png
assets/images/hand.png
assets/images/hand.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -12,14 +12,14 @@ ...@@ -12,14 +12,14 @@
"trimType": "auto", "trimType": "auto",
"trimThreshold": 1, "trimThreshold": 1,
"rotated": false, "rotated": false,
"offsetX": 2, "offsetX": 0,
"offsetY": 0, "offsetY": -111,
"trimX": 4, "trimX": 112,
"trimY": 0, "trimY": 222,
"width": 302, "width": 296,
"height": 378, "height": 378,
"rawWidth": 306, "rawWidth": 520,
"rawHeight": 378, "rawHeight": 600,
"borderTop": 0, "borderTop": 0,
"borderBottom": 0, "borderBottom": 0,
"borderLeft": 0, "borderLeft": 0,
......
{ {
"ver": "1.0.0", "ver": "1.0.0",
"uuid": "d6d5a5b2-191a-4c6e-8468-91b458db29ab", "uuid": "3f9b07d9-b4af-4978-9831-37e849eace53",
"type": "sprite", "type": "sprite",
"wrapMode": "clamp", "wrapMode": "clamp",
"filterMode": "bilinear", "filterMode": "bilinear",
"subMetas": { "subMetas": {
"pic": { "link": {
"ver": "1.0.3", "ver": "1.0.3",
"uuid": "14ce6955-7406-477d-b8bb-f98b662fd140", "uuid": "95d998d5-21ef-47b2-a6e0-6d3f7fb3aaf9",
"rawTextureUuid": "d6d5a5b2-191a-4c6e-8468-91b458db29ab", "rawTextureUuid": "3f9b07d9-b4af-4978-9831-37e849eace53",
"trimType": "auto", "trimType": "auto",
"trimThreshold": 1, "trimThreshold": 1,
"rotated": false, "rotated": false,
...@@ -16,10 +16,10 @@ ...@@ -16,10 +16,10 @@
"offsetY": 0, "offsetY": 0,
"trimX": 0, "trimX": 0,
"trimY": 0, "trimY": 0,
"width": 600, "width": 750,
"height": 400, "height": 1334,
"rawWidth": 600, "rawWidth": 750,
"rawHeight": 400, "rawHeight": 1334,
"borderTop": 0, "borderTop": 0,
"borderBottom": 0, "borderBottom": 0,
"borderLeft": 0, "borderLeft": 0,
......
{
"ver": "1.0.0",
"uuid": "8fecea43-0672-4efd-9348-6a5d418dc84e",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"subMetas": {
"p": {
"ver": "1.0.3",
"uuid": "478e6a9d-e52f-4442-8017-73be1a28bcaf",
"rawTextureUuid": "8fecea43-0672-4efd-9348-6a5d418dc84e",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 296,
"height": 189,
"rawWidth": 296,
"rawHeight": 189,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "fe0014e5-7ed9-438e-b903-a236580d7dc3",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.0.0",
"uuid": "83dedfc0-7e6a-4ef4-b415-c1294c36a108",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"subMetas": {
"p1": {
"ver": "1.0.3",
"uuid": "fa7ed5b1-ede6-4f01-9603-4f218b71f336",
"rawTextureUuid": "83dedfc0-7e6a-4ef4-b415-c1294c36a108",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 296,
"height": 189,
"rawWidth": 296,
"rawHeight": 189,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "1.0.0",
"uuid": "3e3c7274-437b-4f89-9a4a-feac15237989",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"subMetas": {
"p2": {
"ver": "1.0.3",
"uuid": "851c8953-d1a0-4baf-89c9-ecf238b94a84",
"rawTextureUuid": "3e3c7274-437b-4f89-9a4a-feac15237989",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 296,
"height": 189,
"rawWidth": 296,
"rawHeight": 189,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "1.0.0",
"uuid": "470b489a-3063-49d2-a264-0c088c40b7af",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"subMetas": {
"p3": {
"ver": "1.0.3",
"uuid": "19a79d0e-7b4b-403f-9b84-dfdc4a49bbba",
"rawTextureUuid": "470b489a-3063-49d2-a264-0c088c40b7af",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 296,
"height": 189,
"rawWidth": 296,
"rawHeight": 189,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
...@@ -139,6 +139,12 @@ cc.Class({ ...@@ -139,6 +139,12 @@ cc.Class({
default: null, default: null,
type: cc.Node, type: cc.Node,
}, },
// link结点
link: {
default: null,
type: cc.Node,
}
}, },
// 初始化节点 // 初始化节点
...@@ -201,6 +207,10 @@ cc.Class({ ...@@ -201,6 +207,10 @@ cc.Class({
var RankTop = cc.find('rank/playAgain', this.node) var RankTop = cc.find('rank/playAgain', this.node)
RankTop.getComponent('Restart').game = this RankTop.getComponent('Restart').game = this
// 将Game组件的实例传入分享link
var Link = cc.find('link', this.node)
Link.getComponent('Link').game = this
// 播放背景音乐 // 播放背景音乐
this.playBackgroundMusic() this.playBackgroundMusic()
...@@ -236,7 +246,7 @@ cc.Class({ ...@@ -236,7 +246,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.gameState === 'action') {
this.score += 3; this.score += 3;
this.score_number.string = this.score.toString(); this.score_number.string = this.score.toString();
} }
...@@ -320,74 +330,27 @@ cc.Class({ ...@@ -320,74 +330,27 @@ cc.Class({
this.gameState = 'waiting' this.gameState = 'waiting'
this.bgMusic.volume = 1 this.bgMusic.volume = 1
var remoteDomain = 'https://nzr2ybsda.qnssl.com/images/153823/' // var index = Math.floor(Math.random()*3)
var pictures = [
{
"level": 1,
"pictures": [
"https://nzr2ybsda.qnssl.com/images/153823/Fo5on4A0pScy96ePN-2vtToLhHWN.jpg?imageMogr2/strip/thumbnail/260x260>/interlace/1/format/jpg",
"https://nzr2ybsda.qnssl.com/images/153823/FlJQyhmeWyked6lekjh-Yln9nJUD.jpg?imageMogr2/strip/thumbnail/260x260>/interlace/1/format/jpg",
"https://nzr2ybsda.qnssl.com/images/153823/Filk-VYB6CVCDEkHHgRPUc2c6k9T.jpg?imageMogr2/strip/thumbnail/130x130>/interlace/1/format/jpg"
]
},
{
"level": 2,
"pictures": [
"https://nzr2ybsda.qnssl.com/images/153823/FukPQtvtJr-lKlYJPANNPdjjEiyt.jpeg?imageMogr2/strip/thumbnail/130x130>/interlace/1/format/jpg",
"https://nzr2ybsda.qnssl.com/images/153823/Flhh6hGAhnSbuHajEEN-c2dCJfaK.jpg?imageMogr2/strip/thumbnail/130x130>/quality/90!/interlace/1/format/jpg",
"https://nzr2ybsda.qnssl.com/images/153823/FjcKpOaAtIfz4L4Vvkif-EClqn64.jpg?imageMogr2/strip/thumbnail/260x260>/quality/90!/interlace/1/format/jpg"
]
},
{
"level": 3,
"pictures": [
"https://nzr2ybsda.qnssl.com/images/153823/FpyOcbiPM8tDXogYzGDPDEFrO_T9.jpg?imageMogr2/strip/thumbnail/130x130>/quality/90!/interlace/1/format/jpg",
"https://nzr2ybsda.qnssl.com/images/153823/Fn939nNNkFzW_htvSvBkvwvl6TMh.jpg?imageMogr2/strip/thumbnail/130x130>/quality/90!/interlace/1/format/jpg",
"https://nzr2ybsda.qnssl.com/images/153823/Fo_IiyCr10dZIR6J7dJ9y7hs8nae.jpeg?imageMogr2/strip/thumbnail/260x260>/quality/90!/interlace/1/format/jpg"
]
},
{
"level": 4,
"pictures": [
"https://nzr2ybsda.qnssl.com/images/153823/FhUfcO8E990i02gJ7hnpz7xCSc3o.jpg?imageMogr2/strip/thumbnail/130x130>/quality/90!/interlace/1/format/jpg",
"https://nzr2ybsda.qnssl.com/images/153823/FvoIECoOwdGFgeFMuIOIWzAkg61Y.jpg?imageMogr2/strip/thumbnail/260x260>/quality/90!/interlace/1/format/jpg",
"https://nzr2ybsda.qnssl.com/images/153823/FqxgwpiGV-U3KiwK4CHUm1B0zdSH.jpg?imageMogr2/strip/thumbnail/260x260>/interlace/1/format/jpg"
]
},
{
"level": 5,
"pictures": [
"https://nzr2ybsda.qnssl.com/images/153823/Fk-9x5cihrhKFGMZHMglOqQEddkv.jpg?imageMogr2/strip/thumbnail/260x260>/quality/90!/interlace/1/format/jpg",
"https://nzr2ybsda.qnssl.com/images/153823/FkdzV_YWdahiMGKB02Yp2CoTYgMS.jpg?imageMogr2/strip/thumbnail/260x260>/quality/90!/interlace/1/format/jpg",
"https://nzr2ybsda.qnssl.com/images/153823/Fi76VUfm2q-M-4Yyls6V8SbGOBIn.jpg?imageMogr2/strip/thumbnail/260x260>/quality/90!/interlace/1/format/jpg"
]
}
]
var index = Math.floor(Math.random()*3)
var pictureUrl = '' var pictureUrl = ''
if (this.score < 300) { if (this.score < 600) {
pictureUrl = pictures[0].pictures[index] pictureUrl = 'p1'
} else if (this.score < 600) { } else if (this.score < 2000) {
pictureUrl = pictures[1].pictures[index] pictureUrl = 'p2'
} else if (this.score < 900) { } else if (this.score > 2000) {
pictureUrl = pictures[2].pictures[index] pictureUrl = 'p3'
} else if (this.score < 1200) { }
pictureUrl = pictures[3].pictures[index]
} else if (this.score < 1500) {
pictureUrl = pictures[4].pictures[index]
} else if (this.score < 1800) {
pictureUrl = pictures[5].pictures[index]
} else {
pictureUrl = pictures[index].pictures[index]
}
self.success.addComponent(cc.Sprite) self.success.addComponent(cc.Sprite)
cc.loader.loadRes(pictureUrl, cc.SpriteFrame, function (err, spriteFrame) {
cc.loader.load(pictureUrl, function (err, texture) { console.info(self.success.getComponent(cc.Sprite))
// Use texture to create sprite frame self.success.getComponent(cc.Sprite).spriteFrame = spriteFrame
var picture = new cc.SpriteFrame(texture); })
console.info(picture) // cc.loader.load(pictureUrl, function (err, texture) {
self.success.getComponent(cc.Sprite).spriteFrame = picture; // // Use texture to create sprite frame
}); // var picture = new cc.SpriteFrame(texture);
// console.info(picture)
// self.success.getComponent(cc.Sprite).spriteFrame = picture;
// });
}, },
}); });
...@@ -22,7 +22,7 @@ cc.Class({ ...@@ -22,7 +22,7 @@ cc.Class({
}, },
endFlirtingAction: function() { endFlirtingAction: function() {
return cc.moveTo(0.1, cc.p(0, 0)) return cc.moveTo(0.1, cc.p(0, 10))
}, },
setTouchScreenControl: function() { setTouchScreenControl: function() {
......
cc.Class({
extends: cc.Component,
properties: {},
navigateToFinishPage: function () {
var self = this
self.game.clickSound()
self.game.startGame()
},
onLoad: function () {
var self = this
self.node.on(cc.Node.EventType.TOUCH_START, (event) => {
this.navigateToFinishPage()
})
}
});
\ No newline at end of file
{
"ver": "1.0.5",
"uuid": "0663039e-3e15-49b5-ae09-3ea6328e4ef0",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
...@@ -7,6 +7,15 @@ cc.Class({ ...@@ -7,6 +7,15 @@ cc.Class({
shareGame: function () { shareGame: function () {
var self = this var self = this
self.game.clickSound() 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 = false
self.game.link.active = true
self.game.gameState = 'stop'
}, },
onLoad: function () { onLoad: function () {
......
...@@ -13,7 +13,7 @@ cc.Class({ ...@@ -13,7 +13,7 @@ cc.Class({
default: null, default: null,
type: cc.Node, type: cc.Node,
}, },
stupidHead: { // [600, 0] stupidHead: { // [558, 0]
default: null, default: null,
type: cc.Node, type: cc.Node,
}, },
...@@ -57,7 +57,7 @@ cc.Class({ ...@@ -57,7 +57,7 @@ cc.Class({
cc.moveTo(5 * time, cc.p(430, 20)), cc.moveTo(5 * time, cc.p(430, 20)),
enableSwivel, enableSwivel,
cc.delayTime(4 * time), cc.delayTime(4 * time),
cc.moveTo(time, cc.p(600, 0)), cc.moveTo(time, cc.p(558, 0)),
disableSwivel, disableSwivel,
) )
if (!this.isYelling) { if (!this.isYelling) {
......
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