Commit cd4c30f3 authored by Master Q's avatar Master Q

游戏数据调试

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