Commit 540aa936 authored by Master Q's avatar Master Q

youxi

parent 068af7ad
...@@ -13,7 +13,7 @@ export default class PanelCtrl { ...@@ -13,7 +13,7 @@ export default class PanelCtrl {
/** /**
* 半透明黑色背景 * 半透明黑色背景
*/ */
private _bg: FYGE.Shape;//FYGE.Graphics; private _bg: FYGE.Graphics;//FYGE.Graphics;
/** /**
* 所有的弹框 * 所有的弹框
*/ */
...@@ -26,7 +26,7 @@ export default class PanelCtrl { ...@@ -26,7 +26,7 @@ export default class PanelCtrl {
init(parent: FYGE.Container) { init(parent: FYGE.Container) {
this._parent = parent; this._parent = parent;
let bg = new FYGE.Shape();//Graphics()//Shape(); let bg = new FYGE.Graphics();//Graphics()//Shape();
bg.beginFill(0); bg.beginFill(0);
bg.drawRect(//引用适配 bg.drawRect(//引用适配
layers.stageOffsetX - parent.x, layers.stageOffsetX - parent.x,
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
"name": "blank_shoe" "name": "blank_shoe"
}, },
{ {
"keys": "comCloseBtn.png,com_light.png,count-start.png,count1.png,count2.png,count3.png,jordan-icon.png,music-off.png,music-on.png,nike-icon.png,percennt0.png,percennt1.png,percennt2.png,percennt3.png,percennt4.png,percennt5.png,percennt6.png,percennt7.png,percennt8.png,percennt9.png,percenntp.png,ruready.png,toastBg.png,waitingBg.png,waitingRot.png,跳过按钮.png", "keys": "centerCircle.png,comCloseBtn.png,com_light.png,count-start.png,count1.png,count2.png,count3.png,jordan-icon.png,music-off.png,music-on.png,nike-icon.png,percennt0.png,percennt1.png,percennt2.png,percennt3.png,percennt4.png,percennt5.png,percennt6.png,percennt7.png,percennt8.png,percennt9.png,percenntp.png,ruready.png,toastBg.png,waitingBg.png,waitingRot.png",
"name": "common" "name": "common"
}, },
{ {
......
...@@ -1622,7 +1622,7 @@ export const ResJson = { ...@@ -1622,7 +1622,7 @@ export const ResJson = {
} }
}, },
{ {
"keys": "comCloseBtn.png,com_light.png,count-start.png,count1.png,count2.png,count3.png,jordan-icon.png,music-off.png,music-on.png,nike-icon.png,percennt0.png,percennt1.png,percennt2.png,percennt3.png,percennt4.png,percennt5.png,percennt6.png,percennt7.png,percennt8.png,percennt9.png,percenntp.png,ruready.png,toastBg.png,waitingBg.png,waitingRot.png,跳过按钮.png", "keys": "centerCircle.png,comCloseBtn.png,com_light.png,count-start.png,count1.png,count2.png,count3.png,jordan-icon.png,music-off.png,music-on.png,nike-icon.png,percennt0.png,percennt1.png,percennt2.png,percennt3.png,percennt4.png,percennt5.png,percennt6.png,percennt7.png,percennt8.png,percennt9.png,percenntp.png,ruready.png,toastBg.png,waitingBg.png,waitingRot.png",
"name": "common", "name": "common",
"atlas": { "atlas": {
"com_light.png": { "com_light.png": {
...@@ -1636,16 +1636,27 @@ export const ResJson = { ...@@ -1636,16 +1636,27 @@ export const ResJson = {
"sh": 756, "sh": 756,
"ro": false "ro": false
}, },
"toastBg.png": { "centerCircle.png": {
"x": 750, "x": 750,
"y": 2, "y": 2,
"w": 540,
"h": 540,
"ox": 0,
"oy": 0,
"sw": 540,
"sh": 540,
"ro": false
},
"toastBg.png": {
"x": 750,
"y": 544,
"w": 460, "w": 460,
"h": 130, "h": 130,
"ox": 0, "ox": 0,
"oy": 0, "oy": 0,
"sw": 460, "sw": 460,
"sh": 130, "sh": 130,
"ro": true "ro": false
}, },
"count-start.png": { "count-start.png": {
"x": 2, "x": 2,
...@@ -1703,8 +1714,8 @@ export const ResJson = { ...@@ -1703,8 +1714,8 @@ export const ResJson = {
"ro": false "ro": false
}, },
"count1.png": { "count1.png": {
"x": 776, "x": 1212,
"y": 464, "y": 544,
"w": 56, "w": 56,
"h": 145, "h": 145,
"ox": 0, "ox": 0,
...@@ -1714,30 +1725,19 @@ export const ResJson = { ...@@ -1714,30 +1725,19 @@ export const ResJson = {
"ro": false "ro": false
}, },
"nike-icon.png": { "nike-icon.png": {
"x": 834, "x": 750,
"y": 464, "y": 691,
"w": 138, "w": 138,
"h": 46, "h": 46,
"ox": 0, "ox": 0,
"oy": 0, "oy": 0,
"sw": 138, "sw": 138,
"sh": 46, "sh": 46,
"ro": true
},
"跳过按钮.png": {
"x": 750,
"y": 611,
"w": 123,
"h": 57,
"ox": 0,
"oy": 0,
"sw": 123,
"sh": 57,
"ro": false "ro": false
}, },
"comCloseBtn.png": { "comCloseBtn.png": {
"x": 750, "x": 776,
"y": 670, "y": 739,
"w": 72, "w": 72,
"h": 72, "h": 72,
"ox": 0, "ox": 0,
...@@ -1748,18 +1748,18 @@ export const ResJson = { ...@@ -1748,18 +1748,18 @@ export const ResJson = {
}, },
"jordan-icon.png": { "jordan-icon.png": {
"x": 776, "x": 776,
"y": 744, "y": 813,
"w": 71, "w": 71,
"h": 65, "h": 65,
"ox": 0, "ox": 0,
"oy": 0, "oy": 0,
"sw": 71, "sw": 71,
"sh": 65, "sh": 65,
"ro": false "ro": true
}, },
"music-off.png": { "music-off.png": {
"x": 776, "x": 843,
"y": 811, "y": 813,
"w": 60, "w": 60,
"h": 60, "h": 60,
"ox": 0, "ox": 0,
...@@ -1769,8 +1769,8 @@ export const ResJson = { ...@@ -1769,8 +1769,8 @@ export const ResJson = {
"ro": false "ro": false
}, },
"music-on.png": { "music-on.png": {
"x": 882, "x": 850,
"y": 2, "y": 739,
"w": 60, "w": 60,
"h": 60, "h": 60,
"ox": 0, "ox": 0,
...@@ -1780,8 +1780,8 @@ export const ResJson = { ...@@ -1780,8 +1780,8 @@ export const ResJson = {
"ro": false "ro": false
}, },
"percenntp.png": { "percenntp.png": {
"x": 882, "x": 843,
"y": 64, "y": 875,
"w": 53, "w": 53,
"h": 59, "h": 59,
"ox": 0, "ox": 0,
...@@ -1791,8 +1791,8 @@ export const ResJson = { ...@@ -1791,8 +1791,8 @@ export const ResJson = {
"ro": true "ro": true
}, },
"percennt0.png": { "percennt0.png": {
"x": 882, "x": 776,
"y": 119, "y": 886,
"w": 40, "w": 40,
"h": 57, "h": 57,
"ox": 0, "ox": 0,
...@@ -1802,19 +1802,19 @@ export const ResJson = { ...@@ -1802,19 +1802,19 @@ export const ResJson = {
"ro": true "ro": true
}, },
"percennt3.png": { "percennt3.png": {
"x": 882, "x": 890,
"y": 161, "y": 676,
"w": 37, "w": 37,
"h": 57, "h": 57,
"ox": 0, "ox": 0,
"oy": 0, "oy": 0,
"sw": 37, "sw": 37,
"sh": 57, "sh": 57,
"ro": true "ro": false
}, },
"percennt8.png": { "percennt8.png": {
"x": 882, "x": 904,
"y": 200, "y": 875,
"w": 38, "w": 38,
"h": 57, "h": 57,
"ox": 0, "ox": 0,
...@@ -1824,52 +1824,52 @@ export const ResJson = { ...@@ -1824,52 +1824,52 @@ export const ResJson = {
"ro": true "ro": true
}, },
"percennt2.png": { "percennt2.png": {
"x": 882, "x": 905,
"y": 240, "y": 801,
"w": 39, "w": 39,
"h": 56, "h": 56,
"ox": 0, "ox": 0,
"oy": 0, "oy": 0,
"sw": 39, "sw": 39,
"sh": 56, "sh": 56,
"ro": true "ro": false
}, },
"percennt5.png": { "percennt5.png": {
"x": 882, "x": 912,
"y": 281, "y": 735,
"w": 37, "w": 37,
"h": 56, "h": 56,
"ox": 0, "ox": 0,
"oy": 0, "oy": 0,
"sw": 37, "sw": 37,
"sh": 56, "sh": 56,
"ro": true "ro": false
}, },
"percennt6.png": { "percennt6.png": {
"x": 882, "x": 929,
"y": 320, "y": 676,
"w": 38, "w": 38,
"h": 56, "h": 56,
"ox": 0, "ox": 0,
"oy": 0, "oy": 0,
"sw": 38, "sw": 38,
"sh": 56, "sh": 56,
"ro": true "ro": false
}, },
"percennt9.png": { "percennt9.png": {
"x": 882, "x": 946,
"y": 360, "y": 793,
"w": 38, "w": 38,
"h": 56, "h": 56,
"ox": 0, "ox": 0,
"oy": 0, "oy": 0,
"sw": 38, "sw": 38,
"sh": 56, "sh": 56,
"ro": true "ro": false
}, },
"waitingRot.png": { "waitingRot.png": {
"x": 882, "x": 951,
"y": 400, "y": 734,
"w": 56, "w": 56,
"h": 56, "h": 56,
"ox": 0, "ox": 0,
...@@ -1879,37 +1879,37 @@ export const ResJson = { ...@@ -1879,37 +1879,37 @@ export const ResJson = {
"ro": false "ro": false
}, },
"percennt1.png": { "percennt1.png": {
"x": 776, "x": 946,
"y": 873, "y": 851,
"w": 22, "w": 22,
"h": 55, "h": 55,
"ox": 0, "ox": 0,
"oy": 0, "oy": 0,
"sw": 22, "sw": 22,
"sh": 55, "sh": 55,
"ro": false "ro": true
}, },
"percennt4.png": { "percennt4.png": {
"x": 800, "x": 969,
"y": 873, "y": 691,
"w": 40, "w": 40,
"h": 55, "h": 55,
"ox": 0, "ox": 0,
"oy": 0, "oy": 0,
"sw": 40, "sw": 40,
"sh": 55, "sh": 55,
"ro": false "ro": true
}, },
"percennt7.png": { "percennt7.png": {
"x": 882, "x": 986,
"y": 458, "y": 792,
"w": 41, "w": 41,
"h": 55, "h": 55,
"ox": 0, "ox": 0,
"oy": 0, "oy": 0,
"sw": 41, "sw": 41,
"sh": 55, "sh": 55,
"ro": true "ro": false
} }
} }
}, },
...@@ -3826,5 +3826,5 @@ export const ResJson = { ...@@ -3826,5 +3826,5 @@ export const ResJson = {
} }
} }
], ],
"path": "https://yun.duiba.com.cn/db_games/activity/template/1631206618/resource/" "path": "https://yun.duiba.com.cn/db_games/activity/template/1632799529/resource/"
} }
\ No newline at end of file
...@@ -21,9 +21,9 @@ export class GameOverScene extends Scene { ...@@ -21,9 +21,9 @@ export class GameOverScene extends Scene {
UI.Rect(this, 750, 1624, 0xf1ebdd, 0, 0, 0) UI.Rect(this, 750, 1624, 0xf1ebdd, 0, 0, 0)
var icon = UI.Sp(this, getApp().isNike ? 'nike-icon.png' : 'jordan-icon.png', 41, 220) var icon = UI.Sp(this, getApp().isNike ? 'nike-icon.png' : 'jordan-icon.png', 41, 220)
if (getApp().isLarge) { if (getApp().isLarge) {
icon.position.set(41, layers.stageOffsetY - 90 + 218 + layers.stageOffsetY) icon.position.set(41, layers.stageOffsetY - 90 + 50 + layers.stageOffsetY)
} else { } else {
icon.position.set(41, layers.stageOffsetY - 90 + 168 + layers.stageOffsetY) icon.position.set(41, layers.stageOffsetY - 90 + 0 + layers.stageOffsetY)
} }
this.y -= layers.stageOffsetY - 90 this.y -= layers.stageOffsetY - 90
......
...@@ -36,19 +36,23 @@ class DeviceMotion { ...@@ -36,19 +36,23 @@ class DeviceMotion {
if (my) { if (my) {
const { platform } = await getSystemInfo() const { platform } = await getSystemInfo()
this.platform = platform.toLowerCase() this.platform = platform.toLowerCase()
// @ts-ignore
my && my.onDeviceMotionChange()
this._tmdremoveEvents() this._tmdremoveEvents()
//@ts-ignore setTimeout(() => {
my.onDeviceMotionChange((res) => { //@ts-ignore
// 通过 platform 进行判断当前是 弧度制还是 角度值 my.onDeviceMotionChange((res) => {
if (this.platform != 'android') { // 通过 platform 进行判断当前是 弧度制还是 角度值
res.alpha = res.alpha / 180 * Math.PI if (this.platform != 'android') {
res.beta = res.beta / 180 * Math.PI res.alpha = res.alpha / 180 * Math.PI
res.gamma = res.gamma / 180 * Math.PI res.beta = res.beta / 180 * Math.PI
} else { res.gamma = res.gamma / 180 * Math.PI
res.beta = -res.beta } else {
} res.beta = -res.beta
this.orientationHandler(res) }
}) this.orientationHandler(res)
})
}, 300)
} else { } else {
window.addEventListener('deviceorientation', (event) => { window.addEventListener('deviceorientation', (event) => {
var res = { var res = {
......
...@@ -153,7 +153,7 @@ export class GameScene extends MotionInitScene { ...@@ -153,7 +153,7 @@ export class GameScene extends MotionInitScene {
set score(n: number) { set score(n: number) {
this._score = n; this._score = n;
if (!this.scoreText) { if (!this.scoreText) {
this.scoreText = UI.Txt(this, '连续完成: ' + n, 40, '#111111', FYGE.TEXT_ALIGN.CENTER, layers.stageWidth, -8, layers.stageOffsetY + (getApp().isLarge ? 250 : 150)) this.scoreText = UI.Txt(this, '连续完成: ' + n, 40, '#111111', FYGE.TEXT_ALIGN.CENTER, layers.stageWidth, -8, layers.stageOffsetY + (getApp().isLarge ? (250 - 168) : 50))
this.scoreText.mouseEnable = false this.scoreText.mouseEnable = false
} }
this.scoreText.text = '连续完成: '+n this.scoreText.text = '连续完成: '+n
...@@ -200,7 +200,7 @@ export class GameScene extends MotionInitScene { ...@@ -200,7 +200,7 @@ export class GameScene extends MotionInitScene {
}) })
}) })
cdp.position.set(layers.stageCenterX - 65, layers.stageOffsetY + (getApp().isLarge ? 340 : 240)) cdp.position.set(layers.stageCenterX - 65, layers.stageOffsetY + (getApp().isLarge ? 340 - 168 : 240 - 168))
} }
......
...@@ -308,14 +308,14 @@ export class MotionInitScene extends Scene { ...@@ -308,14 +308,14 @@ export class MotionInitScene extends Scene {
set musicBoolean(m: boolean) { set musicBoolean(m: boolean) {
if (m) { if (m) {
(this.musicBtn || (this.musicBtn = UI.Btn(this, 'music-on.png', this.onMusicClick, this, 650, layers.stageOffsetY + (getApp().isLarge ? 220 : 168 )))).texture = RES.getRes('music-on.png'); (this.musicBtn || (this.musicBtn = UI.Btn(this, 'music-on.png', this.onMusicClick, this, 650, layers.stageOffsetY + (getApp().isLarge ? 52 : 0 )))).texture = RES.getRes('music-on.png');
this.musicBtn.anchorX = 30 this.musicBtn.anchorX = 30
this.musicBtn.anchorY = 30 this.musicBtn.anchorY = 30
FYGE.Tween.get(this.musicBtn, {loop: true}) FYGE.Tween.get(this.musicBtn, {loop: true})
.to({rotation: 360}, 5000) .to({rotation: 360}, 5000)
} else { } else {
(this.musicBtn || (this.musicBtn = UI.Btn(this, 'music-on.png', this.onMusicClick, this, 650, layers.stageOffsetY + (getApp().isLarge ? 220 : 168 )))).texture = RES.getRes('music-off.png'); (this.musicBtn || (this.musicBtn = UI.Btn(this, 'music-on.png', this.onMusicClick, this, 650, layers.stageOffsetY + (getApp().isLarge ? 52 : 168 )))).texture = RES.getRes('music-off.png');
FYGE.Tween.removeTweens(this.musicBtn) FYGE.Tween.removeTweens(this.musicBtn)
this.musicBtn.rotation = 0 this.musicBtn.rotation = 0
} }
...@@ -339,13 +339,16 @@ export class MotionInitScene extends Scene { ...@@ -339,13 +339,16 @@ export class MotionInitScene extends Scene {
initUi() { initUi() {
UI.Rect(this, 750, 1624, 0xf1ebdd, 0, 0, 0) UI.Rect(this, 750, 1624, 0xf1ebdd, 0, 0, 0)
var app = getApp() var app = getApp()
UI.Sp(this, app.isNike ? 'nike-icon.png' : 'jordan-icon.png', 41, app.isLarge ? 218 + layers.stageOffsetY : 168 + layers.stageOffsetY) UI.Sp(this, app.isNike ? 'nike-icon.png' : 'jordan-icon.png', 41, app.isLarge ? 50 + layers.stageOffsetY : 0 + layers.stageOffsetY)
// 中间的小圆 // 中间的小圆
var c = this.addChild(new FYGE.Shape()) // var c = this.addChild(new FYGE.Shape())
.beginFill(0xf0e4ce) // .beginFill(0xf0e4ce)
.arc(layers.stageCenterX, layers.stageCenterY, 270, 0, 2*Math.PI) // .arc(layers.stageCenterX, layers.stageCenterY, 270, 0, 2*Math.PI)
.endFill() // .endFill()
UI.Sp(this, 'centerCircle.png', layers.stageCenterX, layers.stageCenterY).anchorTexture.set(.5, .5)
// @ts-ignore // @ts-ignore
this.focusProgress = this.addChild(new CircleProgressBar({ this.focusProgress = this.addChild(new CircleProgressBar({
...@@ -367,7 +370,7 @@ export class MotionInitScene extends Scene { ...@@ -367,7 +370,7 @@ export class MotionInitScene extends Scene {
this.bitmapTextCount.position.set(layers.stageCenterX, layers.stageCenterY + 380) this.bitmapTextCount.position.set(layers.stageCenterX, layers.stageCenterY + 380)
// @ts-ignore // @ts-ignore
this.holdOnTxt = UI.Txt(this, '保持住!', 60, '#111111', FYGE.TEXT_ALIGN.CENTER, layers.stageWidth, 30, layers.stageOffsetY + (getApp().isLarge ? 340 : 240), true) this.holdOnTxt = UI.Txt(this, '保持住!', 60, '#111111', FYGE.TEXT_ALIGN.CENTER, layers.stageWidth, 30, layers.stageOffsetY + (getApp().isLarge ? 340 - 168 : 240 - 168), true)
this.holdOnTxt.visible = false this.holdOnTxt.visible = false
this.holdOnTxt.anchorX = layers.stageWidth / 2 this.holdOnTxt.anchorX = layers.stageWidth / 2
this.holdOnTxt.anchorY = 30 this.holdOnTxt.anchorY = 30
...@@ -491,7 +494,7 @@ export class MotionInitScene extends Scene { ...@@ -491,7 +494,7 @@ export class MotionInitScene extends Scene {
} }
FYGE.Tween.removeTweens(this.holdOnTxt) FYGE.Tween.removeTweens(this.holdOnTxt)
this.holdOnTxt.position.set(30, layers.stageOffsetY + (getApp().isLarge ? 340 : 240)) // 重新设置一下 this.holdOnTxt.position.set(30, layers.stageOffsetY + (getApp().isLarge ? 340 - 168 : 240 - 168)) // 重新设置一下
this.holdOnTxt.visible = false this.holdOnTxt.visible = false
// @ts-ignore // @ts-ignore
......
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