Browse Source

优化脚环跑酷的内容

liang 1 year ago
parent
commit
b55dce9121
2 changed files with 6 additions and 4 deletions
  1. 1 1
      footRing_sdk_1.0/include/pub.h
  2. 5 3
      footRing_sdk_1.0/src/RunGame.cpp

+ 1 - 1
footRing_sdk_1.0/include/pub.h

@@ -44,7 +44,7 @@ using namespace std;
 
 #define PRESS_MIN 41000
 
-#define GAME_VERSION "0.6.14"
+#define GAME_VERSION "0.6.15"
 
 enum CMD_MOTION
 {

+ 5 - 3
footRing_sdk_1.0/src/RunGame.cpp

@@ -58,7 +58,7 @@ void RunGame::Process(int time_stamp, int* right_pos, int* right_att, int* right
 		}
 	}
 
-	if (right_roll_vec.size() > 9 && left_roll_vec.size() > 9)
+	if (right_roll_vec.size() > 1 && left_roll_vec.size() > 1)
 	{
 		int right_dist = right_roll_vec.back() - right_roll_vec.front();
 
@@ -69,11 +69,11 @@ void RunGame::Process(int time_stamp, int* right_pos, int* right_att, int* right
 			if (right_dist > 2000 || left_dist > 2000)
 			{
 				std::cout << "right_dist : " << right_dist << " left_dist :" << left_dist << endl;
-				if (right_dist > left_dist + 500)
+				if (right_dist > left_dist)
 				{
 					right_cmd = MOTION_RIGHT;
 				}
-				else if (left_dist > right_dist + 500)
+				else
 				{
 					left_cmd = MOTION_LEFT;
 				}
@@ -86,12 +86,14 @@ void RunGame::Process(int time_stamp, int* right_pos, int* right_att, int* right
 	if (left_cmd != last_left_cmd && left_cmd == MOTION_LEFT)
 	{
 		result[0] = MOTION_LEFT;
+		std::cout << "	result[0] = MOTION_LEFT;" << endl;
 	}
 
 	result[1] = -1;
 	if (right_cmd != last_right_cmd && right_cmd == MOTION_RIGHT)
 	{
 		result[1] = MOTION_RIGHT;
+		std::cout << "	result[1] = MOTION_RIGHT;" << endl;
 	}
 
 	last_left_cmd = left_cmd;