Commit 2700aa4c by Tulip Li

add beauty picturegst

parent b8715fce
......@@ -17,7 +17,7 @@
"__id__": 2
},
{
"__id__": 93
"__id__": 91
}
],
"_tag": -1,
......@@ -90,10 +90,10 @@
"_active": true,
"_components": [
{
"__id__": 90
"__id__": 88
},
{
"__id__": 91
"__id__": 89
}
],
"_prefab": null,
......@@ -2767,9 +2767,6 @@
},
{
"__id__": 86
},
{
"__id__": 88
}
],
"_tag": -1,
......@@ -3312,7 +3309,7 @@
"_scaleY": 1,
"_position": {
"__type__": "cc.Vec2",
"x": -9,
"x": 0,
"y": 241
},
"_skewX": 0,
......@@ -3346,80 +3343,6 @@
},
{
"__type__": "cc.Node",
"_name": "subtitle",
"_objFlags": 0,
"_parent": {
"__id__": 70
},
"_children": [],
"_tag": -1,
"_active": true,
"_components": [
{
"__id__": 85
}
],
"_prefab": null,
"_id": "b1KfGWjbNCRYDR/FY52SG2",
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 10,
"g": 10,
"b": 10,
"a": 255
},
"_cascadeOpacityEnabled": true,
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_contentSize": {
"__type__": "cc.Size",
"width": 243,
"height": 40
},
"_rotationX": 0,
"_rotationY": 0,
"_scaleX": 1,
"_scaleY": 1,
"_position": {
"__type__": "cc.Vec2",
"x": 3,
"y": -43
},
"_skewX": 0,
"_skewY": 0,
"_localZOrder": 0,
"_globalZOrder": 0,
"_opacityModifyRGB": false,
"groupIndex": 0
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 84
},
"_enabled": true,
"_useOriginalSize": false,
"_actualFontSize": 25,
"_fontSize": 25,
"_lineHeight": 40,
"_enableWrapText": true,
"_N$file": null,
"_isSystemFontUsed": true,
"_spacingX": 0,
"_N$string": "获得\"撩妹小能手\"称号",
"_N$horizontalAlign": 1,
"_N$verticalAlign": 1,
"_N$fontFamily": "Arial",
"_N$overflow": 0
},
{
"__type__": "cc.Node",
"_name": "heart",
"_objFlags": 0,
"_parent": {
......@@ -3430,7 +3353,7 @@
"_active": true,
"_components": [
{
"__id__": 87
"__id__": 85
}
],
"_prefab": null,
......@@ -3460,7 +3383,7 @@
"_scaleY": 1,
"_position": {
"__type__": "cc.Vec2",
"x": -12,
"x": 0,
"y": 188
},
"_skewX": 0,
......@@ -3475,7 +3398,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 86
"__id__": 84
},
"_enabled": true,
"_useOriginalSize": false,
......@@ -3504,7 +3427,7 @@
"_active": true,
"_components": [
{
"__id__": 89
"__id__": 87
}
],
"_prefab": null,
......@@ -3534,8 +3457,8 @@
"_scaleY": 1,
"_position": {
"__type__": "cc.Vec2",
"x": -8,
"y": 72
"x": 0,
"y": 120
},
"_skewX": 0,
"_skewY": 0,
......@@ -3549,14 +3472,14 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 88
"__id__": 86
},
"_enabled": true,
"_useOriginalSize": false,
"_actualFontSize": 100,
"_fontSize": 100,
"_lineHeight": 100,
"_enableWrapText": false,
"_enableWrapText": true,
"_N$file": null,
"_isSystemFontUsed": true,
"_spacingX": 0,
......@@ -3624,10 +3547,10 @@
"__id__": 70
},
"success_result": {
"__id__": 89
"__id__": 87
},
"bgMusic": {
"__id__": 92
"__id__": 90
},
"slider1": {
"__id__": 21
......@@ -3637,14 +3560,15 @@
},
"slider3": {
"__id__": 17
}
},
"spriteFrame": null
},
{
"__type__": "cc.AudioSource",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 93
"__id__": 91
},
"_enabled": true,
"_clip": {
......@@ -3668,7 +3592,7 @@
"_active": true,
"_components": [
{
"__id__": 92
"__id__": 90
}
],
"_prefab": null,
......
......@@ -101,7 +101,13 @@ cc.Class({
slider3: {
default: null,
type: cc.Node,
}
},
// 动态图片
spriteFrame: {
default: null,
type: cc.SpriteFrame
},
},
initNode: function() {
......@@ -115,7 +121,7 @@ cc.Class({
initData: function() {
// 初始化游戏数据
this.score = 0; // 分数
this.timer = 10; // 每一盘游戏的总时间
this.timer = 3; // 每一盘游戏的总时间
this.leftLife = 3; // 剩余的命条数
this.swivelAnimationTime = 0.5; //转头动画时间 (单向)
this.flirtAnimationTime = 0.5; //摸的动画时间(单向)
......@@ -234,6 +240,7 @@ cc.Class({
// 游戏结束
gameOver: function() {
var self = this
this.success_result.string = this.score.toString()
this.classroom.active = false
this.success.active = true
......@@ -241,5 +248,75 @@ cc.Class({
this.board.active = false
this.teacher.active = false
this.gameState = 'waiting'
var remoteDomain = 'https://nzr2ybsda.qnssl.com/images/153823/'
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 = ''
if (this.score < 300) {
pictureUrl = pictures[0].pictures[index]
} else if (this.score < 600) {
pictureUrl = pictures[1].pictures[index]
} else if (this.score < 900) {
pictureUrl = pictures[2].pictures[index]
} 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)
cc.loader.load(pictureUrl, function (err, texture) {
// Use texture to create sprite frame
var picture = new cc.SpriteFrame(texture);
console.info(picture)
self.success.getComponent(cc.Sprite).spriteFrame = picture;
});
},
});
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