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
This diff is collapsed.
......@@ -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() {
......
......@@ -122,6 +122,15 @@ export class MotionInitScene extends Scene {
.beginFill(0xf0e4ce)
.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'))
......@@ -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