yichael %!s(int64=5) %!d(string=hai) anos
pai
achega
0562f28236

+ 1 - 1
RhythmMaster/assets/prefab/block.prefab.meta

@@ -1,5 +1,5 @@
 {
-  "ver": "1.2.7",
+  "ver": "1.2.9",
   "uuid": "169b0dc9-69c9-4883-b8fd-922d6bd038c5",
   "optimizationPolicy": "AUTO",
   "asyncLoadAssets": false,

+ 1 - 1
RhythmMaster/assets/prefab/game_page.prefab.meta

@@ -1,5 +1,5 @@
 {
-  "ver": "1.2.7",
+  "ver": "1.2.9",
   "uuid": "80f9922c-0761-46d7-a192-85aae91da47d",
   "optimizationPolicy": "AUTO",
   "asyncLoadAssets": false,

+ 1 - 1
RhythmMaster/assets/prefab/main_page.prefab.meta

@@ -1,5 +1,5 @@
 {
-  "ver": "1.2.7",
+  "ver": "1.2.9",
   "uuid": "1de54ac4-6bb5-413d-93ac-af764584a496",
   "optimizationPolicy": "AUTO",
   "asyncLoadAssets": false,

+ 1 - 1
RhythmMaster/assets/prefab/settle_page.prefab.meta

@@ -1,5 +1,5 @@
 {
-  "ver": "1.2.7",
+  "ver": "1.2.9",
   "uuid": "3ca13665-0f4b-4ddc-a9e4-0b95e10c618f",
   "optimizationPolicy": "AUTO",
   "asyncLoadAssets": false,

+ 1 - 1
RhythmMaster/assets/prefab/song_item.prefab.meta

@@ -1,5 +1,5 @@
 {
-  "ver": "1.2.7",
+  "ver": "1.2.9",
   "uuid": "5272b805-3158-4707-b940-ab34a292272b",
   "optimizationPolicy": "AUTO",
   "asyncLoadAssets": false,

+ 1 - 1
RhythmMaster/assets/scene/game.fire.meta

@@ -1,5 +1,5 @@
 {
-  "ver": "1.2.8",
+  "ver": "1.2.9",
   "uuid": "99f984a4-a3da-4dd2-b091-ef398cf1a248",
   "asyncLoadAssets": false,
   "autoReleaseAssets": false,

+ 14 - 1
RhythmMaster/assets/script/sdk/Listener.js

@@ -26,7 +26,20 @@ cc.Class({
     },
 
     onBoxingPostHit(data) {
-        if (data.ename == "hit" && window.game_page) {
+        // if (data.ename == "hit" && window.game_page) {
+        //     console.log('hit');
+        //     window.game_page.checkHit();
+        // }
+        if (data.direction == "leftPunch" && window.game_page) {
+            console.log('leftPunch');
+            window.game_page.checkHit();
+        }
+        else if(data.direction == "rightPunch" && window.game_page) {
+            console.log('rightPunch');
+            window.game_page.checkHit();
+        }
+        else if(data.direction == "straightPunch" && window.game_page) {
+            console.log('straightPunch');
             window.game_page.checkHit();
         }
     },

+ 2 - 2
RhythmMaster/assets/texture/page/game/block/AutoAtlas.pac.meta

@@ -1,5 +1,5 @@
 {
-  "ver": "1.2.0",
+  "ver": "1.2.1",
   "uuid": "a032fc75-2dd3-4867-aca8-155ebbcf3961",
   "maxWidth": 1024,
   "maxHeight": 1024,
@@ -12,7 +12,7 @@
   "quality": 80,
   "contourBleed": true,
   "paddingBleed": true,
-  "filterUnused": false,
+  "filterUnused": true,
   "packable": false,
   "premultiplyAlpha": false,
   "filterMode": "bilinear",

+ 2 - 2
RhythmMaster/assets/texture/page/game/block/block_long1.png.meta

@@ -7,8 +7,8 @@
   "premultiplyAlpha": false,
   "genMipmaps": false,
   "packable": true,
-  "width": 187,
-  "height": 547,
+  "width": 208,
+  "height": 589,
   "platformSettings": {},
   "subMetas": {
     "block_long1": {

+ 2 - 2
RhythmMaster/assets/texture/page/game/button/AutoAtlas.pac.meta

@@ -1,5 +1,5 @@
 {
-  "ver": "1.2.0",
+  "ver": "1.2.1",
   "uuid": "f5df0f73-a644-485d-a9bb-6a3ecf510173",
   "maxWidth": 1024,
   "maxHeight": 1024,
@@ -12,7 +12,7 @@
   "quality": 80,
   "contourBleed": true,
   "paddingBleed": true,
-  "filterUnused": false,
+  "filterUnused": true,
   "packable": false,
   "premultiplyAlpha": false,
   "filterMode": "bilinear",

+ 2 - 2
RhythmMaster/assets/texture/page/game/button/road_light1.png.meta

@@ -7,8 +7,8 @@
   "premultiplyAlpha": false,
   "genMipmaps": false,
   "packable": true,
-  "width": 165,
-  "height": 500,
+  "width": 162,
+  "height": 389,
   "platformSettings": {},
   "subMetas": {
     "road_light1": {

+ 2 - 2
RhythmMaster/assets/texture/page/main/AutoAtlas.pac.meta

@@ -1,5 +1,5 @@
 {
-  "ver": "1.2.0",
+  "ver": "1.2.1",
   "uuid": "fc5bcd74-ffd1-42aa-baad-56e2c553b36d",
   "maxWidth": 1024,
   "maxHeight": 1024,
@@ -12,7 +12,7 @@
   "quality": 80,
   "contourBleed": true,
   "paddingBleed": true,
-  "filterUnused": false,
+  "filterUnused": true,
   "packable": false,
   "premultiplyAlpha": false,
   "filterMode": "bilinear",

+ 2 - 2
RhythmMaster/assets/texture/page/settle/AutoAtlas.pac.meta

@@ -1,5 +1,5 @@
 {
-  "ver": "1.2.0",
+  "ver": "1.2.1",
   "uuid": "2a2490c9-9801-407b-b6e5-5c5acfa5f156",
   "maxWidth": 1024,
   "maxHeight": 1024,
@@ -12,7 +12,7 @@
   "quality": 80,
   "contourBleed": true,
   "paddingBleed": true,
-  "filterUnused": false,
+  "filterUnused": true,
   "packable": false,
   "premultiplyAlpha": false,
   "filterMode": "bilinear",

+ 2 - 0
RhythmMaster/build/package.bat

@@ -0,0 +1,2 @@
+@ECHO OFF
+start cmd /k node package.js

+ 250 - 0
RhythmMaster/build/package.js

@@ -0,0 +1,250 @@
+var fs = require('fs')
+
+let folderPath = 'web-mobile';
+
+let pathRequire = require('path');
+let pathArr = pathRequire.resolve(__dirname, '..').split("\\"); 
+let newfolderPath = pathArr[pathArr.length-1];//'FightingSports'
+
+let fullFilePath = folderPath+'/index.html'
+
+let Package = 
+{
+	init()
+	{
+		let self = this;
+
+		this.quoteScriptToIndexHtml(function()
+			{
+				console.log("1,引入Script到html成功");
+				self.copyImg(self,function(picName)
+					{
+						console.log("2,拷贝图片成功");
+						self.changeCssBGPercentageAndPngName(self,picName,function()
+						{
+							console.log("3,修改Css背景图片百分比成功");
+							self.changeFolderName(self,function()
+							{
+								console.log("4,修改文件夹名成功");
+								console.log("\n打包成功!");
+							})
+						})
+					});	
+			});
+	},
+	//引入Script到html
+	quoteScriptToIndexHtml(callback)
+	{
+		let self = this;
+		this.readFile(this,fullFilePath,function(str)
+		{
+			let regExp = /<script src="main(.+?)<\/script>/g;// '<script src="main.870be.js" charset="utf-8"></script>';
+			let targetStr = str.match(regExp);
+			// console.log(targetStr);
+
+			let addStr = '<script type="text/javascript" src="//js.cdn.aliyun.dcloud.net.cn/dev/uni-app/uni.webview.1.5.2.js"></script>';
+			let replaceStr = addStr+'\n'+targetStr;
+			let newNata = str.replace(targetStr,replaceStr);
+
+			self.writeFile(self,newNata,fullFilePath,callback);
+		});
+	},
+	//拷贝图片
+	copyImg(self,callback)
+	{
+		let reg = /splash.+?png/;// splash.85cfd.png
+		
+		let pngName = self.matchFileInFolder(folderPath,reg);
+		// console.log('png='+pngName);
+		if(pngName)
+		{
+			fs.unlinkSync(folderPath+'/'+pngName);
+	
+			let picReg = /splash.+?/;// splash.85cfd.png
+			let picName = self.matchFileInFolder('./',picReg);
+			// console.log('picName='+picName);
+			if(picName)
+			{
+				let aPath = folderPath+'/'+file;
+				fs.copyFile(picName,aPath,function(err)
+				{
+					if(err) {
+						console.log('something wrong was happened')
+					}
+					else 
+					{
+						let aName = self.getFileName(pngName);
+						// console.log('aName='+aName);
+						let aTail = self.getFileTail(picName);
+						// console.log('aTail='+aTail);
+						let newFileName = aName+'.'+aTail;
+						// console.log('newFileName='+newFileName);
+						// console.log('copy file succeed');
+
+						let oldPath = folderPath+'/'+picName;
+						let newPath = folderPath+'/'+newFileName;
+						self.rename(oldPath,newPath,function()
+						{
+							callback(newFileName);
+						});
+					}
+				});
+			}	
+		}
+	},
+	// 修改Css背景图片百分比
+	changeCssBGPercentageAndPngName(self,picName,callback){
+	
+		let reg = /style-mobile.+?css/;// style-mobile.6e9cd.css
+		let cssName = self.matchFileInFolder(folderPath,reg);
+
+		if(cssName)
+		{
+			let aPath = folderPath+'/'+file;
+			this.readFile(this,aPath,function(str)
+			{
+				//change percentate
+				let targetStr =  'background-size: 45%;';
+				let replaceStr =  'background-size: 100%;';
+				let newNata = str.replace(targetStr,replaceStr);
+				//change png link
+				let fileName = self.getFileName(picName);
+				// console.log('fileName='+fileName);
+				// console.log('picName='+picName);
+				let newNata2 = newNata.replace(fileName+'.png',picName);
+
+				// console.log(newNata)
+		    	self.writeFile(self,newNata2,aPath,callback);
+			});
+		}
+	},
+	//修改文件夹名
+	changeFolderName(self,callback)
+	{
+		let deleteall = function(path) 
+		{
+			var files = [];
+			if(fs.existsSync(path)) 
+			{
+				files = fs.readdirSync(path);
+				files.forEach(function(file, index) 
+				{
+					var curPath = path + "/" + file;
+					if(fs.statSync(curPath).isDirectory()) 
+					{ // recurse
+						deleteall(curPath);
+					} 
+					else 
+					{ // delete file
+						fs.unlinkSync(curPath);
+					}
+				});
+				fs.rmdirSync(path);
+			}
+			if(!fs.existsSync(newfolderPath))
+			{
+				self.rename(folderPath,newfolderPath,callback)
+			}
+		};
+		// delete FightingSports
+		deleteall(newfolderPath);
+	},
+	readFile(self,path,callback)
+	{
+		fs.readFile(path, function (error, data) 
+		{
+		  if (error) 
+		  {
+		     // 在这里就可以通过判断 error 来确认是否有错误发生
+		    console.log('读取文件失败了')
+		  } 
+		  else 
+		  {
+		      // <Buffer 68 65 6c 6c 6f 20 6e 6f 64 65 6a 73 0d 0a>
+		  	// 文件中存储的其实都是二进制数据 0 1
+		  	// 这里为什么看到的不是 0 和 1 呢?原因是二进制转为 16 进制了
+		  	// 但是无论是二进制01还是16进制,人类都不认识
+		  	// 所以我们可以通过 toString 方法把其转为我们能认识的字符
+		    // console.log(data.toString())
+			var str = data.toString();
+			callback(str);
+		  }
+		});
+	},
+	writeFile(self,newNata,path,callback)
+	{
+		// fs.wirteFile有三个参数
+		// 1,第一个参数是要写入的文件路径
+		// 2,第二个参数是要写入得内容
+		// 3,第三个参数是可选参数,表示要写入的文件编码格式,一般就不写,默认就行
+		// 4,第四个参数是个回调函数  只有一个参数error,来判断是否写入成功
+		fs.writeFile(path, newNata, error => 
+		{
+		 	if (error) return console.log("写入文件失败,原因是" + error.message);
+		 	// console.log("写入成功");
+			callback();	
+		}); 
+	},
+	rename(oldPath,newPath,callback)
+	{
+		//同以目录下的文件更名:
+		fs.rename(oldPath,newPath, function(err)
+		{
+			if(err)
+			{
+				throw err;
+			}
+			// console.log('rename done!');
+			callback();
+		});
+	},
+	matchFileInFolder(path,reg)
+	{
+		const files = fs.readdirSync(path);
+
+		for (file of files) {
+
+			let result = reg.test(file);
+			if(result)
+			{
+				return file;
+			}
+		}
+
+		return null;
+	},
+	getFileName(name)
+	{
+		let namePartArr = name.split('.');
+
+		return name.replace('.'+namePartArr[namePartArr.length-1],'');
+		// if(name.indexOf('.png')!=-1)
+		// {
+		// 	return name.split('.png')[0];
+		// }
+		// else if(name.indexOf('.jpg')!=-1)
+		// {
+		// 	return name.split('.jpg')[0];
+		// }
+	},
+	getFileTail(name)
+	{
+		let namePartArr = name.split('.');
+
+		return namePartArr[namePartArr.length-1];
+
+		// if(name.indexOf('.png')!=-1)
+		// {
+		// 	return 'png';
+		// }
+		// else if(name.indexOf('.jpg')!=-1)
+		// {
+		// 	return 'jpg';
+		// }
+
+		// return '';
+	}
+}
+
+let package =  Object.create(Package);
+package.init();

+ 13 - 0
RhythmMaster/build/readme.md

@@ -0,0 +1,13 @@
+用途
+-----------------
+>本脚本是用于:
+1,把打好的包项目下的index.html文件里加上uniapp的js库  
+2,替换loading图片
+3,修改让背景图片全屏
+4,重命名web-mobile文件夹为项目的文件夹名称  
+
+使用方法
+-----------------
+>将两个脚本同时放到Cocos项目的buil文件夹下面
+1,替换splash.png为想要的loading图片
+2,点击package.bat脚本即可

BIN=BIN
RhythmMaster/build/splash.jpg


+ 1 - 1
RhythmMaster/project.json

@@ -1,7 +1,7 @@
 {
   "engine": "cocos-creator-js",
   "packages": "packages",
-  "version": "2.4.2",
+  "version": "2.4.4",
   "id": "321f4966-0990-44b0-9302-7bf5478d5222",
   "isNew": false
 }

+ 17 - 3
RhythmMaster/settings/builder.json

@@ -21,15 +21,25 @@
   "zipCompressJs": true,
   "fb-instant-games": {},
   "android": {
+    "REMOTE_SERVER_ROOT": "",
     "packageName": "org.cocos2d.demo"
   },
   "ios": {
+    "REMOTE_SERVER_ROOT": "",
+    "ios_enable_jit": true,
     "packageName": "org.cocos2d.demo"
   },
   "mac": {
-    "packageName": "org.cocos2d.demo"
+    "REMOTE_SERVER_ROOT": "",
+    "height": 720,
+    "packageName": "org.cocos2d.demo",
+    "width": 1280
+  },
+  "win32": {
+    "REMOTE_SERVER_ROOT": "",
+    "height": 720,
+    "width": 1280
   },
-  "win32": {},
   "android-instant": {
     "REMOTE_SERVER_ROOT": "",
     "host": "",
@@ -39,5 +49,9 @@
     "scheme": "https",
     "skipRecord": false
   },
-  "appBundle": false
+  "appBundle": false,
+  "mainCompressionType": "merge_all_json",
+  "mainIsRemote": false,
+  "nativeMd5Cache": true,
+  "agreements": {}
 }

+ 1 - 1
RhythmMaster/settings/project.json

@@ -30,7 +30,7 @@
     "3D Particle",
     "SafeArea"
   ],
-  "last-module-event-record-time": 1613738723541,
+  "last-module-event-record-time": 1614508665137,
   "design-resolution-width": 960,
   "design-resolution-height": 640,
   "fit-width": false,