From 0fafa426cc327b669310863cf08917f83f7718d8 Mon Sep 17 00:00:00 2001 From: leo <907600065@qq.com> Date: Tue, 24 Dec 2019 15:16:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=80=81=E8=99=8E=E6=9C=BA/?= =?UTF-8?q?=E6=B0=B4=E6=9E=9C=E6=9C=BA=E8=BD=AE=E8=BD=AC=E5=8A=A8=E7=94=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HorseRaceLamp/assets/RollingMachine.js | 76 + HorseRaceLamp/assets/RollingMachine.js.meta | 9 + HorseRaceLamp/assets/SlotMachine.fire | 1445 +++++++++++++++++++ HorseRaceLamp/assets/SlotMachine.fire.meta | 7 + HorseRaceLamp/assets/SlotMachine.js | 44 + HorseRaceLamp/assets/SlotMachine.js.meta | 9 + 6 files changed, 1590 insertions(+) create mode 100644 HorseRaceLamp/assets/RollingMachine.js create mode 100644 HorseRaceLamp/assets/RollingMachine.js.meta create mode 100644 HorseRaceLamp/assets/SlotMachine.fire create mode 100644 HorseRaceLamp/assets/SlotMachine.fire.meta create mode 100644 HorseRaceLamp/assets/SlotMachine.js create mode 100644 HorseRaceLamp/assets/SlotMachine.js.meta diff --git a/HorseRaceLamp/assets/RollingMachine.js b/HorseRaceLamp/assets/RollingMachine.js new file mode 100644 index 0000000..2d3374c --- /dev/null +++ b/HorseRaceLamp/assets/RollingMachine.js @@ -0,0 +1,76 @@ +cc.Class({ + extends: cc.Component, + + properties: { + list: [cc.Node], + loopTimes: 4, + awardTime: 1, + loopTimeList: [cc.Float] + }, + + onLoad() { + this.flickerTime = 0.15; + // this.loopTimeList = [0.04, 0.04, 0.12, 0.2, 0.2]; + }, + + registerEvent() { + + }, + + init(data) { + + }, + + play(index, fn) { + let seqList = [], len = this.list.length, i = 0, deltaTime = 0; + let realTimes = len * this.loopTimes + index; + for (i = 0; i <= realTimes; i++) { + if (realTimes - i < 3) { + deltaTime += this.loopTimeList[this.loopTimeList.length - 1]; + } + let item = this.list[i % len]; + seqList.push(this.createAction(item, this.loopTimeList[Math.floor(i / len)] + deltaTime, true)); + } + for (i = 0; i < 3; i++) { + let item = this.list[index]; + seqList.push(this.createAction(item, this.flickerTime, false)); + seqList.push(cc.delayTime(this.flickerTime)); + } + + seqList.push(cc.delayTime(this.awardTime)); + seqList.push(cc.callFunc(() => { + fn && fn(); + })); + + this.node.runAction(cc.sequence(seqList)); + }, + + createAction(item, time, isShow) { + let seq = cc.sequence(cc.callFunc((data) => { + item.active = isShow; + }), cc.delayTime(time), cc.callFunc((data) => { + item.active = !isShow; + })); + return seq; + }, + + update(dt) { + + }, + + onEnable() { + this.registerEvent(); + }, + + onDisable() { + this.offEvent(); + }, + + offEvent() { + cc.emitter.offThis(this); + }, + + onDestroy() { + + } +}); \ No newline at end of file diff --git a/HorseRaceLamp/assets/RollingMachine.js.meta b/HorseRaceLamp/assets/RollingMachine.js.meta new file mode 100644 index 0000000..356c38c --- /dev/null +++ b/HorseRaceLamp/assets/RollingMachine.js.meta @@ -0,0 +1,9 @@ +{ + "ver": "1.0.5", + "uuid": "1d222780-1af2-440a-8e0b-749bd8755e19", + "isPlugin": false, + "loadPluginInWeb": true, + "loadPluginInNative": true, + "loadPluginInEditor": false, + "subMetas": {} +} \ No newline at end of file diff --git a/HorseRaceLamp/assets/SlotMachine.fire b/HorseRaceLamp/assets/SlotMachine.fire new file mode 100644 index 0000000..0843be9 --- /dev/null +++ b/HorseRaceLamp/assets/SlotMachine.fire @@ -0,0 +1,1445 @@ +[ + { + "__type__": "cc.SceneAsset", + "_name": "", + "_objFlags": 0, + "_rawFiles": null, + "scene": { + "__id__": 1 + } + }, + { + "__type__": "cc.Scene", + "_objFlags": 0, + "_parent": null, + "_children": [ + { + "__id__": 2 + } + ], + "_tag": -1, + "_active": true, + "_components": [], + "_prefab": null, + "_id": "31bca123-0de6-409a-94d8-28d1b2634535", + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_cascadeOpacityEnabled": true, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 0, + "height": 0 + }, + "_localZOrder": 0, + "_globalZOrder": 0, + "_opacityModifyRGB": false, + "groupIndex": 0, + "autoReleaseAssets": false + }, + { + "__type__": "cc.Node", + "_name": "Canvas", + "_objFlags": 0, + "_parent": { + "__id__": 1 + }, + "_children": [ + { + "__id__": 3 + }, + { + "__id__": 29 + } + ], + "_tag": -1, + "_active": true, + "_components": [ + { + "__id__": 35 + }, + { + "__id__": 36 + } + ], + "_prefab": null, + "_id": "81b+qLVsNPcJ56dNigXhPS", + "_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": 960, + "height": 640 + }, + "_rotationX": 0, + "_rotationY": 0, + "_scaleX": 1, + "_scaleY": 1, + "_position": { + "__type__": "cc.Vec2", + "x": 480, + "y": 320 + }, + "_skewX": 0, + "_skewY": 0, + "_localZOrder": 0, + "_globalZOrder": 0, + "_opacityModifyRGB": false, + "groupIndex": 0 + }, + { + "__type__": "cc.Node", + "_name": "List", + "_objFlags": 0, + "_parent": { + "__id__": 2 + }, + "_children": [ + { + "__id__": 4 + }, + { + "__id__": 8 + }, + { + "__id__": 12 + }, + { + "__id__": 16 + }, + { + "__id__": 20 + }, + { + "__id__": 24 + } + ], + "_tag": -1, + "_active": true, + "_components": [ + { + "__id__": 28 + } + ], + "_prefab": null, + "_id": "9dvb4pUCVEWJu5Lt1qL98g", + "_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__": "cc.Node", + "_name": "item", + "_objFlags": 0, + "_parent": { + "__id__": 3 + }, + "_children": [ + { + "__id__": 5 + } + ], + "_tag": -1, + "_active": true, + "_components": [ + { + "__id__": 7 + } + ], + "_prefab": null, + "_id": "72TGwUpzBHg6XrwKWQDQUW", + "_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": 100, + "height": 100 + }, + "_rotationX": 0, + "_rotationY": 0, + "_scaleX": 1, + "_scaleY": 1, + "_position": { + "__type__": "cc.Vec2", + "x": -200, + "y": 100 + }, + "_skewX": 0, + "_skewY": 0, + "_localZOrder": 0, + "_globalZOrder": 0, + "_opacityModifyRGB": false, + "groupIndex": 0 + }, + { + "__type__": "cc.Node", + "_name": "element", + "_objFlags": 0, + "_parent": { + "__id__": 4 + }, + "_children": [], + "_tag": -1, + "_active": false, + "_components": [ + { + "__id__": 6 + } + ], + "_prefab": null, + "_id": "73Ne8Q+WpB9pPlqhQkuQo4", + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 250, + "g": 56, + "b": 56, + "a": 255 + }, + "_cascadeOpacityEnabled": true, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 90, + "height": 90 + }, + "_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__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 5 + }, + "_enabled": true, + "_spriteFrame": { + "__uuid__": "a23235d1-15db-4b95-8439-a2e005bfff91" + }, + "_type": 0, + "_sizeMode": 0, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_atlas": null + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 4 + }, + "_enabled": true, + "_spriteFrame": { + "__uuid__": "a23235d1-15db-4b95-8439-a2e005bfff91" + }, + "_type": 0, + "_sizeMode": 0, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_atlas": null + }, + { + "__type__": "cc.Node", + "_name": "item", + "_objFlags": 0, + "_parent": { + "__id__": 3 + }, + "_children": [ + { + "__id__": 9 + } + ], + "_tag": -1, + "_active": true, + "_components": [ + { + "__id__": 11 + } + ], + "_prefab": null, + "_id": "8eE/pxjOdBc6o/f5Pz6JWN", + "_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": 100, + "height": 100 + }, + "_rotationX": 0, + "_rotationY": 0, + "_scaleX": 1, + "_scaleY": 1, + "_position": { + "__type__": "cc.Vec2", + "x": 0, + "y": 100 + }, + "_skewX": 0, + "_skewY": 0, + "_localZOrder": 0, + "_globalZOrder": 0, + "_opacityModifyRGB": false, + "groupIndex": 0 + }, + { + "__type__": "cc.Node", + "_name": "element", + "_objFlags": 0, + "_parent": { + "__id__": 8 + }, + "_children": [], + "_tag": -1, + "_active": false, + "_components": [ + { + "__id__": 10 + } + ], + "_prefab": null, + "_id": "51+fwHb9VGrqtnbbx/ozm1", + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 250, + "g": 56, + "b": 56, + "a": 255 + }, + "_cascadeOpacityEnabled": true, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 90, + "height": 90 + }, + "_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__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 9 + }, + "_enabled": true, + "_spriteFrame": { + "__uuid__": "a23235d1-15db-4b95-8439-a2e005bfff91" + }, + "_type": 0, + "_sizeMode": 0, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_atlas": null + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 8 + }, + "_enabled": true, + "_spriteFrame": { + "__uuid__": "a23235d1-15db-4b95-8439-a2e005bfff91" + }, + "_type": 0, + "_sizeMode": 0, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_atlas": null + }, + { + "__type__": "cc.Node", + "_name": "item", + "_objFlags": 0, + "_parent": { + "__id__": 3 + }, + "_children": [ + { + "__id__": 13 + } + ], + "_tag": -1, + "_active": true, + "_components": [ + { + "__id__": 15 + } + ], + "_prefab": null, + "_id": "07xvxjzB5DXa4j+pWNrKyy", + "_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": 100, + "height": 100 + }, + "_rotationX": 0, + "_rotationY": 0, + "_scaleX": 1, + "_scaleY": 1, + "_position": { + "__type__": "cc.Vec2", + "x": 200, + "y": 100 + }, + "_skewX": 0, + "_skewY": 0, + "_localZOrder": 0, + "_globalZOrder": 0, + "_opacityModifyRGB": false, + "groupIndex": 0 + }, + { + "__type__": "cc.Node", + "_name": "element", + "_objFlags": 0, + "_parent": { + "__id__": 12 + }, + "_children": [], + "_tag": -1, + "_active": false, + "_components": [ + { + "__id__": 14 + } + ], + "_prefab": null, + "_id": "d8dA89PRZGy76SnFZzMvsI", + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 250, + "g": 56, + "b": 56, + "a": 255 + }, + "_cascadeOpacityEnabled": true, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 90, + "height": 90 + }, + "_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__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 13 + }, + "_enabled": true, + "_spriteFrame": { + "__uuid__": "a23235d1-15db-4b95-8439-a2e005bfff91" + }, + "_type": 0, + "_sizeMode": 0, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_atlas": null + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 12 + }, + "_enabled": true, + "_spriteFrame": { + "__uuid__": "a23235d1-15db-4b95-8439-a2e005bfff91" + }, + "_type": 0, + "_sizeMode": 0, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_atlas": null + }, + { + "__type__": "cc.Node", + "_name": "item", + "_objFlags": 0, + "_parent": { + "__id__": 3 + }, + "_children": [ + { + "__id__": 17 + } + ], + "_tag": -1, + "_active": true, + "_components": [ + { + "__id__": 19 + } + ], + "_prefab": null, + "_id": "ea+exycYpEC7PuId+mZmes", + "_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": 100, + "height": 100 + }, + "_rotationX": 0, + "_rotationY": 0, + "_scaleX": 1, + "_scaleY": 1, + "_position": { + "__type__": "cc.Vec2", + "x": -200, + "y": -100 + }, + "_skewX": 0, + "_skewY": 0, + "_localZOrder": 0, + "_globalZOrder": 0, + "_opacityModifyRGB": false, + "groupIndex": 0 + }, + { + "__type__": "cc.Node", + "_name": "element", + "_objFlags": 0, + "_parent": { + "__id__": 16 + }, + "_children": [], + "_tag": -1, + "_active": false, + "_components": [ + { + "__id__": 18 + } + ], + "_prefab": null, + "_id": "41C8aroPxE8Ihm1Bj8Egv2", + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 250, + "g": 56, + "b": 56, + "a": 255 + }, + "_cascadeOpacityEnabled": true, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 90, + "height": 90 + }, + "_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__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 17 + }, + "_enabled": true, + "_spriteFrame": { + "__uuid__": "a23235d1-15db-4b95-8439-a2e005bfff91" + }, + "_type": 0, + "_sizeMode": 0, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_atlas": null + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 16 + }, + "_enabled": true, + "_spriteFrame": { + "__uuid__": "a23235d1-15db-4b95-8439-a2e005bfff91" + }, + "_type": 0, + "_sizeMode": 0, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_atlas": null + }, + { + "__type__": "cc.Node", + "_name": "item", + "_objFlags": 0, + "_parent": { + "__id__": 3 + }, + "_children": [ + { + "__id__": 21 + } + ], + "_tag": -1, + "_active": true, + "_components": [ + { + "__id__": 23 + } + ], + "_prefab": null, + "_id": "97rWDezzBHhruSKsvPhe7w", + "_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": 100, + "height": 100 + }, + "_rotationX": 0, + "_rotationY": 0, + "_scaleX": 1, + "_scaleY": 1, + "_position": { + "__type__": "cc.Vec2", + "x": 0, + "y": -100 + }, + "_skewX": 0, + "_skewY": 0, + "_localZOrder": 0, + "_globalZOrder": 0, + "_opacityModifyRGB": false, + "groupIndex": 0 + }, + { + "__type__": "cc.Node", + "_name": "element", + "_objFlags": 0, + "_parent": { + "__id__": 20 + }, + "_children": [], + "_tag": -1, + "_active": false, + "_components": [ + { + "__id__": 22 + } + ], + "_prefab": null, + "_id": "27NPj5EStCTITzUEQVcaak", + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 250, + "g": 56, + "b": 56, + "a": 255 + }, + "_cascadeOpacityEnabled": true, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 90, + "height": 90 + }, + "_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__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 21 + }, + "_enabled": true, + "_spriteFrame": { + "__uuid__": "a23235d1-15db-4b95-8439-a2e005bfff91" + }, + "_type": 0, + "_sizeMode": 0, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_atlas": null + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 20 + }, + "_enabled": true, + "_spriteFrame": { + "__uuid__": "a23235d1-15db-4b95-8439-a2e005bfff91" + }, + "_type": 0, + "_sizeMode": 0, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_atlas": null + }, + { + "__type__": "cc.Node", + "_name": "item", + "_objFlags": 0, + "_parent": { + "__id__": 3 + }, + "_children": [ + { + "__id__": 25 + } + ], + "_tag": -1, + "_active": true, + "_components": [ + { + "__id__": 27 + } + ], + "_prefab": null, + "_id": "24KvWxtCtOGag3IGv7WPe0", + "_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": 100, + "height": 100 + }, + "_rotationX": 0, + "_rotationY": 0, + "_scaleX": 1, + "_scaleY": 1, + "_position": { + "__type__": "cc.Vec2", + "x": 200, + "y": -100 + }, + "_skewX": 0, + "_skewY": 0, + "_localZOrder": 0, + "_globalZOrder": 0, + "_opacityModifyRGB": false, + "groupIndex": 0 + }, + { + "__type__": "cc.Node", + "_name": "element", + "_objFlags": 0, + "_parent": { + "__id__": 24 + }, + "_children": [], + "_tag": -1, + "_active": false, + "_components": [ + { + "__id__": 26 + } + ], + "_prefab": null, + "_id": "e7e+r6LMFBzI5X7QnTR3dJ", + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 250, + "g": 56, + "b": 56, + "a": 255 + }, + "_cascadeOpacityEnabled": true, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 90, + "height": 90 + }, + "_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__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 25 + }, + "_enabled": true, + "_spriteFrame": { + "__uuid__": "a23235d1-15db-4b95-8439-a2e005bfff91" + }, + "_type": 0, + "_sizeMode": 0, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_atlas": null + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 24 + }, + "_enabled": true, + "_spriteFrame": { + "__uuid__": "a23235d1-15db-4b95-8439-a2e005bfff91" + }, + "_type": 0, + "_sizeMode": 0, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_atlas": null + }, + { + "__type__": "1d222eAGvJECo4LdJvYdV4Z", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 3 + }, + "_enabled": true, + "list": [ + { + "__id__": 5 + }, + { + "__id__": 9 + }, + { + "__id__": 13 + }, + { + "__id__": 17 + }, + { + "__id__": 21 + }, + { + "__id__": 25 + } + ], + "loopTimes": 4, + "awardTime": 1, + "loopTimeList": [ + 0.04, + 0.04, + 0.12, + 0.2, + 0.2 + ] + }, + { + "__type__": "cc.Node", + "_name": "New Button", + "_objFlags": 0, + "_parent": { + "__id__": 2 + }, + "_children": [ + { + "__id__": 30 + } + ], + "_tag": -1, + "_active": true, + "_components": [ + { + "__id__": 32 + }, + { + "__id__": 33 + } + ], + "_prefab": null, + "_id": "6cXF5GvgpGxZj+JNel1Rk/", + "_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": 100, + "height": 40 + }, + "_rotationX": 0, + "_rotationY": 0, + "_scaleX": 1, + "_scaleY": 1, + "_position": { + "__type__": "cc.Vec2", + "x": 0, + "y": -261 + }, + "_skewX": 0, + "_skewY": 0, + "_localZOrder": 0, + "_globalZOrder": 0, + "_opacityModifyRGB": false, + "groupIndex": 0 + }, + { + "__type__": "cc.Node", + "_name": "Label", + "_objFlags": 0, + "_parent": { + "__id__": 29 + }, + "_children": [], + "_tag": -1, + "_active": true, + "_components": [ + { + "__id__": 31 + } + ], + "_prefab": null, + "_id": "dccx9KgyNHzY6YdN4YpnrD", + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 0, + "g": 0, + "b": 0, + "a": 255 + }, + "_cascadeOpacityEnabled": true, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 100, + "height": 40 + }, + "_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__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 30 + }, + "_enabled": true, + "_useOriginalSize": false, + "_actualFontSize": 20, + "_fontSize": 20, + "_lineHeight": 40, + "_enableWrapText": false, + "_N$file": null, + "_isSystemFontUsed": true, + "_spacingX": 0, + "_N$string": "play", + "_N$horizontalAlign": 1, + "_N$verticalAlign": 1, + "_N$fontFamily": "Arial", + "_N$overflow": 1 + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 29 + }, + "_enabled": true, + "_spriteFrame": { + "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" + }, + "_type": 1, + "_sizeMode": 0, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_atlas": null + }, + { + "__type__": "cc.Button", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 29 + }, + "_enabled": true, + "transition": 2, + "pressedColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "hoverColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "duration": 0.1, + "zoomScale": 1.2, + "clickEvents": [ + { + "__id__": 34 + } + ], + "_N$interactable": true, + "_N$enableAutoGrayEffect": false, + "_N$normalColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_N$disabledColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_N$normalSprite": { + "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" + }, + "_N$pressedSprite": { + "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" + }, + "pressedSprite": { + "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" + }, + "_N$hoverSprite": { + "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" + }, + "hoverSprite": { + "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" + }, + "_N$disabledSprite": { + "__uuid__": "29158224-f8dd-4661-a796-1ffab537140e" + }, + "_N$target": { + "__id__": 29 + } + }, + { + "__type__": "cc.ClickEvent", + "target": { + "__id__": 2 + }, + "component": "SlotMachine", + "handler": "onEventClicked_play", + "customEventData": "" + }, + { + "__type__": "cc.Canvas", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 2 + }, + "_enabled": true, + "_designResolution": { + "__type__": "cc.Size", + "width": 960, + "height": 640 + }, + "_fitWidth": false, + "_fitHeight": true + }, + { + "__type__": "1af8adx3FFDq6lfLClbNl7w", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 2 + }, + "_enabled": true, + "rolling": { + "__id__": 3 + } + } +] \ No newline at end of file diff --git a/HorseRaceLamp/assets/SlotMachine.fire.meta b/HorseRaceLamp/assets/SlotMachine.fire.meta new file mode 100644 index 0000000..91aa093 --- /dev/null +++ b/HorseRaceLamp/assets/SlotMachine.fire.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.0.0", + "uuid": "31bca123-0de6-409a-94d8-28d1b2634535", + "asyncLoadAssets": false, + "autoReleaseAssets": false, + "subMetas": {} +} \ No newline at end of file diff --git a/HorseRaceLamp/assets/SlotMachine.js b/HorseRaceLamp/assets/SlotMachine.js new file mode 100644 index 0000000..8053f58 --- /dev/null +++ b/HorseRaceLamp/assets/SlotMachine.js @@ -0,0 +1,44 @@ +cc.Class({ + extends: cc.Component, + + properties: { + rolling: cc.Node, + }, + + onLoad() { + this.rollingMachine = this.rolling.getComponent('RollingMachine'); + }, + + registerEvent() { + + }, + + init(data) { + + }, + + onEventClicked_play() { + let index = 2 + this.rollingMachine.play(index); + }, + + update(dt) { + + }, + + onEnable() { + this.registerEvent(); + }, + + onDisable() { + this.offEvent(); + }, + + offEvent() { + cc.emitter.offThis(this); + }, + + onDestroy() { + + } +}); \ No newline at end of file diff --git a/HorseRaceLamp/assets/SlotMachine.js.meta b/HorseRaceLamp/assets/SlotMachine.js.meta new file mode 100644 index 0000000..8663c0a --- /dev/null +++ b/HorseRaceLamp/assets/SlotMachine.js.meta @@ -0,0 +1,9 @@ +{ + "ver": "1.0.5", + "uuid": "1af8a771-dc51-43ab-a95f-2c295b365ef0", + "isPlugin": false, + "loadPluginInWeb": true, + "loadPluginInNative": true, + "loadPluginInEditor": false, + "subMetas": {} +} \ No newline at end of file