psuedo code for behaviour tree functions

Just wondering how i could improve these bool checks for my Behaviour tree class, what checks or other functions could i implement to improve these choices this is no where near done just wanted to see if i was on the right track

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
if(bInRangeRed() && bRedplayer == true)
	{
		if(bBallPossession == true)
		{
			bMoveToGoal = true;
		}
		else if (bBallPossession == false )
		{
			bNoBallPossession = true;
		}	
		else if(bNoBallPossession == true || bTeamPossession == true);
		{	
			bBlockDefenders = true;	
			if(bNoBallPossession == true || bTeamPossession == false);
			{	
				bMovetoBall = true;	
			}
		}
	}
	//Blue team behaviour for Defending ball 
	if(bInRangeBlue() && bBlueplayer == true)
	{
		if(bDefendBall == true)
		{
			bMovetoBall = true;
		}
		else if (bBallPossession == true && bClosestBlue == true)//if a red player has the ball and is the closest blue chase him down like a mofo
		{
			bChase = true;//chase red player in possesion of ball 

			if (bNoBallPossession = true);//if no one has the ball either defend the ball or chase a red player 
			{
				bDefendBall = true;
				bNearestRed = true;
			}
		}
	}
Topic archived. No new replies allowed.