Commit 16714916 authored by Master Q's avatar Master Q

0915

parent a622a43d
...@@ -220,9 +220,9 @@ export class Main { ...@@ -220,9 +220,9 @@ export class Main {
const pageCfg = Tools.PAGE const pageCfg = Tools.PAGE
pageCfg.gameDiff && Object.assign(GameSimCfg, { pageCfg.gameDiff && Object.assign(GameSimCfg, {
boomProbability: 30, // 炸弹的概率 boomProbability: 10, // 炸弹的概率
diffLevel: 6, diffLevel: 10,
maxBoomNum: 3, // 一波中最多炸弹数 maxBoomNum: 2, // 一波中最多炸弹数
}) })
var scene var scene
if (pageCfg.newUser) { if (pageCfg.newUser) {
......
This diff is collapsed.
...@@ -23,8 +23,9 @@ export const Soundurl = { ...@@ -23,8 +23,9 @@ export const Soundurl = {
sucess: '//yun.duiba.com.cn/spark/assets/b8d82c2e432278dcc4fddfec5c6d585ac7cc5675.mp3', sucess: '//yun.duiba.com.cn/spark/assets/b8d82c2e432278dcc4fddfec5c6d585ac7cc5675.mp3',
fail: '//yun.duiba.com.cn/spark/assets/aa8c3daa5c0717d58649b95216bd27e06ee714da.mp3', fail: '//yun.duiba.com.cn/spark/assets/aa8c3daa5c0717d58649b95216bd27e06ee714da.mp3',
moonCakeOut: '//yun.dui88.com/ec747b63-31d2-45ca-ba5a-6b1b8beefec4.mp3', moonCakeOut: '//yun.dui88.com/ec747b63-31d2-45ca-ba5a-6b1b8beefec4.mp3',
moonCakeBreak: '//yun.dui88.com/592006ed-1e80-4770-9ae5-95cdb47dab05.mp3', moonCakeBreak: '//yun.dui88.com/ae73ce3d-1c7c-4dec-81d1-c701bace9b8b.mp3',
boomBreak: '//yun.dui88.com/25f64850-b5d6-4507-b4df-35252282d2e2.mp3' boomBreak: '//yun.dui88.com/25f64850-b5d6-4507-b4df-35252282d2e2.mp3',
blade: '//yun.dui88.com/6d1b5f49-00ee-4590-975f-e2080f45ec4c.mp3', // 刀光
} }
// private sounds = { // private sounds = {
......
...@@ -22,9 +22,6 @@ export default class BoomEle extends FYGE.Sprite { ...@@ -22,9 +22,6 @@ export default class BoomEle extends FYGE.Sprite {
this.anchorX = this.width / 2 this.anchorX = this.width / 2
this.reset() this.reset()
FYGE.Tween.get(this, {loop: true})
.to({ rotation: 360 }, 5000)
} }
initPhyBody() { initPhyBody() {
...@@ -43,7 +40,9 @@ export default class BoomEle extends FYGE.Sprite { ...@@ -43,7 +40,9 @@ export default class BoomEle extends FYGE.Sprite {
reset() { reset() {
this.isDie = false this.isDie = false
// this.initPhyBody()
FYGE.Tween.get(this, {loop: true})
.to({ rotation: 360 }, 5000)
return this return this
} }
......
...@@ -36,10 +36,24 @@ export default class MoonCake extends FYGE.Sprite { ...@@ -36,10 +36,24 @@ export default class MoonCake extends FYGE.Sprite {
// 克隆一个纹理 // 克隆一个纹理
this.texture = RES.getRes(`mooncake${i}.png`).clone() this.texture = RES.getRes(`mooncake${i}.png`).clone()
this.texture.valid = true this.texture.valid = true
// this.anchorTexture.set(0.5, 0.5) // this.anchorTexture.set(0.5, 0.5)
this.anchorY = this.height / 2 this.anchorY = this.height / 2
this.anchorX = this.width / 2 this.anchorX = this.width / 2
this.scaleX = 1
this.scaleY = 1
var _scale = {
0: 1.2,
1: 1.55,
2: 1.55
}
if (_scale[i]) {
this.scaleX = _scale[i]
this.scaleY = _scale[i]
}
this.initHalfPart() this.initHalfPart()
FYGE.Tween.get(this, {loop: true}) FYGE.Tween.get(this, {loop: true})
......
export const GameSimCfg = { export const GameSimCfg = {
boomProbability: 10, // 炸弹的概率 boomProbability: 5, // 炸弹的概率
diffLevel: 10, diffLevel: 15,
levelNum: 4,
crazyMaxLen: 6, // crazy time boom's number crazyMaxLen: 6, // crazy time boom's number
maxBoomNum: 2, // 一波中最多炸弹数 maxBoomNum: 1, // 一波中最多炸弹数
shortCutTime: 200, shortCutTime: 500,
crazyTime: 10000, crazyTime: 10000,
isPlayMusic: false, isPlayMusic: true,
GamingTime: 70000, GamingTime: 70000,
fpsScale: 1 fpsScale: 1
} }
\ No newline at end of file
...@@ -21,6 +21,7 @@ export default class GameScene extends Scene { ...@@ -21,6 +21,7 @@ export default class GameScene extends Scene {
isOver: boolean = true isOver: boolean = true
gameEles: Array<MoonCake|BoomEle> = [] gameEles: Array<MoonCake|BoomEle> = []
maxcakes: number = GameSimCfg.diffLevel maxcakes: number = GameSimCfg.diffLevel
currLevel: number = 0 // 分成n波
sceneContainer: FYGE.Container sceneContainer: FYGE.Container
blade: Blade blade: Blade
currBoomNum: number = 0 currBoomNum: number = 0
...@@ -48,7 +49,6 @@ export default class GameScene extends Scene { ...@@ -48,7 +49,6 @@ export default class GameScene extends Scene {
shortCutCnt: FYGE.Container // 连击 Container shortCutCnt: FYGE.Container // 连击 Container
shortCutText: FYGE.BitmapText shortCutText: FYGE.BitmapText
moonCakeScore: number = 0 moonCakeScore: number = 0
boomScore: number = 0
shortCutScore: number = 0 shortCutScore: number = 0
set score(n: number) { set score(n: number) {
...@@ -297,7 +297,8 @@ export default class GameScene extends Scene { ...@@ -297,7 +297,8 @@ export default class GameScene extends Scene {
*/ */
gennerateMoonCakes() { gennerateMoonCakes() {
if (this.isOver) return if (this.isOver) return
while(this.gameEles.length < this.maxcakes) { this.currLevel < GameSimCfg.levelNum && ++this.currLevel
while(this.gameEles.length < Math.floor(this.maxcakes * this.currLevel / GameSimCfg.levelNum)) {
this.initGameEle() this.initGameEle()
} }
} }
...@@ -314,7 +315,7 @@ export default class GameScene extends Scene { ...@@ -314,7 +315,7 @@ export default class GameScene extends Scene {
mc.addedToPhyScene(randomNum(1000, 4000), {x: rx < 812 ? randomNum(3,5) : randomNum(-3, -5), y: -32 * k}) mc.addedToPhyScene(randomNum(1000, 4000), {x: rx < 812 ? randomNum(3,5) : randomNum(-3, -5), y: -32 * k})
mc.fx = rx mc.fx = rx
// 测试 // 测试
mc.fy = 750 mc.fy = 800
this.gameEles.push(mc) this.gameEles.push(mc)
} }
...@@ -356,6 +357,7 @@ export default class GameScene extends Scene { ...@@ -356,6 +357,7 @@ export default class GameScene extends Scene {
return return
} }
} }
this.spIcon.play(1)
this.gameEles.forEach(ele => { this.gameEles.forEach(ele => {
!ele.isFire && (ele.fy = layers.stageHeight + 1000) !ele.isFire && (ele.fy = layers.stageHeight + 1000)
...@@ -389,7 +391,7 @@ export default class GameScene extends Scene { ...@@ -389,7 +391,7 @@ export default class GameScene extends Scene {
x: layers.stageOffsetX - 200, x: layers.stageOffsetX - 200,
y: randomNum(layers.stageOffsetY + 100, layers.stageOffsetY + 300) y: randomNum(layers.stageOffsetY + 100, layers.stageOffsetY + 300)
}, { }, {
x: randomNum(15, 20), x: randomNum(20, 30),
y: randomNum(-4, -10) y: randomNum(-4, -10)
})) }))
} }
...@@ -399,7 +401,7 @@ export default class GameScene extends Scene { ...@@ -399,7 +401,7 @@ export default class GameScene extends Scene {
x: layers.stageOffsetX + layers.stageWidth + 50, x: layers.stageOffsetX + layers.stageWidth + 50,
y: randomNum(layers.stageOffsetY + 100, layers.stageOffsetY + 300) y: randomNum(layers.stageOffsetY + 100, layers.stageOffsetY + 300)
}, { }, {
x: randomNum(-15, -20), x: randomNum(-20, -30),
y: randomNum(-4, -10) y: randomNum(-4, -10)
})) }))
} }
...@@ -417,7 +419,6 @@ export default class GameScene extends Scene { ...@@ -417,7 +419,6 @@ export default class GameScene extends Scene {
boomScoreSp: FYGE.Sprite boomScoreSp: FYGE.Sprite
onBoomFunc({data}) { onBoomFunc({data}) {
this.score -= 10 this.score -= 10
this.boomScore -= 10
// 重新计算连击 // 重新计算连击
this.shortCutNum.reDo() this.shortCutNum.reDo()
this.allGameEles.forEach((ele, i) => { this.allGameEles.forEach((ele, i) => {
...@@ -563,7 +564,7 @@ export default class GameScene extends Scene { ...@@ -563,7 +564,7 @@ export default class GameScene extends Scene {
} }
drawBlade = throttle((e) =>{ drawBlade = throttle((e) =>{
!this.isOver && this.blade && this.blade.drawBlade(e) (!this.isOver || this.isCrazy) && this.blade && this.blade.drawBlade(e)
}, 0) }, 0)
// 帧事件 // 帧事件
...@@ -571,7 +572,7 @@ export default class GameScene extends Scene { ...@@ -571,7 +572,7 @@ export default class GameScene extends Scene {
let len = this.gameEles.length let len = this.gameEles.length
for (var i = len -1; i>= 0;i --) { for (var i = len -1; i>= 0;i --) {
var curr = this.gameEles[i] var curr = this.gameEles[i]
if (curr.y > layers.stageHeight) { if (curr.y > layers.stageHeight + 100) {
curr.comeDown() curr.comeDown()
if (curr instanceof MoonCake) { if (curr instanceof MoonCake) {
// @ts-ignore // @ts-ignore
...@@ -593,7 +594,7 @@ export default class GameScene extends Scene { ...@@ -593,7 +594,7 @@ export default class GameScene extends Scene {
let llen = this.leftCrazyMoonCake.length let llen = this.leftCrazyMoonCake.length
for (let i = llen -1; i>= 0;i --) { for (let i = llen -1; i>= 0;i --) {
let curr = this.leftCrazyMoonCake[i] let curr = this.leftCrazyMoonCake[i]
if (curr.y > layers.stageHeight) { if (curr.y > layers.stageHeight + 100) {
curr.comeDown() curr.comeDown()
if (curr instanceof MoonCake) { if (curr instanceof MoonCake) {
// @ts-ignore // @ts-ignore
...@@ -608,7 +609,7 @@ export default class GameScene extends Scene { ...@@ -608,7 +609,7 @@ export default class GameScene extends Scene {
let rlen = this.rightCrazyMoonCake.length let rlen = this.rightCrazyMoonCake.length
for (let i = rlen -1; i>= 0;i --) { for (let i = rlen -1; i>= 0;i --) {
let curr = this.rightCrazyMoonCake[i] let curr = this.rightCrazyMoonCake[i]
if (curr.y > layers.stageHeight) { if (curr.y > layers.stageHeight + 100) {
curr.comeDown() curr.comeDown()
if (curr instanceof MoonCake) { if (curr instanceof MoonCake) {
// @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