Commit 295340c7 authored by Tt's avatar Tt

处理bug

parent 1cbf5ebb
{ {"ver":"1.1.2","uuid":"c35bb2f6-f24a-4850-ae44-643f2fdc7541","isBundle":false,"bundleName":"","priority":1,"compressionType":{},"optimizeHotUpdate":{},"inlineSpriteFrames":{},"isRemoteBundle":{"ios":false,"android":false},"subMetas":{}}
"ver": "1.1.2", \ No newline at end of file
"uuid": "c35bb2f6-f24a-4850-ae44-643f2fdc7541",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {
"ios": false,
"android": false
},
"subMetas": {}
}
\ No newline at end of file
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
"_groupIndex": 0, "_groupIndex": 0,
"groupIndex": 0, "groupIndex": 0,
"autoReleaseAssets": true, "autoReleaseAssets": true,
"_id": "0737ce42-24f0-45c6-8e1a-8bdab4f74ba3" "_id": "771f1a6d-1545-4697-8ea3-a0913edefc6f"
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
...@@ -7524,13 +7524,13 @@ ...@@ -7524,13 +7524,13 @@
"_id": "29zXboiXFBKoIV4PQ2liTe" "_id": "29zXboiXFBKoIV4PQ2liTe"
}, },
{ {
"__type__": "408a6f4ZfpM8Yzyg+IOGg/V", "__type__": "c263blay+lCoI8jH31a/8w1",
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 2 "__id__": 2
}, },
"_enabled": true, "_enabled": true,
"_id": "eaTVUpqahPfZeO9+sUI7RP" "_id": "6ce9f9aff78f49e1a542c4"
} }
] ]
\ No newline at end of file
{ {
"ver": "1.2.9", "ver": "1.2.9",
"uuid": "0737ce42-24f0-45c6-8e1a-8bdab4f74ba3", "uuid": "771f1a6d-1545-4697-8ea3-a0913edefc6f",
"asyncLoadAssets": false, "asyncLoadAssets": false,
"autoReleaseAssets": true, "autoReleaseAssets": true,
"subMetas": {} "subMetas": {}
......
...@@ -80,7 +80,9 @@ export default class NewClass extends MyCocosSceneComponent { ...@@ -80,7 +80,9 @@ export default class NewClass extends MyCocosSceneComponent {
onTouchRight(data) { onTouchRight(data) {
pg.event.emit("player_point_update"); pg.event.emit("player_point_update");
if (Game.getIns().isRobot) { if (Game.getIns().isRobot) {
this.onSpeakScueess(); this.scheduleOnce(() => {
this.onSpeakScueess();
}, 1)
} else { } else {
this.touchData = data; this.touchData = data;
pg.event.emit("speak_open", data.text); pg.event.emit("speak_open", data.text);
...@@ -96,8 +98,9 @@ export default class NewClass extends MyCocosSceneComponent { ...@@ -96,8 +98,9 @@ export default class NewClass extends MyCocosSceneComponent {
this.gameOver(); this.gameOver();
} else { } else {
//播放题干后继续 //播放题干后继续
pg.event.emit("game_stop_loop"); //清理界面
this.scheduleOnce(() => { this.scheduleOnce(() => {
pg.event.emit("game_stop_loop");
//播放题干然后继续 //播放题干然后继续
pg.event.emit("play_stem"); pg.event.emit("play_stem");
}, 0.4) }, 0.4)
...@@ -105,6 +108,7 @@ export default class NewClass extends MyCocosSceneComponent { ...@@ -105,6 +108,7 @@ export default class NewClass extends MyCocosSceneComponent {
} }
onSpeakFail() { onSpeakFail() {
//回退到最后一个位置 //回退到最后一个位置
Game.getIns().pause = false;
this.touchData && this.touchData.cbFailed && this.touchData.cbFailed(); this.touchData && this.touchData.cbFailed && this.touchData.cbFailed();
} }
//----------------------------小企鹅------------------- //----------------------------小企鹅-------------------
......
{ {
"ver": "1.0.8", "ver": "1.0.8",
"uuid": "408a67f8-65fa-4cf1-8cf2-83e20e1a0fd5", "uuid": "c263b95a-cbe9-42a0-8f23-1f7d5affcc35",
"isPlugin": false, "isPlugin": false,
"loadPluginInWeb": true, "loadPluginInWeb": true,
"loadPluginInNative": true, "loadPluginInNative": true,
......
...@@ -55,6 +55,19 @@ export default class NewClass extends cc.Component { ...@@ -55,6 +55,19 @@ export default class NewClass extends cc.Component {
pg.view.visible(this.txt, false) pg.view.visible(this.txt, false)
} }
pg.hw.playLocalAudio("appear"); pg.hw.playLocalAudio("appear");
// Game.getIns().pause
// cc.tween(this.penguin).to(0.4, { y: 190 }).call(() => {
// if (Game.getIns().pause) {
// } else {
// cc.tween(this.penguin).delay(2).call(() => {
// this.touched = true;
// cc.tween(this.penguin).to(0.4, { y: -100 }).delay(0.1).call(() => {
// this.node.parent = null;
// }).start();
// }).start();
// }
// }).start();
cc.tween(this.penguin).to(0.4, { y: 190 }).delay(2).call(() => { cc.tween(this.penguin).to(0.4, { y: 190 }).delay(2).call(() => {
this.touched = true; this.touched = true;
}).to(0.4, { y: -100 }).delay(0.1).call(() => { }).to(0.4, { y: -100 }).delay(0.1).call(() => {
...@@ -67,14 +80,13 @@ export default class NewClass extends cc.Component { ...@@ -67,14 +80,13 @@ export default class NewClass extends cc.Component {
let time = 0.4 + wait + Math.random() * 2; let time = 0.4 + wait + Math.random() * 2;
this.scheduleOnce(() => { this.scheduleOnce(() => {
if (this.touched) return; if (this.touched) return;
if (Game.getIns().pause) return;
Game.getIns().isRobot = true; Game.getIns().isRobot = true;
this.onTouchText(); this.onTouchText();
}, time); }, time);
} }
} }
showSuccessAni() { showSuccessAni() {
Game.getIns().pause = false;
pg.hw.playLocalAudio("right");
cc.tween(this.penguin).to(0.4, { y: -100 }).delay(0.1).call(() => { cc.tween(this.penguin).to(0.4, { y: -100 }).delay(0.1).call(() => {
this.node.parent = null; this.node.parent = null;
}).start(); }).start();
...@@ -99,16 +111,19 @@ export default class NewClass extends cc.Component { ...@@ -99,16 +111,19 @@ export default class NewClass extends cc.Component {
} }
onPlayerText() { onPlayerText() {
if (this.touched) return; if (this.touched) return;
if (Game.getIns().pause) return;
Game.getIns().isRobot = false; Game.getIns().isRobot = false;
this.onTouchText(); this.onTouchText();
} }
onTouchText() { onTouchText() {
if (Game.getIns().isOver) return; if (Game.getIns().isOver) return;
if (Game.getIns().pause) return;
if (this.touched) return; if (this.touched) return;
this.touched = true; this.touched = true;
let data = this.data; let data = this.data;
if (Game.getIns().isRobot) { if (Game.getIns().isRobot) {
if (data.right == "1") { if (data.right == "1") {
Game.getIns().pause = true;
pg.view.visible(this.right, true); pg.view.visible(this.right, true);
Game.getIns().audioing = true; Game.getIns().audioing = true;
pg.hw.playLocalAudio("right").then(() => { pg.hw.playLocalAudio("right").then(() => {
...@@ -134,7 +149,6 @@ export default class NewClass extends cc.Component { ...@@ -134,7 +149,6 @@ export default class NewClass extends cc.Component {
this.showSuccessAni(); this.showSuccessAni();
} }
data.cbFailed = () => { data.cbFailed = () => {
Game.getIns().pause = false;
this.showErrorAni(); this.showErrorAni();
} }
pg.event.emit("item_touch_right", data); pg.event.emit("item_touch_right", data);
......
...@@ -33,6 +33,7 @@ export default class NewClass extends cc.Component { ...@@ -33,6 +33,7 @@ export default class NewClass extends cc.Component {
} }
startLoop() { startLoop() {
//播放一次题干后继续 //播放一次题干后继续
Game.getIns().pause = false;
this.lastId = []; this.lastId = [];
this.unschedule(this.createItem); this.unschedule(this.createItem);
this.schedule(this.createItem, 1); this.schedule(this.createItem, 1);
...@@ -41,6 +42,8 @@ export default class NewClass extends cc.Component { ...@@ -41,6 +42,8 @@ export default class NewClass extends cc.Component {
} }
stopLoop() { stopLoop() {
this.unschedule(this.createItem); this.unschedule(this.createItem);
this.layout_up.removeAllChildren();
this.layout_down.removeAllChildren();
} }
private lastId: Array<number>; private lastId: Array<number>;
createItem() { createItem() {
......
...@@ -114,7 +114,7 @@ export default class NewClass extends cc.Component { ...@@ -114,7 +114,7 @@ export default class NewClass extends cc.Component {
"fluency": 60, "fluency": 60,
"rhythm": 90, "rhythm": 90,
"kernel_version": "5.2.4", "kernel_version": "5.2.4",
"overall": 20,//75 "overall": 80,//75
"integrity": 100, "integrity": 100,
"duration": "6.779", "duration": "6.779",
"rear_tone": "fall", "rear_tone": "fall",
...@@ -163,7 +163,7 @@ export default class NewClass extends cc.Component { ...@@ -163,7 +163,7 @@ export default class NewClass extends cc.Component {
pg.hw.playLocalAudio("tryagain"); pg.hw.playLocalAudio("tryagain");
this.tryCount++; this.tryCount++;
this.scheduleOnce(() => { this.scheduleOnce(() => {
this.open(null); this.open(this.val);
}, 2.5) }, 2.5)
} }
} }
......
const { spawn } = require("child_process"); const { spawn } = require("child_process");
const fs = require("fs"); const fs = require("fs");
const compressing = require('compressing'); const compressing = require('compressing');
const { v4, parse } = require('uuid'); const { v4, parse } = require('uuid');
const { Base64 } = require('js-base64'); const { Base64 } = require('js-base64');
const { copyDir, removeDir, fix2 } = require("./utils"); const { copyDir, removeDir, fix2 } = require("./utils");
async function buildForm() { async function buildForm() {
const paths = fs.readdirSync('form'); const paths = fs.readdirSync('form');
...@@ -52,7 +52,7 @@ function execCmd(cmd, params, path) { ...@@ -52,7 +52,7 @@ function execCmd(cmd, params, path) {
} }
let creatorBasePath = 'CocosCreator'; let creatorBasePath = 'D:\\work\\CocosDashboard_1.0.9\\resources\\.editors\\Creator\\2.4.5\\CocosCreator.exe';
if (process.platform !== 'win32') { if (process.platform !== 'win32') {
creatorBasePath = "/Applications/CocosCreator/Creator/2.4.5/CocosCreator.app/Contents/MacOS/CocosCreator"; creatorBasePath = "/Applications/CocosCreator/Creator/2.4.5/CocosCreator.app/Contents/MacOS/CocosCreator";
} }
...@@ -128,10 +128,10 @@ async function buildWebBundle() { ...@@ -128,10 +128,10 @@ async function buildWebBundle() {
await buildCocos(args); await buildCocos(args);
} }
function createConfigFile (projectName, type) { function createConfigFile(projectName, type) {
let iosVersion = ""; let iosVersion = "";
let androidVersion = ""; let androidVersion = "";
if(!type){ if (!type) {
const androidPaths = fs.readdirSync(`dist/android/${projectName}`); const androidPaths = fs.readdirSync(`dist/android/${projectName}`);
const androidConfigFileName = androidPaths.find(path => path.indexOf('config') == 0); const androidConfigFileName = androidPaths.find(path => path.indexOf('config') == 0);
androidVersion = androidConfigFileName.split('.')[1]; androidVersion = androidConfigFileName.split('.')[1];
...@@ -139,17 +139,17 @@ function createConfigFile (projectName, type) { ...@@ -139,17 +139,17 @@ function createConfigFile (projectName, type) {
const iosConfigFileName = iosPaths.find(path => path.indexOf('config') == 0); const iosConfigFileName = iosPaths.find(path => path.indexOf('config') == 0);
iosVersion = iosConfigFileName.split('.')[1]; iosVersion = iosConfigFileName.split('.')[1];
} else { } else {
if(type=="android"){ if (type == "android") {
const androidPaths = fs.readdirSync(`dist/android/${projectName}`); const androidPaths = fs.readdirSync(`dist/android/${projectName}`);
const androidConfigFileName = androidPaths.find(path => path.indexOf('config') == 0); const androidConfigFileName = androidPaths.find(path => path.indexOf('config') == 0);
androidVersion = androidConfigFileName.split('.')[1]; androidVersion = androidConfigFileName.split('.')[1];
}else{ } else {
const iosPaths = fs.readdirSync(`dist/ios/${projectName}`); const iosPaths = fs.readdirSync(`dist/ios/${projectName}`);
const iosConfigFileName = iosPaths.find(path => path.indexOf('config') == 0); const iosConfigFileName = iosPaths.find(path => path.indexOf('config') == 0);
iosVersion = iosConfigFileName.split('.')[1]; iosVersion = iosConfigFileName.split('.')[1];
} }
} }
const config = { const config = {
"ios": { "ios": {
"sceneName": projectName, "sceneName": projectName,
...@@ -164,7 +164,7 @@ function createConfigFile (projectName, type) { ...@@ -164,7 +164,7 @@ function createConfigFile (projectName, type) {
fs.writeFileSync('dist/config.json', JSON.stringify(config)); fs.writeFileSync('dist/config.json', JSON.stringify(config));
} }
function compressAll (projectName) { function compressAll(projectName) {
const tarStream = new compressing.zip.Stream(); const tarStream = new compressing.zip.Stream();
tarStream.addEntry('dist/play'); tarStream.addEntry('dist/play');
tarStream.addEntry('dist/form'); tarStream.addEntry('dist/form');
...@@ -176,7 +176,7 @@ function compressAll (projectName) { ...@@ -176,7 +176,7 @@ function compressAll (projectName) {
tarStream.pipe(destStream); tarStream.pipe(destStream);
} }
function build_check () { function build_check() {
const dirNames = process.cwd().split(/\/|\\/); const dirNames = process.cwd().split(/\/|\\/);
const projectName = dirNames[dirNames.length - 1]; const projectName = dirNames[dirNames.length - 1];
const path = 'assets' const path = 'assets'
...@@ -211,20 +211,20 @@ function build_check () { ...@@ -211,20 +211,20 @@ function build_check () {
return projectName; return projectName;
} }
function changeSettingToWebDesktop () { function changeSettingToWebDesktop() {
const path = 'assets' const path = 'assets'
const folderName = getFolderName(path); const folderName = getFolderName(path);
editFolderMeta(path, folderName, false); editFolderMeta(path, folderName, false);
} }
function changeSettingsToBundle () { function changeSettingsToBundle() {
const path = 'assets' const path = 'assets'
const folderName = getFolderName(path); const folderName = getFolderName(path);
editFolderMeta(path, folderName, true); editFolderMeta(path, folderName, true);
} }
function replaceUuids () { function replaceUuids() {
console.log('build_step_0 开始~!'); console.log('build_step_0 开始~!');
const path = 'assets' const path = 'assets'
...@@ -303,7 +303,7 @@ function replaceUuids () { ...@@ -303,7 +303,7 @@ function replaceUuids () {
console.log('build_step_0 完成~!'); console.log('build_step_0 完成~!');
} }
function replaceIndexHtml () { function replaceIndexHtml() {
const data = fs.readFileSync('index.html'); const data = fs.readFileSync('index.html');
fs.writeFileSync('dist/play/index.html', data); fs.writeFileSync('dist/play/index.html', data);
} }
...@@ -313,52 +313,52 @@ module.exports = { ...@@ -313,52 +313,52 @@ module.exports = {
build: async function () { build: async function () {
const startTime = new Date().getTime(); const startTime = new Date().getTime();
// 构建前检查 // 构建前检查
const projectName = build_check(); const projectName = build_check();
// 清理旧文件 // 清理旧文件
// 构建form // 构建form
await removeDir('dist/form'); await removeDir('dist/form');
await buildForm(); await buildForm();
// 替换uuid // 替换uuid
replaceUuids(); replaceUuids();
// 改设置为非bundle // 改设置为非bundle
changeSettingToWebDesktop(); changeSettingToWebDesktop();
// 构建play // 构建play
await removeDir('dist/play'); await removeDir('dist/play');
await buildWebDesktop(); await buildWebDesktop();
await copyDir('build/web-desktop', 'dist/play'); await copyDir('build/web-desktop', 'dist/play');
replaceIndexHtml(); replaceIndexHtml();
console.log('构建 web desktop 成功!'); console.log('构建 web desktop 成功!');
// 改设置为bundle // 改设置为bundle
changeSettingsToBundle(); changeSettingsToBundle();
await removeDir('dist/android'); await removeDir('dist/android');
await buildAndroidBundle(); await buildAndroidBundle();
await copyDir('build_android/jsb-link/remote', 'dist/android'); await copyDir('build_android/jsb-link/remote', 'dist/android');
console.log('构建 android bundle 成功!'); console.log('构建 android bundle 成功!');
await removeDir('dist/ios'); await removeDir('dist/ios');
await buildIosBundle(); await buildIosBundle();
await copyDir('build_ios/jsb-link/remote', 'dist/ios'); await copyDir('build_ios/jsb-link/remote', 'dist/ios');
console.log('构建 ios bundle 成功!'); console.log('构建 ios bundle 成功!');
await removeDir('dist/web_desktop'); await removeDir('dist/web_desktop');
await buildWebBundle(); await buildWebBundle();
await copyDir(`build_web_desktop/web-desktop/assets/${projectName}`, 'dist/web_desktop'); await copyDir(`build_web_desktop/web-desktop/assets/${projectName}`, 'dist/web_desktop');
console.log('构建 web bundle 成功!'); console.log('构建 web bundle 成功!');
// 改设置为非bundle // 改设置为非bundle
changeSettingToWebDesktop(); changeSettingToWebDesktop();
createConfigFile(projectName); createConfigFile(projectName);
compressAll(projectName); compressAll(projectName);
await removeDir('build'); await removeDir('build');
...@@ -380,11 +380,11 @@ module.exports = { ...@@ -380,11 +380,11 @@ module.exports = {
replaceUuids(); replaceUuids();
// 改设置为bundle // 改设置为bundle
changeSettingsToBundle(); changeSettingsToBundle();
await removeDir('dist/android'); await removeDir('dist/android');
await buildAndroidBundle(); await buildAndroidBundle();
await copyDir('build_android/jsb-link/remote', 'dist/android'); await copyDir('build_android/jsb-link/remote', 'dist/android');
// 改设置为非bundle // 改设置为非bundle
changeSettingToWebDesktop(); changeSettingToWebDesktop();
createConfigFile(projectName, "android"); createConfigFile(projectName, "android");
...@@ -400,7 +400,7 @@ module.exports = { ...@@ -400,7 +400,7 @@ module.exports = {
replaceUuids(); replaceUuids();
// 改设置为bundle // 改设置为bundle
changeSettingsToBundle(); changeSettingsToBundle();
await removeDir('dist/ios'); await removeDir('dist/ios');
await buildIosBundle(); await buildIosBundle();
await copyDir('build_ios/jsb-link/remote', 'dist/ios'); await copyDir('build_ios/jsb-link/remote', 'dist/ios');
......
{ {
"title": "play", "title": "play",
"packageName": "org.cocos2d.demo", "packageName": "org.cocos2d.demo",
"startScene": "0737ce42-24f0-45c6-8e1a-8bdab4f74ba3", "startScene": "771f1a6d-1545-4697-8ea3-a0913edefc6f",
"excludeScenes": [], "excludeScenes": [],
"includeSDKBox": false, "includeSDKBox": false,
"orientation": { "orientation": {
......
{ {
"last-module-event-record-time": 1600677246969, "last-module-event-record-time": 1641110457128,
"migrate-history": [ "migrate-history": [
"cloud-function" "cloud-function"
], ],
......
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