Commit 5e11a687 authored by Friends233's avatar Friends233

游戏修改

parent c6b95086
This diff is collapsed.
......@@ -19,7 +19,9 @@ export const CUSTOM_EVENT = {
/** 开始游戏 */
GAME_START: 'GAME_START',
/** 初始化游戏数据 */
GAME_INIT:'GAME_INIT'
GAME_INIT:'GAME_INIT',
/** 销毁游戏场景 */
GAME_DESTROY:'GAME_DESTROY'
}
export const Config = {
......
......@@ -66,9 +66,6 @@ export default class GameScene extends cc.Component {
/** 速度 */
clipSpeed = Config.normalPropSpeed
/** 是否在执行动画中 */
isAni = false
/** 抓取的目标 */
clipTarget: cc.Node = null
......@@ -78,6 +75,9 @@ export default class GameScene extends cc.Component {
/** 游戏配置 */
gameConfig = { ...Config }
/** 加速倍率 */
speedMultiplier = 1
protected onLoad(): void {
// loadGameResources()
......@@ -107,6 +107,9 @@ export default class GameScene extends cc.Component {
this.refreshLevelInfo()
this.refreshStageProps()
}, this)
exportEvent.on(CUSTOM_EVENT.GAME_DESTROY, () => {
this.node.destroy()
}, this)
// TODO 测试用
const href = window?.location?.href
const isTest = getUrlParam('testPanel')
......@@ -117,7 +120,8 @@ export default class GameScene extends cc.Component {
next: 'nextLevel',
refreshProp: 'refreshStageProps',
start: 'testStartGame',
init: 'testInit'
init: 'testInit',
addSpeed: 'addSpeeds'
}
testNode.children.forEach((n) => {
const event = this?.[testEventMap[n.name]]
......@@ -134,10 +138,18 @@ export default class GameScene extends cc.Component {
testInit() {
console.log('测试初始化')
exportEvent.fire(CUSTOM_EVENT.GAME_INIT, {
countDowns: [10, 10, 10]
countDowns: [999, 10, 10]
})
}
addSpeeds() {
this.speedMultiplier += 1
const rotationAni = cc.find('clipMask/clipWrp', this.node)
.getComponent(cc.Animation)
.getAnimationState('clipRation')
rotationAni.speed += 1
}
/**
* 开始游戏
* @param config config
......@@ -315,6 +327,7 @@ export default class GameScene extends cc.Component {
this.setLable('starIcon/starProc', `${this.starNum}/${this.levelObjectives}`)
// 达到目标
if (this.starNum >= this.levelObjectives) {
this.unschedule(this.startCd)
exportEvent.fire(CUSTOM_EVENT.PASS_LEVEL, {
score: this.starNum,
level: this.actLevel
......@@ -332,6 +345,7 @@ export default class GameScene extends cc.Component {
return
}
this.refreshLevelInfo(nextLevel)
this.refreshStageProps()
this.schedule(this.startCd, 1)
}
......@@ -414,7 +428,7 @@ export default class GameScene extends cc.Component {
this.setClipState(CLIP_STATE.STOP)
return
}
this.clip.y -= dt * this.gameConfig.playSpeed
this.clip.y -= dt * this.gameConfig.playSpeed * this.speedMultiplier
}
// 爪子回收
......@@ -425,10 +439,10 @@ export default class GameScene extends cc.Component {
this.setClipState(CLIP_STATE.DEFAULT)
return
}
this.clip.y += dt * this.clipSpeed
this.clip.y += dt * this.clipSpeed * this.speedMultiplier
// 抓到物品,道具的移动
if (this.clipTarget) {
if (this.clipTarget && this.clipTarget?.parent) {
const pos = this.clip.convertToWorldSpaceAR(cc.v2(0, -133))
const p = this.clipTarget.parent.convertToWorldSpaceAR(cc.v2(0, 0))
this.clipTarget.setPosition(pos.x - p.x, pos.y - p.y)
......
{"paths":{"0":["effects/builtin-2d-spine",0],"1":["effects/builtin-2d-gray-sprite",0],"2":["effects/builtin-2d-sprite",0],"3":["materials/builtin-unlit",1],"4":["effects/builtin-3d-trail",0],"5":["effects/builtin-2d-graphics",0],"6":["materials/builtin-2d-gray-sprite",1],"7":["materials/builtin-3d-trail",1],"8":["effects/builtin-unlit",0],"9":["materials/builtin-2d-base",1],"10":["materials/builtin-2d-spine",1],"11":["materials/builtin-2d-graphics",1],"12":["effects/builtin-clear-stencil",0],"13":["materials/builtin-clear-stencil",1],"14":["materials/builtin-2d-label",1],"15":["materials/builtin-2d-sprite",1],"16":["effects/builtin-2d-label",0]},"types":["cc.EffectAsset","cc.Material"],"uuids":["0ek66qC1NOQLjgYmi04HvX","14TDKXr2NJ6LjvHPops74o","28dPjdQWxEQIG3VVl1Qm6T","2aKWBXJHxKHLvrBUi2yYZQ","2afAA24LNP4YmYiaVLiivs","30aC+Hnw1PF4pEcoY3kUYb","3ae7efMv1CLq2ilvUY/tQi","46bU+b5fROqIXVPG6aZWWK","6dkeWRTOBGXICfYQ7JUBnG","6fgBCSDDdPMInvyNlggls2","7a/QZLET9IDreTiBfRn2PD","a1U5RdJRFMFL57BdJC9H1X","c0BAyVxX9JzZy8EjFrc9DU","cffgu4qBxEqa150o1DmRAy","e0LYfU5ZlNFoAB4UiRrGUG","ecpdLyjvZBwrvm+cedCcQy","f1h0LXVtJOta5JLZ1xCzfI","02delMVqdBD70a/HSD99FK"],"scenes":{},"redirect":[],"deps":[],"packs":{"0967b326a":[17,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]},"name":"internal","importBase":"import","nativeBase":"native","debug":false,"isZip":false,"encrypted":false}
\ No newline at end of file
{"paths":{"0":["effects/builtin-2d-gray-sprite",0],"1":["effects/builtin-2d-sprite",0],"2":["materials/builtin-unlit",1],"3":["effects/builtin-3d-trail",0],"4":["effects/builtin-2d-graphics",0],"5":["materials/builtin-2d-gray-sprite",1],"6":["materials/builtin-3d-trail",1],"7":["effects/builtin-unlit",0],"8":["materials/builtin-2d-base",1],"9":["materials/builtin-2d-graphics",1],"10":["effects/builtin-clear-stencil",0],"11":["materials/builtin-clear-stencil",1],"12":["materials/builtin-2d-label",1],"13":["materials/builtin-2d-sprite",1],"14":["effects/builtin-2d-label",0]},"types":["cc.EffectAsset","cc.Material"],"uuids":["14TDKXr2NJ6LjvHPops74o","28dPjdQWxEQIG3VVl1Qm6T","2aKWBXJHxKHLvrBUi2yYZQ","2afAA24LNP4YmYiaVLiivs","30aC+Hnw1PF4pEcoY3kUYb","3ae7efMv1CLq2ilvUY/tQi","46bU+b5fROqIXVPG6aZWWK","6dkeWRTOBGXICfYQ7JUBnG","6fgBCSDDdPMInvyNlggls2","a1U5RdJRFMFL57BdJC9H1X","c0BAyVxX9JzZy8EjFrc9DU","cffgu4qBxEqa150o1DmRAy","e0LYfU5ZlNFoAB4UiRrGUG","ecpdLyjvZBwrvm+cedCcQy","f1h0LXVtJOta5JLZ1xCzfI","02delMVqdBD70a/HSD99FK"],"scenes":{},"redirect":[],"deps":[],"packs":{"05464a930":[15,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]},"name":"internal","importBase":"import","nativeBase":"native","debug":false,"isZip":false,"encrypted":false}
\ No newline at end of file
This diff is collapsed.
{"paths":{},"types":[],"uuids":["2dL3kvpAxJu6GJ7RdqJG5J","15WBwxeRlH7LfKB1vk3Hr3","29FYIk+N1GYaeWH/q1NxQO","29VCRWNg1PJaCMFfRktiT9","31r4X/2DlJsLM38fit+9RU","3cgtWnH0VDBKhrJaLGBxaY","4adjSY21NKn58HTpPHV+GP","4asNelSFZBdJWoRAUF+zfA","57nzdaHfdED63tPBTVngId","5cEQYk9o9HNpay8rRONeKx","71VhFCTINJM6/Ky3oX9nBT","7dFWNhWU5JqbX2WYLwE0lL","8cBygjL2RFKbm1+s0Utqs9","9eVoL8uydDNbyEDvs6pMDM","a39scYjFpPM6wp48nqAB7f","aeme5pj49K+I20dlrkWT/Z","b4P/PCArtIdIH38t6mlw8Y","caPPLVk8tNALK4f1HLeS/m","ccZ87dBnVKaaHVYXZEXW/l","e8Ueib+qJEhL6mXAHdnwbi","e97GVMl6JHh5Ml5qEDdSGa","ebG24L/RFCTKsdG+gOOujI","ebNMh4qYtCqooJGljndL0h","ecpdLyjvZBwrvm+cedCcQy","efIH2ANUNNRrla/2Tkh69y","f0BIwQ8D5Ml7nTNQbh1YlS","f01uShMvVOCbB9b5LIRqaW","f3xSd/ExBBzJl5KRK7XYVG","fbMmcvk8NESZVK02pKjR6b"],"scenes":{"db://assets/Scenes/Game.fire":0},"redirect":[1,0,3,0,4,0,5,0,6,0,7,0,8,0,9,0,11,0,12,0,13,0,14,0,15,0,17,0,18,0,21,0,22,0,23,1,24,0,26,0,27,0,28,0],"deps":["resources","internal"],"packs":{"08fed6e4f":[2,0,10,16,19,20,25]},"name":"main","importBase":"import","nativeBase":"native","debug":false,"isZip":false,"encrypted":false}
\ No newline at end of file
{"paths":{},"types":[],"uuids":["2dL3kvpAxJu6GJ7RdqJG5J","15WBwxeRlH7LfKB1vk3Hr3","29FYIk+N1GYaeWH/q1NxQO","29VCRWNg1PJaCMFfRktiT9","31r4X/2DlJsLM38fit+9RU","3cgtWnH0VDBKhrJaLGBxaY","4adjSY21NKn58HTpPHV+GP","4asNelSFZBdJWoRAUF+zfA","57nzdaHfdED63tPBTVngId","5cEQYk9o9HNpay8rRONeKx","6d+ZkSHVtCLomnABbAgLbi","71VhFCTINJM6/Ky3oX9nBT","7dFWNhWU5JqbX2WYLwE0lL","8cBygjL2RFKbm1+s0Utqs9","9eVoL8uydDNbyEDvs6pMDM","a2MjXRFdtLlYQ5ouAFv/+R","a39scYjFpPM6wp48nqAB7f","aeme5pj49K+I20dlrkWT/Z","b4P/PCArtIdIH38t6mlw8Y","caPPLVk8tNALK4f1HLeS/m","ccZ87dBnVKaaHVYXZEXW/l","e8Ueib+qJEhL6mXAHdnwbi","e97GVMl6JHh5Ml5qEDdSGa","ebG24L/RFCTKsdG+gOOujI","ebNMh4qYtCqooJGljndL0h","ecpdLyjvZBwrvm+cedCcQy","efIH2ANUNNRrla/2Tkh69y","f0BIwQ8D5Ml7nTNQbh1YlS","f01uShMvVOCbB9b5LIRqaW","f3xSd/ExBBzJl5KRK7XYVG","fbMmcvk8NESZVK02pKjR6b"],"scenes":{"db://assets/Scenes/Game.fire":0},"redirect":[1,0,3,0,4,0,5,0,6,0,7,0,8,0,9,0,10,0,12,0,13,0,14,0,15,0,16,0,17,0,19,0,20,0,23,0,24,0,25,1,26,0,28,0,29,0,30,0],"deps":["resources","internal"],"packs":{"08fed6e4f":[2,0,11,18,21,22,27]},"name":"main","importBase":"import","nativeBase":"native","debug":false,"isZip":false,"encrypted":false}
\ No newline at end of file
This diff is collapsed.
[1,0,0,[["cc.Asset",["_name","_native"],1]],[[0,0,1,3]],[[0,"gameCd",".svga"],-1],0,0,[],[],[]]
\ No newline at end of file
This diff is collapsed.
......@@ -40,7 +40,7 @@
<!-- <script src="//yun.duiba.com.cn/db_games/libs0924/svgaParser.minWeb.js" crossorigin="anonymous"></script>-->
<link rel="stylesheet" type="text/css" href="https://yun.duiba.com.cn/db_games/ccc_game/template/1681477764058/style-mobile.css"/>
<link rel="stylesheet" type="text/css" href="https://yun.duiba.com.cn/db_games/ccc_game/template/1681699931548/style-mobile.css"/>
<style>
......@@ -90,9 +90,9 @@
</div>
</div>
<script src="https://yun.duiba.com.cn/db_games/ccc_game/template/1681477764058/src/settings.js" charset="utf-8"></script>
<script src="https://yun.duiba.com.cn/db_games/ccc_game/template/1681699931548/src/settings.js" charset="utf-8"></script>
<script src="https://yun.duiba.com.cn/db_games/ccc_game/template/1681477764058/main.js" charset="utf-8"></script>
<script src="https://yun.duiba.com.cn/db_games/ccc_game/template/1681699931548/main.js" charset="utf-8"></script>
<script type="text/javascript">
(function () {
......
window.__remoteUrl__ = "https://yun.duiba.com.cn/db_games/ccc_game/template/1681477764058/";
window.__remoteUrl__ = "https://yun.duiba.com.cn/db_games/ccc_game/template/1681699931548/";
window.__remoteAssets__ = window.__remoteUrl__ + "assets/";
window.__version__ = 1681477764058;
window.__version__ = 1681699931548;
window.__ENV__ = "prod";
window.boot = function () {
......
......@@ -5,14 +5,34 @@
]
],
"excluded-modules": [
"Dynamic Atlas",
"DragonBones",
"EditBox",
"Mesh",
"MotionStreak",
"Native Socket",
"Physics",
"PageView",
"PageViewIndicator",
"ProgressBar",
"ParticleSystem",
"RichText",
"Renderer Texture",
"Slider",
"ScrollBar",
"ScrollView",
"Spine Skeleton",
"StudioComponent",
"Toggle",
"TiledMap",
"VideoPlayer",
"WebView",
"3D",
"3D Primitive",
"3D Physics/cannon.js",
"3D Physics/Builtin",
"3D Particle"
"3D Particle",
"SafeArea"
],
"group-list": [
"default"
......
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