Selaa lähdekoodia

优化跑酷--脚环

liang 1 vuosi sitten
vanhempi
commit
d31ca87259
2 muutettua tiedostoa jossa 12 lisäystä ja 52 poistoa
  1. 1 1
      footRing_sdk_1.0/include/pub.h
  2. 11 51
      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.10"
+#define GAME_VERSION "0.6.11"
 
 enum CMD_MOTION
 {

+ 11 - 51
footRing_sdk_1.0/src/RunGame.cpp

@@ -120,15 +120,11 @@ void RunGame::Process(int time_stamp, int* right_pos, int* right_att, int* right
 		}
 	}
 
-	int jump_cmd = -1;
 
-	jump_cmd = getResultJump(jump);
 
-	int down_cmd = -1;
+	result[2] = getResultJump(jump);
 
-	result[3] = -1;
-
-	down_cmd = getResultDown(down);
+	result[3] = getResultDown(down);
 
 
 	left_acc_deque.push_back(left_acc[2]);
@@ -156,34 +152,21 @@ void RunGame::Process(int time_stamp, int* right_pos, int* right_att, int* right
 		}
 	}
 
-	if (down_cmd == 1)
-	{
-		wait_down = 10;
-	}
-	if (down_cmd == MOTION_DOWN)
-	{
-		addMotionCount(DOWN_COUNT);
 
-		down_wait_after_jump = 20;
-
-		result[3] = MOTION_DOWN;
-
-		wait_down = 0;
-	}
 	//std::cout << "test_down" << endl;
 	//if (wait_down == 1  && acc_valid == 1)
 	//if (wait_down == 10)
-	if(down)
-	{
+	//if(down)
+	//{
 
-		addMotionCount(DOWN_COUNT);
+	//	addMotionCount(DOWN_COUNT);
 
-		down_wait_after_jump = 20;
+	//	down_wait_after_jump = 20;
 
-		result[3] = MOTION_DOWN;
+	//	result[3] = MOTION_DOWN;
 
-		wait_down = 0;
-	}
+	//	wait_down = 0;
+	//}
 
 
 	if (wait_down > 0)
@@ -193,8 +176,6 @@ void RunGame::Process(int time_stamp, int* right_pos, int* right_att, int* right
 
 	result[0] = left_cmd;
 	result[1] = right_cmd;
-	result[2] = jump_cmd;
-	//result[3] = down_cmd;
 
 	//续一个空中不能触发蹲的命令
 	/*if (left_zupt == 0 && right_zupt == 0 && down_wait_after_jump > 0)
@@ -225,11 +206,9 @@ int RunGame::getResultDown(int down)
 {
 	int isDown = -1;
 
-	int canva_down = ((down & 0x04) > 0 ? 1 : 0);
-	
 	if (last_down == 0 && down > 0)
 	{
-		isDown = 1;
+		isDown = MOTION_DOWN;
 
 		addMotionCount(DOWN_COUNT);
 
@@ -237,28 +216,16 @@ int RunGame::getResultDown(int down)
 
 		//down_count++;
 	}
-	/*
-	* down_wait_after_jump:避免前脚蹲后,接着后脚压下来的情况,当down_wait_after_jump == -1时候,判断蹲生效
-	* 当一直处于蹲的时候,额外加拖延时间,在这个时间不允许触发蹲。
-	*/
-
-	if (down == 0 && down_wait_after_jump >=0)
-	{
-		down_wait_after_jump--;
-	}
 
 	last_down = down;
 
-	last_canva_down = canva_down;
-
-
 	return isDown;
 
 }
 
 int RunGame::getResultJump(int jump)
 {
-	int isJump = 0;
+	int isJump = -1;
 
 	if (last_jump == 0 && jump == 1)
 	{
@@ -270,13 +237,6 @@ int RunGame::getResultJump(int jump)
 
 		jump_count++;
 	}
-	/*
-	* 跳之后不能立即接着蹲,用down_wait_after_jump来避免
-	*/
-	if (jump)
-	{
-		down_wait_after_jump = 20;
-	}
 
 	last_jump = jump;