ソースを参照

1.修改了音效

slambb 3 年 前
コミット
7ee2a1983d

+ 2 - 2
common/config.js

@@ -9,9 +9,9 @@ const active = "dev";
 //线上地址,腾讯云服务器
 // const host="https://www.9527fun.cn/api_prd"
 //测试地址,阿里云服务器
-const host = "https://www.9527fun.cn/api_dev"
+// const host = "https://www.9527fun.cn/api_dev"
 //本地测试地址
-// const host = "http://192.168.0.109:9090/api_dev"
+const host = "http://192.168.0.109:9090/api_dev"
 // const host = "http://192.168.0.112:9090/api_dev"
 // const host = "http://47.104.216.192:9090/api_dev"
 // const host = "http://121.4.103.151:9090/api_prd"

+ 48 - 6
components/modal/action-hit/action-hit.vue

@@ -336,7 +336,13 @@
 				//绘制箭头效果
 				bRuning: false,
 				bRuningInfinite: false,
-				yellowRuningTimeout: null
+				yellowRuningTimeout: null,
+				
+				//音效
+				leftHookUrl: "/static/modal/boxing-post/left-hook.mp3",
+				rightHookUrl: "/static/modal/boxing-post/right-hook.mp3",
+				straightHookUrl: "/static/modal/boxing-post/straight-hook.mp3",
+				hookAudioContext: null,
 			}
 		},
 		watch: {
@@ -354,7 +360,7 @@
 					//用signType 做等级类型
 					this.levelType = val.signType;
 
-					// console.log(JSON.stringify(this.taskConditionPassed));
+					console.log(JSON.stringify(this.taskConditionPassed));
 				}
 
 			},
@@ -364,6 +370,13 @@
 		},
 		created() {
 			let _self = this;
+			//初始化一个音效
+			_self.hookAudioContext = uni.createInnerAudioContext();
+			_self.hookAudioContext.autoplay = false;
+			_self.hookAudioContext.src = _self.straightHookUrl;
+			_self.hookAudioContext.volume = 0.5;
+			
+			
 			this.actionHitCanvas = uni.createCanvasContext("actionHitCanvas", this);
 			this.effectHitCanvas = uni.createCanvasContext("effectHitCanvas", this);
 			// this.SystemInfo = this.systemInfo; // uni.getSystemInfoSync();
@@ -391,9 +404,11 @@
 
 			console.log("组件创建")
 		},
-		// destroyed() { //Vue 实例销毁后调用
-		// 	console.log("组件销毁")
-		// },
+		beforeDestroy() {
+			if (_self.hookAudioContext)
+				_self.hookAudioContext.destroy();
+			
+		},
 		methods: {
 			...mapMutations(['onWriteBLEConnectionValue', 'onConvertDeviceData']),
 			//更新新手状态提示
@@ -701,7 +716,14 @@
 				}
 			},
 			onDraw(type, bAnimation) {
+				// console.log(type + "="+ bAnimation);
 				let _self = this;
+				//控制大图标区域音乐播放,发出一次提示音
+				let bPlayAudio = true;
+				if(type = 'tipHit' && _self.spawnAnimation == null){
+					bPlayAudio = false;
+				}
+				
 				if (bAnimation && _self.spawnAnimation == null) {
 					_self.spawnProcess = 0;
 					_self.spawnAnimation = new Animation({
@@ -741,6 +763,26 @@
 					let _currentCenterPos = 0;
 
 					if (2 === i) {
+						if(!bPlayAudio){
+							console.log("play video2 = "+i);
+							bPlayAudio = true;
+							//声音播放
+							if (this.spawnArray[i].jumpName == "RIGHT") {
+								this.hookAudioContext.stop();
+								this.hookAudioContext.src = this.rightHookUrl;
+								this.hookAudioContext.play();
+							} else if(this.spawnArray[i].jumpName == "LEFT") {
+								this.hookAudioContext.stop();
+								this.hookAudioContext.src = this.leftHookUrl;
+								this.hookAudioContext.play();
+							} else{
+								this.hookAudioContext.stop();
+								this.hookAudioContext.src = this.straightHookUrl;
+								this.hookAudioContext.play();
+							}
+						}
+						
+						
 						//这里分两部分走,从小图走到大图
 						let _spawnBiggerToLeft = this.spawnArray[i];
 						//这里记录一个生成点,后面用于生成特效
@@ -1259,7 +1301,7 @@
 			 * 识别跳部分数据处理
 			 */
 			onBLEHitUpdate(gameData) {
-				console.log("gameData:", gameData);
+				// console.log("gameData:", gameData);
 				if (!this.bJumpPlay || this.isGameOver || this.spawnAnimation != null) return;
 
 				// if (curAngleCeil < 30) {

+ 2 - 2
manifest.json

@@ -2,8 +2,8 @@
     "name" : "哔蹦",
     "appid" : "__UNI__2635DF5",
     "description" : "",
-    "versionName" : "2.5.25",
-    "versionCode" : 22052201,
+    "versionName" : "2.5.33",
+    "versionCode" : 22070701,
     "transformPx" : false,
     /* 5+App特有相关 */
     "app-plus" : {

+ 61 - 42
pages/game-page/game-play-sub/subGame/subGame.nvue

@@ -1,9 +1,9 @@
 <template>
 	<view>
-		<!-- :src="url" src = 'http://192.168.0.112:7456/build/index.html' :src="LocationGameUrl" -->
+		<!-- :src="url" src = 'http://192.168.0.112:7456/build/index.html' :src="LocationGameUrl"  :src="'http://' + LocationGameUrl + '/'" -->
 		<!-- @receivedtitle="onReceivedTitle"   @pagefinish="onPageFinish"-->
 		<view class="web-view">
-			<web-view class="web-view-child" :src="url" ref="webview" @pagestart="onPageStart"
+			<web-view class="web-view-child" :src="url"  ref="webview" @pagestart="onPageStart"
 				@onPostMessage="handlePostMessage" @error="onError"></web-view>
 		</view>
 
@@ -620,13 +620,13 @@
 				} else if (temp.funName == "bindHitBoxingPost") {
 					console.log("bindHitBoxingPost");
 
-					if (this.ConnectBindingDevice) {
-						uni.$on('updateBLEDeviceData', this.gWatchBLEUpdate);
-						//hotman 沙袋情景
-						this.gCreateSandbagAlgorithm();
-						this.gStartSimulateBLEUpdate();
-						return;
-					}
+					// if (this.ConnectBindingDevice) {
+					// 	uni.$on('updateBLEDeviceData', this.gWatchBLEUpdate);
+					// 	//hotman 沙袋情景
+					// 	this.gCreateSandbagAlgorithm();
+					// 	this.gStartSimulateBLEUpdate();
+					// 	return;
+					// }
 
 					if (!this.BLEConnectDevice) return;
 					//用设备来区分,开启什么加速计;
@@ -652,7 +652,8 @@
 							this._createEquipmentBasedOnBoxingPostHit();
 						} else if (this.BLEConnectDevice.usageMode == "hotman") {
 							//hotman 沙袋情景  
-							this.gCreateFilterObj();
+							// this.gCreateFilterObj();
+							this.gCreateSandbagAlgorithm();
 						}
 					} else if (this.BLEConnectDevice.deviceType == "mySelf") {
 						//处理手机本身情况下
@@ -689,11 +690,11 @@
 
 				} else if (temp.funName == "unbindHitBoxingPost") {
 
-					if (this.ConnectBindingDevice) {
-						uni.$off('updateBLEDeviceData', this.gWatchBLEUpdate);
-						this.gStopSimulateBLEUpdate();
-						return;
-					}
+					// if (this.ConnectBindingDevice) {
+					// 	uni.$off('updateBLEDeviceData', this.gWatchBLEUpdate);
+					// 	this.gStopSimulateBLEUpdate();
+					// 	return;
+					// }
 
 					if (this.BLEConnectDevice && this.BLEConnectDevice.deviceType == "BLEHandle") {
 						//开启设备回调 3/4关闭
@@ -831,30 +832,30 @@
 					return;
 				}
 
-				if (this.ConnectBindingDevice) {
-					//hotman 沙袋情景 todo
-					this.gUpdateSandbagAlgorithm({
-						data: data,
-						callback: (res) => {
-							// console.log(res);
-							if (res.type == 'hit') {
-								// console.log('gUpdateFilter callback:',res)
-
-								let temp = {
-									direction: res.direction,
-									angle: res.angle,
-									name: res.name,
-									ename: res.ename,
-									value: res.hit,
-									mass: 10, //质量
-									hitPower: res.hit //计算的力
-								}
-								this.sendMessage("onBoxingPostHit", temp);
-							}
-						}
-					});
-					return;
-				}
+				// if (this.ConnectBindingDevice) {
+				// 	//hotman 沙袋情景 todo
+				// 	this.gUpdateSandbagAlgorithm({
+				// 		data: data,
+				// 		callback: (res) => {
+				// 			// console.log(res);
+				// 			if (res.type == 'hit') {
+				// 				// console.log('gUpdateFilter callback:',res)
+
+				// 				let temp = {
+				// 					direction: res.direction,
+				// 					angle: res.angle,
+				// 					name: res.name,
+				// 					ename: res.ename,
+				// 					value: res.hit,
+				// 					mass: 10, //质量
+				// 					hitPower: res.hit //计算的力
+				// 				}
+				// 				this.sendMessage("onBoxingPostHit", temp);
+				// 			}
+				// 		}
+				// 	});
+				// 	return;
+				// }
 
 				if (this.BLEConnectDevice.usageMode == "phone" || this.BLEConnectDevice.usageMode == "general") {
 					//手机情景或者自由模式
@@ -873,13 +874,31 @@
 					})
 				} else if (this.BLEConnectDevice.usageMode == "hotman") {
 					//hotman 沙袋情景 todo
-					this.gUpdateFilter({
+					// this.gUpdateFilter({
+					// 	data: data,
+					// 	callback: (res) => {
+					// 		// console.log(res);
+					// 		if (res.type == 'hit') {
+					// 			// console.log('gUpdateFilter callback:',res)
+
+					// 			let temp = {
+					// 				direction: res.direction,
+					// 				angle: res.angle,
+					// 				name: res.name,
+					// 				ename: res.ename,
+					// 				value: res.hit,
+					// 				mass: 10, //质量
+					// 				hitPower: res.hit //计算的力
+					// 			}
+					// 			this.sendMessage("onBoxingPostHit", temp);
+					// 		}
+					// 	}
+					// });
+					this.gUpdateSandbagAlgorithm({
 						data: data,
 						callback: (res) => {
 							// console.log(res);
 							if (res.type == 'hit') {
-								// console.log('gUpdateFilter callback:',res)
-
 								let temp = {
 									direction: res.direction,
 									angle: res.angle,

+ 14 - 4
pages/personal-page/personal/personal.vue

@@ -178,8 +178,14 @@
 												hiddenType: 'firstInstallation'
 											})">计划</button>
 			</view> -->
-
-			<view style="height: 50rpx;"></view>
+			<!-- <view class="example">
+				<view class="text-white">1.连接设备 。</view>
+				<view class="text-white">2.输入cocos本地ip地址,切换到游戏列表点击开始游戏。</view>
+				<view class="text-white">游戏地址::http://{{LocationGameUrl}}/build/index.html</view>
+			</view>
+			<input class="bg-white" @input="onKeyInput" :value="LocationGameUrl"/>
+			<view style="height: 550rpx;"></view> -->
+			
 		</scroll-view>
 
 		<!-- 底部中间上滑按钮 -->
@@ -926,6 +932,9 @@
 				uni.$emit("onShowFirstInstallation");
 			}
 			// #endif
+			
+			//读取一个本地ip记录
+			this.onGetLocationGameUrl();
 		},
 		onReady() {
 			//限制开始点击播放
@@ -1003,7 +1012,8 @@
 				'closeDrawerById', 'closePopupById', 'closeGuideById',
 				'getSignInList', 'onUserSignIn',
 				'setGuideUnlockState',
-				'resetActionJumpTask'
+				'resetActionJumpTask',
+				'onSetLocationGameUrl','onGetLocationGameUrl'
 			]),
 			BasicsSteps() {
 				this.basics = this.basics == this.basicsList.length - 1 ? 0 : this.basics + 1
@@ -2438,7 +2448,7 @@
 			},
 
 			onKeyInput: function(event) {
-				this.$store.state.LocationGameUrl = event.target.value
+				this.onSetLocationGameUrl(event.target.value);
 			},
 			onNavFcGame() {
 				// console.log(0);

+ 67 - 44
util/util-js/o0ProjectRelease0.1.js

@@ -15,7 +15,7 @@ module.exports = {
 			this.frameOffset = 0;
 
 			this.frameHitCapacity = 11;
-			this.frameHit = [];//打击后的n帧
+			this.frameHit = []; //打击后的n帧
 
 			for (var i = 0; i < this.frameCapacity; ++i) {
 				var o = new Object();
@@ -49,9 +49,9 @@ module.exports = {
 					var newDirectionDistance = newDirection.length;
 					if (directionDistance < newDirectionDistance) {
 						directionDistance = newDirectionDistance;
-						direction = newDirection.multiply(this.frameHit[this.frameHit.length - 1].time - this.frameHit[0].time);
-					}
-					else {
+						direction = newDirection.multiply(this.frameHit[this.frameHit.length - 1].time -
+							this.frameHit[0].time);
+					} else {
 						//cout << "false" << endl;
 					}
 				}
@@ -79,18 +79,22 @@ module.exports = {
 			if (this.stableCount < this.stableCountMax) {
 				this.stableCount += 1;
 			}
-			this.stableAcc = this.stableAcc.multiply((this.stableCount - 1.0) / this.stableCount).plus(rawAcc.multiply(1 / this.stableCount));
-			this.stableGyr = this.stableGyr.multiply((this.stableCount - 1.0) / this.stableCount).plus(rawGyr.multiply(1 / this.stableCount));
+			this.stableAcc = this.stableAcc.multiply((this.stableCount - 1.0) / this.stableCount).plus(
+				rawAcc.multiply(1 / this.stableCount));
+			this.stableGyr = this.stableGyr.multiply((this.stableCount - 1.0) / this.stableCount).plus(
+				rawGyr.multiply(1 / this.stableCount));
 			//////////////////////////////////////////////////////////////////////////////////
 			newFrame.accFixed = newFrame.acc.length * 100;
 
 			if (newFrame.accFixed < lastFrame.accFixed * 0.85) {
 				newFrame.accFixed = lastFrame.accFixed * 0.85;
 			}
-			lastFrame.accFixed = Math.max(lastFrame.accFixed, Math.min(newFrame.accFixed, last2Frame.accFixed), Math.min(newFrame.accFixed, last3Frame.accFixed));
+			lastFrame.accFixed = Math.max(lastFrame.accFixed, Math.min(newFrame.accFixed, last2Frame
+				.accFixed), Math.min(newFrame.accFixed, last3Frame.accFixed));
 			///////////////////////////////////////////////////////////////////////
 			//newFrame.pos = lastFrame.pos.plus(lastFrame.acc.plus(newFrame.acc).multiply(timeGap/60)).multiply(Math.max(1-timeGap/200,0));
-			newFrame.pos = lastFrame.pos.plus(newFrame.acc.multiply(timeGap / 30)).multiply(Math.max(1 - timeGap / 1000, 0));
+			newFrame.pos = lastFrame.pos.plus(newFrame.acc.multiply(timeGap / 30)).multiply(Math.max(1 -
+				timeGap / 1000, 0));
 			////////////////////////////////////////////
 			newFrame.accSlope = Math.max(newFrame.accFixed - lastFrame.accFixed, 0);
 
@@ -101,8 +105,10 @@ module.exports = {
 			var t4 = newFrame.timeGap + t3;
 
 			newFrame.predict = new o0.Vector2(
-				new o0.QuadraticEquation(0, this.frame[lastI - 2].pos.x, t2, this.frame[lastI - 1].pos.x, t3, this.frame[lastI].pos.x).y(t4),
-				new o0.QuadraticEquation(0, this.frame[lastI - 2].pos.y, t2, this.frame[lastI - 1].pos.y, t3, this.frame[lastI].pos.y).y(t4));/** */
+				new o0.QuadraticEquation(0, this.frame[lastI - 2].pos.x, t2, this.frame[lastI - 1].pos
+					.x, t3, this.frame[lastI].pos.x).y(t4),
+				new o0.QuadraticEquation(0, this.frame[lastI - 2].pos.y, t2, this.frame[lastI - 1].pos
+					.y, t3, this.frame[lastI].pos.y).y(t4)); /** */
 
 			newFrame.shake = o0.distance2(newFrame.predict, newFrame.pos) * 100;
 
@@ -114,25 +120,30 @@ module.exports = {
 			newFrame.shakeFixed = lastFrame.shakeFixed * 0.85;
 			if (newFrame.shake > newFrame.shakeFixed) {
 				newFrame.shakeFixed = newFrame.shake;
-			}/* */
-			lastFrame.shakeFixed = Math.max(lastFrame.shakeFixed, Math.min(newFrame.shakeFixed, last2Frame.shakeFixed), Math.min(newFrame.shakeFixed, last3Frame.shakeFixed));
+			} /* */
+			lastFrame.shakeFixed = Math.max(lastFrame.shakeFixed, Math.min(newFrame.shakeFixed, last2Frame
+				.shakeFixed), Math.min(newFrame.shakeFixed, last3Frame.shakeFixed));
 			////////////////////////////////////////////////////////////////
 			newFrame.shakeSlope = Math.max(newFrame.shakeFixed - lastFrame.shakeFixed, 0);
 			///////////////////////////////////////////////////////////////
 
+			// (newFrame.accSlope >= 15 || lastFrame.accSlope >= 20) &&
+			// (newFrame.shakeSlope >= 20 || lastFrame.shakeSlope >= 40)
+			
 			var direction = undefined;
-
-			if (lastFrame.hit == 0
-				&& last2Frame.hit == 0
-				&& last3Frame.hit == 0
-				&& last4Frame.hit == 0
-				&& last5Frame.hit == 0
-				&& (newFrame.accSlope >= 15 || lastFrame.accSlope >= 20)
-				&& (newFrame.shakeSlope >= 20 || lastFrame.shakeSlope >= 40)) {
+			let _threshold = [15,20,20,40];//判定的阈值
+			if (lastFrame.hit == 0 &&
+				last2Frame.hit == 0 &&
+				last3Frame.hit == 0 &&
+				last4Frame.hit == 0 &&
+				last5Frame.hit == 0 &&
+				(newFrame.accSlope >= _threshold[0] || lastFrame.accSlope >= _threshold[1]) &&
+				(newFrame.shakeSlope >= _threshold[2] || lastFrame.shakeSlope >= _threshold[3])) {
 				newFrame.hit = 1;
-				if (this.frameHit.length < this.frameHitCapacity && this.frameHit.length != 0) {//判断到第二次hit,但还未输出第一次hit的方向,强制输出方向
+				if (this.frameHit.length < this.frameHitCapacity && this.frameHit.length !=
+					0) { //判断到第二次hit,但还未输出第一次hit的方向,强制输出方向
 					direction = this.GetDirection();
-				}/**/
+				} /**/
 				this.frameHit = [];
 
 				/*
@@ -160,7 +171,7 @@ module.exports = {
 				//o.gyr = this.frameHit[this.frameHit.length-1].gyr.plus(newFrame.gyr);
 				o.gyr = newFrame.gyr;
 				this.frameHit.push(o);
-				if (this.frameHit.length == this.frameHitCapacity) {//累计达到设定的延迟帧数,输出方向
+				if (this.frameHit.length == this.frameHitCapacity) { //累计达到设定的延迟帧数,输出方向
 					direction = this.GetDirection();
 				}
 			}
@@ -171,45 +182,54 @@ module.exports = {
 		}
 
 		getTempValue(curDirection) {
-            let result = Math.atan2(curDirection.y,curDirection.x) * 180 / (Math.PI);
-            result = Math.round(result);
-			let curAngle = result > 0 ? result:(360 + result);
-			
+			let result = Math.atan2(curDirection.y, curDirection.x) * 180 / (Math.PI);
+			result = Math.round(result);
+			let curAngle = result > 0 ? result : (360 + result);
+
 			let directionPunch = "all",
 				name = "击中",
 				ename = "hit";
 
-			if (curAngle < 110 && curAngle >= 70) {
+			//min , max
+			let pLeftBetween = [105, 180];
+			let pStraightBetween = [75, 105];
+			let pRightBetween = [0, 75];
+
+			if (curAngle >= pStraightBetween[0] && curAngle < pStraightBetween[1]) {
 				directionPunch = "straightPunch";
 				name = "正向的直拳";
 				ename = "front-straight";
-			} else if (curAngle < 70 && curAngle >= 0) {
+			} else if (curAngle >= pRightBetween[0] && curAngle < pRightBetween[1]) {
 				directionPunch = "rightPunch";
 				name = "正向的右拳";
 				ename = "front-right";
-			} else if (curAngle >= 110 && curAngle <= 180) {
+			} else if (curAngle >= pLeftBetween[0] && curAngle <= pLeftBetween[1]) {
 				directionPunch = "leftPunch";
 				name = "正向的左拳";
 				ename = "front-left";
 			}
 			//相反方向击打
 			//正方向
-			else if (curAngle > 180 && curAngle <= 250) {
-				directionPunch = "rightPunch";
-				name = "负向的右拳";
-				ename = "back-right";
-			}
-			else if (curAngle > 250 && curAngle <= 290) {
-				directionPunch = "straightPunch";
-				name = "负向的直拳";
-				ename = "back-straight";
-			} else if (curAngle > 290 && curAngle <= 360) {
-				directionPunch = "leftPunch";
-				name = "负向的左拳";
-				ename = "back-left";
+			else {
+				let mAngle = curAngle - 180;
+
+				if (mAngle > pRightBetween[0] && mAngle <= pRightBetween[1]) {
+					directionPunch = "rightPunch";
+					name = "负向的右拳";
+					ename = "back-right";
+				} else if (mAngle > pStraightBetween[0] && mAngle <= pStraightBetween[1]) {
+					directionPunch = "straightPunch";
+					name = "负向的直拳";
+					ename = "back-straight";
+				} else if (mAngle > pLeftBetween[0] && mAngle <= pLeftBetween[1]) {
+					directionPunch = "leftPunch";
+					name = "负向的左拳";
+					ename = "back-left";
+				}
 			}
 
 
+
 			this.quitHitCount++;
 
 			let temp = {
@@ -225,8 +245,11 @@ module.exports = {
 				name: name,
 				ename: ename
 			}
+
+			console.log("hit:" + JSON.stringify(temp));
+
 			return temp;
 
 		}
 	}
-};
+};

+ 31 - 5
util/util-js/store.js

@@ -284,7 +284,7 @@ const store = new Vuex.Store({
 		 * 比如拳击模块体验下,设置 0
 		 * 跳绳为主的模式体验下,设置 1
 		 */
-		currentModeIndex: 1,
+		currentModeIndex: 0,
 
 		//蓝牙变量操作
 		/**
@@ -320,7 +320,7 @@ const store = new Vuex.Store({
 		//本地游戏地址
 		// http://192.168.0.112:7456/build/index.html
 		// http://127.0.0.1:7456/build/index.html
-		LocationGameUrl: "http://110.43.54.43/t8/",
+		LocationGameUrl: "192.168.0.109:7456",
 
 		//快速打击对象
 		filter: null,
@@ -433,6 +433,19 @@ const store = new Vuex.Store({
 
 	},
 	mutations: {
+
+		onSetLocationGameUrl(state, value) {
+			uni.setStorageSync('LocationGameUrl', value);
+			state.LocationGameUrl = value;
+		},
+		//获取本地任务对象
+		onGetLocationGameUrl(state) {
+			//如果存在本地任务
+			const value = uni.getStorageSync('LocationGameUrl');
+			if (value) {
+				state.LocationGameUrl = value;
+			}
+		},
 		/**
 		 * 蓝牙解析后的数据,转化成对应的坐标系方向
 		 * @param {Object} context
@@ -2075,6 +2088,7 @@ const store = new Vuex.Store({
 		 */
 		gCreateSandbagAlgorithm(state) {
 			state.sandbagAlgorithm = null;
+			state.deviceMs = 1;
 			state.sandbagAlgorithmLastTime = new Date().getTime();
 			state.sandbagAlgorithm = new o0ProjectRelease.SandbagAlgorithm();
 			console.log("gCreateSandbagAlgorithm");
@@ -2090,7 +2104,18 @@ const store = new Vuex.Store({
 				data,
 				callback = null
 			} = context;
-
+			
+			let {
+				min,
+				s,
+				ms
+			} = data;
+			let msGap = ms - state.deviceMs;
+			state.deviceMs = ms;
+			while (msGap < 0) {
+				msGap += 1000;
+			}
+			
 			let {
 				ax,
 				ay,
@@ -2102,9 +2127,10 @@ const store = new Vuex.Store({
 				gy,
 				gz
 			} = data.gyro;
+
 			// ax / 10, az / 10, gz, -gx, data.ms ----- old
 			// ay / 10, -az / 10, gy, gz, data.ms
-			let [hit, dir] = state.sandbagAlgorithm.Update(-ay,az,-gz,-gy, data.ms );
+			let [hit, dir] = state.sandbagAlgorithm.Update(ay, -az, gz, gy, msGap);
 			if (dir != undefined) {
 				let temp = state.sandbagAlgorithm.getTempValue(dir);
 				if (callback) {
@@ -3338,7 +3364,7 @@ const store = new Vuex.Store({
 				state.singlePersonList = state.levels.singlePersonMap[_levelType - 1];
 			else
 				state.singlePersonList = [];
-				
+
 			if (state.levels.multiPersonMap && state.levels.multiPersonMap.length >= _levelType)
 				state.multiPersonList = state.levels.multiPersonMap[_levelType - 1];
 			else