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

youxi

parent 068af7ad
......@@ -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 {
init(parent: FYGE.Container) {
this._parent = parent;
let bg = new FYGE.Shape();//Graphics()//Shape();
let bg = new FYGE.Graphics();//Graphics()//Shape();
bg.beginFill(0);
bg.drawRect(//引用适配
layers.stageOffsetX - parent.x,
......
......@@ -33,7 +33,7 @@
"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"
},
{
......
......@@ -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",
"atlas": {
"com_light.png": {
......@@ -1636,16 +1636,27 @@ export const ResJson = {
"sh": 756,
"ro": false
},
"toastBg.png": {
"centerCircle.png": {
"x": 750,
"y": 2,
"w": 540,
"h": 540,
"ox": 0,
"oy": 0,
"sw": 540,
"sh": 540,
"ro": false
},
"toastBg.png": {
"x": 750,
"y": 544,
"w": 460,
"h": 130,
"ox": 0,
"oy": 0,
"sw": 460,
"sh": 130,
"ro": true
"ro": false
},
"count-start.png": {
"x": 2,
......@@ -1703,8 +1714,8 @@ export const ResJson = {
"ro": false
},
"count1.png": {
"x": 776,
"y": 464,
"x": 1212,
"y": 544,
"w": 56,
"h": 145,
"ox": 0,
......@@ -1714,30 +1725,19 @@ export const ResJson = {
"ro": false
},
"nike-icon.png": {
"x": 834,
"y": 464,
"x": 750,
"y": 691,
"w": 138,
"h": 46,
"ox": 0,
"oy": 0,
"sw": 138,
"sh": 46,
"ro": true
},
"跳过按钮.png": {
"x": 750,
"y": 611,
"w": 123,
"h": 57,
"ox": 0,
"oy": 0,
"sw": 123,
"sh": 57,
"ro": false
},
"comCloseBtn.png": {
"x": 750,
"y": 670,
"x": 776,
"y": 739,
"w": 72,
"h": 72,
"ox": 0,
......@@ -1748,18 +1748,18 @@ export const ResJson = {
},
"jordan-icon.png": {
"x": 776,
"y": 744,
"y": 813,
"w": 71,
"h": 65,
"ox": 0,
"oy": 0,
"sw": 71,
"sh": 65,
"ro": false
"ro": true
},
"music-off.png": {
"x": 776,
"y": 811,
"x": 843,
"y": 813,
"w": 60,
"h": 60,
"ox": 0,
......@@ -1769,8 +1769,8 @@ export const ResJson = {
"ro": false
},
"music-on.png": {
"x": 882,
"y": 2,
"x": 850,
"y": 739,
"w": 60,
"h": 60,
"ox": 0,
......@@ -1780,8 +1780,8 @@ export const ResJson = {
"ro": false
},
"percenntp.png": {
"x": 882,
"y": 64,
"x": 843,
"y": 875,
"w": 53,
"h": 59,
"ox": 0,
......@@ -1791,8 +1791,8 @@ export const ResJson = {
"ro": true
},
"percennt0.png": {
"x": 882,
"y": 119,
"x": 776,
"y": 886,
"w": 40,
"h": 57,
"ox": 0,
......@@ -1802,19 +1802,19 @@ export const ResJson = {
"ro": true
},
"percennt3.png": {
"x": 882,
"y": 161,
"x": 890,
"y": 676,
"w": 37,
"h": 57,
"ox": 0,
"oy": 0,
"sw": 37,
"sh": 57,
"ro": true
"ro": false
},
"percennt8.png": {
"x": 882,
"y": 200,
"x": 904,
"y": 875,
"w": 38,
"h": 57,
"ox": 0,
......@@ -1824,52 +1824,52 @@ export const ResJson = {
"ro": true
},
"percennt2.png": {
"x": 882,
"y": 240,
"x": 905,
"y": 801,
"w": 39,
"h": 56,
"ox": 0,
"oy": 0,
"sw": 39,
"sh": 56,
"ro": true
"ro": false
},
"percennt5.png": {
"x": 882,
"y": 281,
"x": 912,
"y": 735,
"w": 37,
"h": 56,
"ox": 0,
"oy": 0,
"sw": 37,
"sh": 56,
"ro": true
"ro": false
},
"percennt6.png": {
"x": 882,
"y": 320,
"x": 929,
"y": 676,
"w": 38,
"h": 56,
"ox": 0,
"oy": 0,
"sw": 38,
"sh": 56,
"ro": true
"ro": false
},
"percennt9.png": {
"x": 882,
"y": 360,
"x": 946,
"y": 793,
"w": 38,
"h": 56,
"ox": 0,
"oy": 0,
"sw": 38,
"sh": 56,
"ro": true
"ro": false
},
"waitingRot.png": {
"x": 882,
"y": 400,
"x": 951,
"y": 734,
"w": 56,
"h": 56,
"ox": 0,
......@@ -1879,37 +1879,37 @@ export const ResJson = {
"ro": false
},
"percennt1.png": {
"x": 776,
"y": 873,
"x": 946,
"y": 851,
"w": 22,
"h": 55,
"ox": 0,
"oy": 0,
"sw": 22,
"sh": 55,
"ro": false
"ro": true
},
"percennt4.png": {
"x": 800,
"y": 873,
"x": 969,
"y": 691,
"w": 40,
"h": 55,
"ox": 0,
"oy": 0,
"sw": 40,
"sh": 55,
"ro": false
"ro": true
},
"percennt7.png": {
"x": 882,
"y": 458,
"x": 986,
"y": 792,
"w": 41,
"h": 55,
"ox": 0,
"oy": 0,
"sw": 41,
"sh": 55,
"ro": true
"ro": false
}
}
},
......@@ -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 {
UI.Rect(this, 750, 1624, 0xf1ebdd, 0, 0, 0)
var icon = UI.Sp(this, getApp().isNike ? 'nike-icon.png' : 'jordan-icon.png', 41, 220)
if (getApp().isLarge) {
icon.position.set(41, layers.stageOffsetY - 90 + 218 + layers.stageOffsetY)
icon.position.set(41, layers.stageOffsetY - 90 + 50 + layers.stageOffsetY)
} 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
......
......@@ -36,19 +36,23 @@ class DeviceMotion {
if (my) {
const { platform } = await getSystemInfo()
this.platform = platform.toLowerCase()
// @ts-ignore
my && my.onDeviceMotionChange()
this._tmdremoveEvents()
//@ts-ignore
my.onDeviceMotionChange((res) => {
// 通过 platform 进行判断当前是 弧度制还是 角度值
if (this.platform != 'android') {
res.alpha = res.alpha / 180 * Math.PI
res.beta = res.beta / 180 * Math.PI
res.gamma = res.gamma / 180 * Math.PI
} else {
res.beta = -res.beta
}
this.orientationHandler(res)
})
setTimeout(() => {
//@ts-ignore
my.onDeviceMotionChange((res) => {
// 通过 platform 进行判断当前是 弧度制还是 角度值
if (this.platform != 'android') {
res.alpha = res.alpha / 180 * Math.PI
res.beta = res.beta / 180 * Math.PI
res.gamma = res.gamma / 180 * Math.PI
} else {
res.beta = -res.beta
}
this.orientationHandler(res)
})
}, 300)
} else {
window.addEventListener('deviceorientation', (event) => {
var res = {
......
......@@ -153,7 +153,7 @@ export class GameScene extends MotionInitScene {
set score(n: number) {
this._score = n;
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.text = '连续完成: '+n
......@@ -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 {
set musicBoolean(m: boolean) {
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.anchorY = 30
FYGE.Tween.get(this.musicBtn, {loop: true})
.to({rotation: 360}, 5000)
} 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)
this.musicBtn.rotation = 0
}
......@@ -339,13 +339,16 @@ export class MotionInitScene extends Scene {
initUi() {
UI.Rect(this, 750, 1624, 0xf1ebdd, 0, 0, 0)
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())
.beginFill(0xf0e4ce)
.arc(layers.stageCenterX, layers.stageCenterY, 270, 0, 2*Math.PI)
.endFill()
// var c = this.addChild(new FYGE.Shape())
// .beginFill(0xf0e4ce)
// .arc(layers.stageCenterX, layers.stageCenterY, 270, 0, 2*Math.PI)
// .endFill()
UI.Sp(this, 'centerCircle.png', layers.stageCenterX, layers.stageCenterY).anchorTexture.set(.5, .5)
// @ts-ignore
this.focusProgress = this.addChild(new CircleProgressBar({
......@@ -367,7 +370,7 @@ export class MotionInitScene extends Scene {
this.bitmapTextCount.position.set(layers.stageCenterX, layers.stageCenterY + 380)
// @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.anchorX = layers.stageWidth / 2
this.holdOnTxt.anchorY = 30
......@@ -491,7 +494,7 @@ export class MotionInitScene extends Scene {
}
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
// @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