Commit cd4c30f3 authored by Master Q's avatar Master Q

游戏数据调试

parent ac2e77f9
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<!-- <script src="libs/svgaParser.min1.js"></script> --> <!-- <script src="libs/svgaParser.min1.js"></script> -->
<script src="//yun.duiba.com.cn/js-libs/vConsole/3.3.4/vconsole.min.js"></script> <script src="//yun.duiba.com.cn/js-libs/vConsole/3.3.4/vconsole.min.js"></script>
<script> <script>
// var vConsole = new VConsole(); var vConsole = new VConsole();
</script> </script>
<style> <style>
html, html,
......
resource/GameScene/p1-b.png

13.5 KB | W: | H:

resource/GameScene/p1-b.png

12.2 KB | W: | H:

resource/GameScene/p1-b.png
resource/GameScene/p1-b.png
resource/GameScene/p1-b.png
resource/GameScene/p1-b.png
  • 2-up
  • Swipe
  • Onion skin
resource/GameScene/p1.png

30.8 KB | W: | H:

resource/GameScene/p1.png

107 KB | W: | H:

resource/GameScene/p1.png
resource/GameScene/p1.png
resource/GameScene/p1.png
resource/GameScene/p1.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -82,31 +82,9 @@ export const ResJson = { ...@@ -82,31 +82,9 @@ export const ResJson = {
"sh": 183, "sh": 183,
"ro": true "ro": true
}, },
"p1-b.png": { "p12-b.png": {
"x": 939, "x": 939,
"y": 2, "y": 2,
"w": 377,
"h": 537,
"ox": 0,
"oy": 0,
"sw": 377,
"sh": 537,
"ro": false
},
"p1.png": {
"x": 939,
"y": 541,
"w": 377,
"h": 537,
"ox": 0,
"oy": 0,
"sw": 377,
"sh": 537,
"ro": false
},
"p12-b.png": {
"x": 754,
"y": 1080,
"w": 335, "w": 335,
"h": 535, "h": 535,
"ox": 0, "ox": 0,
...@@ -116,8 +94,8 @@ export const ResJson = { ...@@ -116,8 +94,8 @@ export const ResJson = {
"ro": false "ro": false
}, },
"p12.png": { "p12.png": {
"x": 1318, "x": 939,
"y": 2, "y": 539,
"w": 335, "w": 335,
"h": 535, "h": 535,
"ox": 0, "ox": 0,
...@@ -127,8 +105,8 @@ export const ResJson = { ...@@ -127,8 +105,8 @@ export const ResJson = {
"ro": false "ro": false
}, },
"p20-b.png": { "p20-b.png": {
"x": 1091, "x": 754,
"y": 1080, "y": 1076,
"w": 287, "w": 287,
"h": 535, "h": 535,
"ox": 0, "ox": 0,
...@@ -138,8 +116,8 @@ export const ResJson = { ...@@ -138,8 +116,8 @@ export const ResJson = {
"ro": false "ro": false
}, },
"p20.png": { "p20.png": {
"x": 1318, "x": 1276,
"y": 539, "y": 2,
"w": 287, "w": 287,
"h": 535, "h": 535,
"ox": 0, "ox": 0,
...@@ -149,41 +127,41 @@ export const ResJson = { ...@@ -149,41 +127,41 @@ export const ResJson = {
"ro": false "ro": false
}, },
"p11-b.png": { "p11-b.png": {
"x": 2, "x": 1043,
"y": 1628, "y": 1076,
"w": 496, "w": 496,
"h": 533, "h": 533,
"ox": 0, "ox": 0,
"oy": 0, "oy": 0,
"sw": 496, "sw": 496,
"sh": 533, "sh": 533,
"ro": true "ro": false
}, },
"p11.png": { "p11.png": {
"x": 537, "x": 1565,
"y": 1628, "y": 2,
"w": 496, "w": 496,
"h": 533, "h": 533,
"ox": 0, "ox": 0,
"oy": 0, "oy": 0,
"sw": 496, "sw": 496,
"sh": 533, "sh": 533,
"ro": true "ro": false
}, },
"p13-b.png": { "p13-b.png": {
"x": 1072, "x": 1276,
"y": 1617, "y": 539,
"w": 421, "w": 421,
"h": 533, "h": 533,
"ox": 0, "ox": 0,
"oy": 0, "oy": 0,
"sw": 421, "sw": 421,
"sh": 533, "sh": 533,
"ro": true "ro": false
}, },
"p13.png": { "p13.png": {
"x": 1655, "x": 1541,
"y": 2, "y": 1074,
"w": 421, "w": 421,
"h": 533, "h": 533,
"ox": 0, "ox": 0,
...@@ -193,8 +171,8 @@ export const ResJson = { ...@@ -193,8 +171,8 @@ export const ResJson = {
"ro": false "ro": false
}, },
"balance_guidance.png": { "balance_guidance.png": {
"x": 1380, "x": 1699,
"y": 1076, "y": 537,
"w": 258, "w": 258,
"h": 532, "h": 532,
"ox": 0, "ox": 0,
...@@ -204,8 +182,8 @@ export const ResJson = { ...@@ -204,8 +182,8 @@ export const ResJson = {
"ro": false "ro": false
}, },
"p3-b.png": { "p3-b.png": {
"x": 2078, "x": 1541,
"y": 2, "y": 1609,
"w": 532, "w": 532,
"h": 520, "h": 520,
"ox": 0, "ox": 0,
...@@ -215,30 +193,30 @@ export const ResJson = { ...@@ -215,30 +193,30 @@ export const ResJson = {
"ro": true "ro": true
}, },
"p3.png": { "p3.png": {
"x": 2078, "x": 2,
"y": 536, "y": 1628,
"w": 532, "w": 532,
"h": 520, "h": 520,
"ox": 0, "ox": 0,
"oy": 0, "oy": 0,
"sw": 532, "sw": 532,
"sh": 520, "sh": 520,
"ro": true "ro": false
}, },
"p9-b.png": { "p9-b.png": {
"x": 1607, "x": 754,
"y": 1610, "y": 1613,
"w": 487, "w": 487,
"h": 532, "h": 532,
"ox": 0, "ox": 0,
"oy": 0, "oy": 0,
"sw": 487, "sw": 487,
"sh": 532, "sh": 532,
"ro": true "ro": false
}, },
"p9.png": { "p9.png": {
"x": 1640, "x": 2063,
"y": 1070, "y": 2,
"w": 487, "w": 487,
"h": 532, "h": 532,
"ox": 0, "ox": 0,
...@@ -248,30 +226,30 @@ export const ResJson = { ...@@ -248,30 +226,30 @@ export const ResJson = {
"ro": false "ro": false
}, },
"p4-b.png": { "p4-b.png": {
"x": 2, "x": 1959,
"y": 2126, "y": 537,
"w": 499, "w": 499,
"h": 531, "h": 531,
"ox": 0, "ox": 0,
"oy": 0, "oy": 0,
"sw": 499, "sw": 499,
"sh": 531, "sh": 531,
"ro": true "ro": false
}, },
"p4.png": { "p4.png": {
"x": 535, "x": 1964,
"y": 2126, "y": 1070,
"w": 499, "w": 499,
"h": 531, "h": 531,
"ox": 0, "ox": 0,
"oy": 0, "oy": 0,
"sw": 499, "sw": 499,
"sh": 531, "sh": 531,
"ro": true "ro": false
}, },
"p6-b.png": { "p6-b.png": {
"x": 1072, "x": 2063,
"y": 2099, "y": 1603,
"w": 526, "w": 526,
"h": 368, "h": 368,
"ox": 0, "ox": 0,
...@@ -281,41 +259,41 @@ export const ResJson = { ...@@ -281,41 +259,41 @@ export const ResJson = {
"ro": true "ro": true
}, },
"p6.png": { "p6.png": {
"x": 1442, "x": 2,
"y": 2099, "y": 2150,
"w": 526, "w": 526,
"h": 368, "h": 368,
"ox": 0, "ox": 0,
"oy": 0, "oy": 0,
"sw": 526, "sw": 526,
"sh": 368, "sh": 368,
"ro": true "ro": false
}, },
"p2-b.png": { "p2-b.png": {
"x": 1812, "x": 2,
"y": 2099, "y": 2520,
"w": 524, "w": 524,
"h": 518, "h": 518,
"ox": 0, "ox": 0,
"oy": 0, "oy": 0,
"sw": 524, "sw": 524,
"sh": 518, "sh": 518,
"ro": true "ro": false
}, },
"p2.png": { "p2.png": {
"x": 2600, "x": 528,
"y": 2, "y": 2520,
"w": 524, "w": 524,
"h": 518, "h": 518,
"ox": 0, "ox": 0,
"oy": 0, "oy": 0,
"sw": 524, "sw": 524,
"sh": 518, "sh": 518,
"ro": true "ro": false
}, },
"p18-b.png": { "p18-b.png": {
"x": 1607, "x": 1243,
"y": 539, "y": 1611,
"w": 270, "w": 270,
"h": 521, "h": 521,
"ox": 0, "ox": 0,
...@@ -325,8 +303,8 @@ export const ResJson = { ...@@ -325,8 +303,8 @@ export const ResJson = {
"ro": false "ro": false
}, },
"p18.png": { "p18.png": {
"x": 2129, "x": 1243,
"y": 1070, "y": 2134,
"w": 270, "w": 270,
"h": 521, "h": 521,
"ox": 0, "ox": 0,
...@@ -336,19 +314,19 @@ export const ResJson = { ...@@ -336,19 +314,19 @@ export const ResJson = {
"ro": false "ro": false
}, },
"p10-b.png": { "p10-b.png": {
"x": 2141, "x": 1515,
"y": 1593, "y": 2143,
"w": 502, "w": 502,
"h": 513, "h": 513,
"ox": 0, "ox": 0,
"oy": 0, "oy": 0,
"sw": 502, "sw": 502,
"sh": 513, "sh": 513,
"ro": true "ro": false
}, },
"p10.png": { "p10.png": {
"x": 2600, "x": 2019,
"y": 528, "y": 2143,
"w": 502, "w": 502,
"h": 513, "h": 513,
"ox": 0, "ox": 0,
...@@ -358,8 +336,8 @@ export const ResJson = { ...@@ -358,8 +336,8 @@ export const ResJson = {
"ro": true "ro": true
}, },
"p5-b.png": { "p5-b.png": {
"x": 2656, "x": 2552,
"y": 1032, "y": 2,
"w": 460, "w": 460,
"h": 513, "h": 513,
"ox": 0, "ox": 0,
...@@ -369,8 +347,8 @@ export const ResJson = { ...@@ -369,8 +347,8 @@ export const ResJson = {
"ro": false "ro": false
}, },
"p5.png": { "p5.png": {
"x": 2656, "x": 2552,
"y": 1547, "y": 517,
"w": 460, "w": 460,
"h": 513, "h": 513,
"ox": 0, "ox": 0,
...@@ -380,8 +358,8 @@ export const ResJson = { ...@@ -380,8 +358,8 @@ export const ResJson = {
"ro": false "ro": false
}, },
"p15-b.png": { "p15-b.png": {
"x": 2332, "x": 2534,
"y": 2097, "y": 1032,
"w": 499, "w": 499,
"h": 463, "h": 463,
"ox": 0, "ox": 0,
...@@ -391,63 +369,63 @@ export const ResJson = { ...@@ -391,63 +369,63 @@ export const ResJson = {
"ro": true "ro": true
}, },
"p15.png": { "p15.png": {
"x": 2, "x": 2534,
"y": 2627, "y": 1533,
"w": 499, "w": 499,
"h": 463, "h": 463,
"ox": 0, "ox": 0,
"oy": 0, "oy": 0,
"sw": 499, "sw": 499,
"sh": 463, "sh": 463,
"ro": false "ro": true
}, },
"p14-b.png": { "p14-b.png": {
"x": 503, "x": 2534,
"y": 2627, "y": 2034,
"w": 438, "w": 438,
"h": 460, "h": 460,
"ox": 0, "ox": 0,
"oy": 0, "oy": 0,
"sw": 438, "sw": 438,
"sh": 460, "sh": 460,
"ro": false "ro": true
}, },
"p14.png": { "p14.png": {
"x": 943, "x": 2534,
"y": 2627, "y": 2474,
"w": 438, "w": 438,
"h": 460, "h": 460,
"ox": 0, "ox": 0,
"oy": 0, "oy": 0,
"sw": 438, "sw": 438,
"sh": 460, "sh": 460,
"ro": false "ro": true
}, },
"p8-b.png": { "p8-b.png": {
"x": 1383, "x": 2019,
"y": 2627, "y": 2647,
"w": 308, "w": 308,
"h": 460, "h": 460,
"ox": 0, "ox": 0,
"oy": 0, "oy": 0,
"sw": 308, "sw": 308,
"sh": 460, "sh": 460,
"ro": false "ro": true
}, },
"p8.png": { "p8.png": {
"x": 1693, "x": 530,
"y": 2627, "y": 2150,
"w": 308, "w": 308,
"h": 460, "h": 460,
"ox": 0, "ox": 0,
"oy": 0, "oy": 0,
"sw": 308, "sw": 308,
"sh": 460, "sh": 460,
"ro": false "ro": true
}, },
"p7-b.png": { "p7-b.png": {
"x": 2003, "x": 3014,
"y": 2625, "y": 2,
"w": 426, "w": 426,
"h": 443, "h": 443,
"ox": 0, "ox": 0,
...@@ -457,8 +435,8 @@ export const ResJson = { ...@@ -457,8 +435,8 @@ export const ResJson = {
"ro": false "ro": false
}, },
"p7.png": { "p7.png": {
"x": 2431, "x": 3014,
"y": 2598, "y": 447,
"w": 426, "w": 426,
"h": 443, "h": 443,
"ox": 0, "ox": 0,
...@@ -468,8 +446,8 @@ export const ResJson = { ...@@ -468,8 +446,8 @@ export const ResJson = {
"ro": false "ro": false
}, },
"p17-b.png": { "p17-b.png": {
"x": 2, "x": 2999,
"y": 3092, "y": 1032,
"w": 434, "w": 434,
"h": 398, "h": 398,
"ox": 0, "ox": 0,
...@@ -479,8 +457,8 @@ export const ResJson = { ...@@ -479,8 +457,8 @@ export const ResJson = {
"ro": false "ro": false
}, },
"p17.png": { "p17.png": {
"x": 438, "x": 2999,
"y": 3092, "y": 1432,
"w": 434, "w": 434,
"h": 398, "h": 398,
"ox": 0, "ox": 0,
...@@ -490,41 +468,41 @@ export const ResJson = { ...@@ -490,41 +468,41 @@ export const ResJson = {
"ro": false "ro": false
}, },
"p19-b.png": { "p19-b.png": {
"x": 2003, "x": 1054,
"y": 3070, "y": 2658,
"w": 416, "w": 416,
"h": 364, "h": 364,
"ox": 0, "ox": 0,
"oy": 0, "oy": 0,
"sw": 416, "sw": 416,
"sh": 364, "sh": 364,
"ro": true "ro": false
}, },
"p19.png": { "p19.png": {
"x": 2369, "x": 1472,
"y": 3070, "y": 2658,
"w": 416, "w": 416,
"h": 364, "h": 364,
"ox": 0, "ox": 0,
"oy": 0, "oy": 0,
"sw": 416, "sw": 416,
"sh": 364, "sh": 364,
"ro": true "ro": false
}, },
"p16-b.png": { "p16-b.png": {
"x": 2735, "x": 2999,
"y": 3043, "y": 1832,
"w": 406, "w": 406,
"h": 360, "h": 360,
"ox": 0, "ox": 0,
"oy": 0, "oy": 0,
"sw": 406, "sw": 406,
"sh": 360, "sh": 360,
"ro": true "ro": false
}, },
"p16.png": { "p16.png": {
"x": 874, "x": 2996,
"y": 3089, "y": 2194,
"w": 406, "w": 406,
"h": 360, "h": 360,
"ox": 0, "ox": 0,
...@@ -533,20 +511,42 @@ export const ResJson = { ...@@ -533,20 +511,42 @@ export const ResJson = {
"sh": 360, "sh": 360,
"ro": false "ro": false
}, },
"p1-b.png": {
"x": 2996,
"y": 2556,
"w": 321,
"h": 368,
"ox": 0,
"oy": 0,
"sw": 321,
"sh": 368,
"ro": true
},
"p1.png": {
"x": 2,
"y": 3040,
"w": 321,
"h": 368,
"ox": 0,
"oy": 0,
"sw": 321,
"sh": 368,
"ro": true
},
"nump.png": { "nump.png": {
"x": 2600, "x": 530,
"y": 1032, "y": 2460,
"w": 52, "w": 52,
"h": 59, "h": 59,
"ox": 1, "ox": 1,
"oy": 0, "oy": 0,
"sw": 54, "sw": 54,
"sh": 59, "sh": 59,
"ro": false "ro": true
}, },
"num0.png": { "num0.png": {
"x": 1072, "x": 591,
"y": 2040, "y": 2460,
"w": 39, "w": 39,
"h": 57, "h": 57,
"ox": 1, "ox": 1,
...@@ -556,8 +556,8 @@ export const ResJson = { ...@@ -556,8 +556,8 @@ export const ResJson = {
"ro": false "ro": false
}, },
"num3.png": { "num3.png": {
"x": 1113, "x": 632,
"y": 2040, "y": 2460,
"w": 38, "w": 38,
"h": 57, "h": 57,
"ox": 1, "ox": 1,
...@@ -567,8 +567,8 @@ export const ResJson = { ...@@ -567,8 +567,8 @@ export const ResJson = {
"ro": false "ro": false
}, },
"num8.png": { "num8.png": {
"x": 1153, "x": 672,
"y": 2040, "y": 2460,
"w": 38, "w": 38,
"h": 57, "h": 57,
"ox": 0, "ox": 0,
...@@ -578,8 +578,8 @@ export const ResJson = { ...@@ -578,8 +578,8 @@ export const ResJson = {
"ro": false "ro": false
}, },
"num2.png": { "num2.png": {
"x": 1193, "x": 712,
"y": 2040, "y": 2460,
"w": 40, "w": 40,
"h": 56, "h": 56,
"ox": 0, "ox": 0,
...@@ -589,8 +589,8 @@ export const ResJson = { ...@@ -589,8 +589,8 @@ export const ResJson = {
"ro": false "ro": false
}, },
"num5.png": { "num5.png": {
"x": 1235, "x": 754,
"y": 2040, "y": 2460,
"w": 37, "w": 37,
"h": 56, "h": 56,
"ox": 1, "ox": 1,
...@@ -600,30 +600,30 @@ export const ResJson = { ...@@ -600,30 +600,30 @@ export const ResJson = {
"ro": false "ro": false
}, },
"num6.png": { "num6.png": {
"x": 2735, "x": 793,
"y": 3451, "y": 2460,
"w": 38, "w": 38,
"h": 56, "h": 56,
"ox": 1, "ox": 1,
"oy": 0, "oy": 0,
"sw": 39, "sw": 39,
"sh": 57, "sh": 57,
"ro": true "ro": false
}, },
"num9.png": { "num9.png": {
"x": 874, "x": 833,
"y": 3451, "y": 2460,
"w": 38, "w": 38,
"h": 56, "h": 56,
"ox": 1, "ox": 1,
"oy": 0, "oy": 0,
"sw": 38, "sw": 38,
"sh": 57, "sh": 57,
"ro": true "ro": false
}, },
"num1.png": { "num1.png": {
"x": 1274, "x": 1515,
"y": 2040, "y": 1611,
"w": 22, "w": 22,
"h": 55, "h": 55,
"ox": 1, "ox": 1,
...@@ -633,8 +633,8 @@ export const ResJson = { ...@@ -633,8 +633,8 @@ export const ResJson = {
"ro": false "ro": false
}, },
"num4.png": { "num4.png": {
"x": 1298, "x": 873,
"y": 2040, "y": 2460,
"w": 40, "w": 40,
"h": 55, "h": 55,
"ox": 1, "ox": 1,
...@@ -644,8 +644,8 @@ export const ResJson = { ...@@ -644,8 +644,8 @@ export const ResJson = {
"ro": false "ro": false
}, },
"num7.png": { "num7.png": {
"x": 1340, "x": 915,
"y": 2040, "y": 2460,
"w": 42, "w": 42,
"h": 55, "h": 55,
"ox": 1, "ox": 1,
...@@ -729,5 +729,5 @@ export const ResJson = { ...@@ -729,5 +729,5 @@ export const ResJson = {
} }
} }
], ],
"path": "https://yun.duiba.com.cn/db_games/activity/template/1628480167/resource/" "path": "https://yun.duiba.com.cn/db_games/activity/template/1628495232/resource/"
} }
\ No newline at end of file
...@@ -3,7 +3,7 @@ export const GameCfg = { ...@@ -3,7 +3,7 @@ export const GameCfg = {
ispeed: 0, // 初速度 ispeed: 0, // 初速度
fpsScale: 1000 / 60, // 帧变数 fpsScale: 1000 / 60, // 帧变数
resisteAcc: 0.06, // 摩擦力反加速度 resisteAcc: 0.06, // 摩擦力反加速度
rc: 20, // 误差值,距离中心点的误差值 rc: 40, // 误差值,距离中心点的误差值
duanpingValue: 8 / 180 * Math.PI, // 默认小于 8 度就算端平 duanpingValue: 8 / 180 * Math.PI, // 默认小于 8 度就算端平
iTime: 12000, // 初始化游戏时间 iTime: 12000, // 初始化游戏时间
......
...@@ -100,7 +100,7 @@ export class GameScene extends MotionInitScene { ...@@ -100,7 +100,7 @@ export class GameScene extends MotionInitScene {
this.cdp.addTimeoutFunc(() => { this.cdp.addTimeoutFunc(() => {
// this.cdp.visible = false // this.cdp.visible = false
//@ts-ignore //@ts-ignore
my.showToast({ my && my.showToast({
content: '游戏结束' content: '游戏结束'
}) })
}) })
...@@ -112,7 +112,7 @@ export class GameScene extends MotionInitScene { ...@@ -112,7 +112,7 @@ export class GameScene extends MotionInitScene {
initGame() { initGame() {
this.cdp.start() this.cdp.start()
this.gameEle = this.addChild(new GameEle('p1-b.png', this.centerp, () => { this.gameEle = this.addChild(new GameEle('p1.png', this.centerp, () => {
this.score += 1 this.score += 1
this.gIndex += 1 this.gIndex += 1
this.cdp.initTime = GameCfg.iTime this.cdp.initTime = GameCfg.iTime
...@@ -138,20 +138,6 @@ export class GameScene extends MotionInitScene { ...@@ -138,20 +138,6 @@ export class GameScene extends MotionInitScene {
} }
var posList = [
{
x: 0, y: layers.stageHeight + layers.stageOffsetY
},
{
x: layers.stageWidth + layers.stageOffsetX,
y: 0
},
{
x: layers.stageWidth + layers.stageOffsetX,
y: layers.stageHeight + layers.stageOffsetY
}
]
export class GameEle extends Container { export class GameEle extends Container {
rorate:number // 旋转角度 rorate:number // 旋转角度
vx = GameCfg.ispeed // 当前x速度, 有初速度 vx = GameCfg.ispeed // 当前x速度, 有初速度
...@@ -182,7 +168,21 @@ export class GameEle extends Container { ...@@ -182,7 +168,21 @@ export class GameEle extends Container {
initUi(tn: string) { initUi(tn: string) {
if (tn) { if (tn) {
this.sprite = UI.Sp(this, tn) this.sprite = UI.Sp(this, tn)
var posList = [
{
x: 0, y: layers.stageHeight + layers.stageOffsetY
},
{
x: layers.stageWidth + layers.stageOffsetX,
y: 0
},
{
x: layers.stageWidth + layers.stageOffsetX,
y: layers.stageHeight + layers.stageOffsetY
}
]
var pos = posList[Math.floor(Math.random() * 3)] var pos = posList[Math.floor(Math.random() * 3)]
console.log(posList, pos)
this.position.set(pos.x, pos.y) this.position.set(pos.x, pos.y)
// this.sprite.scaleX = 0.5 // this.sprite.scaleX = 0.5
// this.sprite.scaleY = 0.5 // this.sprite.scaleY = 0.5
...@@ -200,6 +200,19 @@ export class GameEle extends Container { ...@@ -200,6 +200,19 @@ export class GameEle extends Container {
resetInit(tName: string) { resetInit(tName: string) {
this.sprite.texture = RES.getRes(tName) this.sprite.texture = RES.getRes(tName)
var posList = [
{
x: 0, y: layers.stageHeight + layers.stageOffsetY
},
{
x: layers.stageWidth + layers.stageOffsetX,
y: 0
},
{
x: layers.stageWidth + layers.stageOffsetX,
y: layers.stageHeight + layers.stageOffsetY
}
]
var pos = posList[Math.floor(Math.random() * 3)] var pos = posList[Math.floor(Math.random() * 3)]
this.position.set(pos.x, pos.y) this.position.set(pos.x, pos.y)
...@@ -296,16 +309,53 @@ export class GameEle extends Container { ...@@ -296,16 +309,53 @@ export class GameEle extends Container {
this.setRotation(this.k * (len - GameCfg.rc)) this.setRotation(this.k * (len - GameCfg.rc))
if (this.isIn) { if (this.isIn) {
this.isIn = false this.isIn = false
FYGE.Tween.removeTweens(this)
GDispatcher.dispatchEvent('focus-out') GDispatcher.dispatchEvent('focus-out')
} }
} else { } else {
if (!this.isIn) { if (!this.isIn) {
this.isIn = true this.isIn = true
this.vx = 0
this.vy = 0
this.setRotation(0)
FYGE.Tween.get(this)
.to({
x: this.fixedCenter.x,
y: this.fixedCenter.y
}, 400)
GDispatcher.dispatchEvent('focus-in', () => { GDispatcher.dispatchEvent('focus-in', () => {
this.finishFunc() this.finishFunc()
}) })
} }
} }
// var len = pos2Len(this, this.fixedCenter)
// if (!this.lastLen) this.lastLen = len
// if (len > this.lastLen && this.isIn) {
// this.isIn = false
// FYGE.Tween.removeTweens(this)
// GDispatcher.dispatchEvent('focus-out')
// }
// this.lastLen = len
// this.setRotation(this.k * (len - 20)) // vtodo 最后20 只是平移
// if (len <= GameCfg.rc) {
// if (!this.isIn) {
// this.isIn = true
// this.vx = 0
// this.vy = 0
// this.setRotation(0)
// FYGE.Tween.get(this)
// .to({
// x: this.fixedCenter.x,
// y: this.fixedCenter.y
// }, 400)
// GDispatcher.dispatchEvent('focus-in', () => {
// this.finishFunc()
// })
// }
// }
} }
update() { update() {
......
...@@ -122,6 +122,15 @@ export class MotionInitScene extends Scene { ...@@ -122,6 +122,15 @@ export class MotionInitScene extends Scene {
.beginFill(0xf0e4ce) .beginFill(0xf0e4ce)
.arc(layers.stageCenterX, layers.stageCenterY, 240, 0, 2*Math.PI) .arc(layers.stageCenterX, layers.stageCenterY, 240, 0, 2*Math.PI)
.endFill() .endFill()
this.focusProgress = this.addChild(new CircleProgressBar({
x: layers.stageCenterX,
y: layers.stageCenterY, // vtodo 这里后面可能会调试
radius: 260,
lineWidth: 15,
value: 0
}))
this.focusProgress.visible = false
this.centerp = setCenterPos(UI.Sp(this, 'p1-b.png')) this.centerp = setCenterPos(UI.Sp(this, 'p1-b.png'))
...@@ -175,13 +184,8 @@ export class MotionInitScene extends Scene { ...@@ -175,13 +184,8 @@ export class MotionInitScene extends Scene {
// type: 'fill', // type: 'fill',
// typeColor: 0x111111 // typeColor: 0x111111
// })) // }))
this.focusProgress = this.addChild(new CircleProgressBar({ this.focusProgress.visible = true
x: layers.stageCenterX, this.bitmapTextCount.visible = true
y: layers.stageCenterY, // vtodo 这里后面可能会调试
radius: 260,
lineWidth: 15,
value: 0
}))
FYGE.Tween.get(this.holdOnTxt) FYGE.Tween.get(this.holdOnTxt)
.set({visible: true, alpha: 0.4}) .set({visible: true, alpha: 0.4})
...@@ -192,6 +196,7 @@ export class MotionInitScene extends Scene { ...@@ -192,6 +196,7 @@ export class MotionInitScene extends Scene {
this.bitmapTextCount.text = ((this.focusProgress.value * 100) >> 0) + "%" this.bitmapTextCount.text = ((this.focusProgress.value * 100) >> 0) + "%"
} }
}) })
.set({value: 0})
.to({value: 1}, 3000) .to({value: 1}, 3000)
.call(() => { .call(() => {
console.log('%c 成功套种', 'color: green') console.log('%c 成功套种', 'color: green')
...@@ -202,11 +207,11 @@ export class MotionInitScene extends Scene { ...@@ -202,11 +207,11 @@ export class MotionInitScene extends Scene {
}, 400) }, 400)
removeTimeCountDown() { removeTimeCountDown() {
if (this.focusProgress) { if (this.focusProgress.visible) {
this.unshoot() this.unshoot()
FYGE.Tween.removeTweens(this.focusProgress) FYGE.Tween.removeTweens(this.focusProgress)
this.removeChild(this.focusProgress) this.focusProgress.visible = false
this.bitmapTextCount.text = '' this.bitmapTextCount.visible = false
} }
FYGE.Tween.removeTweens(this.holdOnTxt) FYGE.Tween.removeTweens(this.holdOnTxt)
......
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