Get The Rabbit

#1

Le projet Unity de départ :

Source Unity

#2

Inès
Louise
Léna
David

	if (IsHoldingCheese ()) {
		
		SetTargetToBase ();

		RotateTowardTarget ();
		Accelerate ();
	}
		
	else {

		if (NumberOfAvailableCheeses () > 0) { 

			SetTargetToClosestCheese (); 

			RotateTowardTarget ();

			Accelerate ();
		} else {
			SetTargetToClosestUnmarkedRabbit ();
			RotateTowardTarget ();
			Accelerate ();
		}
	}


	if (IsInTheBase ()) {
		ReleaseCheese ();

	}
#3
void FixedUpdate ()
{
	// fonctions disponibles
	SetTargetToClosestUnmarkedRabbit() ;
	RotateTowardTarget() ;
	Accelerate () ;

	if (NumberOfAvailableCheeses () > 0)
	{
		SetTargetToClosestCheese ();
		RotateTowardTarget ();
		Accelerate () ;
	}

	if (IsHoldingCheese ()) 
	{
		SetTargetToBase() ;
		RotateTowardTarget ();
		Accelerate () ;
	}

	if (IsInTheBase ())
	{
		ReleaseCheese() ;
	}
#4

BENJAMIN
MORGANE
RAPHAEL

{

	if (NumberOfTotalRabbits ()>0) 
	{
		SetTargetToClosestUnmarkedRabbit ();
		RotateTowardTarget ();
		Accelerate ();

	}

	if (NumberOfAvailableCheeses ()>0) 
	{
		SetTargetToClosestCheese ();
		RotateTowardTarget ();
		Accelerate ();
	}



	if (IsHoldingCheese ()) 
	{
		SetTargetToBase ();
		RotateTowardTarget (); 
		Accelerate ();

	}


	if (IsInTheBase ())
	{
		ReleaseCheese();
	}
#5

Camille, Romane, Nona

{

	SetTargetToClosestUnmarkedRabbit ();
	RotateTowardTarget();
	Accelerate ();

	if (IsHoldingCheese ()) 
	{
		SetTargetToBase ();
		RotateTowardTarget ();
		Accelerate ();

	}

	if (IsInTheBase ()) 
	{
		ReleaseCheese ();
		SetTargetToClosestCheese ();

	}
	if (NumberOfAvailableCheeses()<0)
		
		{
			SetTargetToClosestUnmarkedRabbit();
		}
		if (NumberOfAvailableCheeses()>0)
		{
		
		SetTargetToClosestCheese ();

		}

}
#6

Jérémy, Corentin, Matteo

void FixedUpdate ()
{
SetTargetToClosestUnmarkedRabbit ();
RotateTowardTarget ();
Accelerate ();
RotateTowardTarget ();
Accelerate ();
RotateTowardTarget ();
Accelerate ();
RotateTowardTarget ();
Accelerate ();

	SetTargetToClosestCheese ();
	RotateTowardTarget ();
	Accelerate ();

	if (IsHoldingCheese ()) 
	{
		SetTargetToBase ();
		RotateTowardTarget ();
		Accelerate ();

	}
		

	if (IsInTheBase ())
	
	{
		ReleaseCheese();

	
	}
#7

SetTargetToClosestUnmarkedRabbit ();
RotateTowardTarget ();
Accelerate () ;

	if (IsHoldingCheese ()) {
		SetTargetToBase ();	
		RotateTowardTarget ();
		Accelerate () ;
	}

	if (IsInTheBase ()) {
		ReleaseCheese ();
	}

	if (NumberOfAvailableCheeses()>0)
	{

		SetTargetToClosestCheese ();

	}
#8

SetTargetToClosestUnmarkedRabbit ();
RotateTowardTarget ();

	if (NumberOfAvailableCheeses ()>0) 
	{
		SetTargetToClosestCheese ();
		RotateTowardTarget ();

	

	if (IsHoldingCheese ()) 
		SetTargetToBase ();
		RotateTowardTarget ();
		Accelerate ();
		if (IsInTheBase ())
		ReleaseCheese ();

	
		
		}
	Accelerate ();
}
#9

EMMA
MORGANE
et paul

void FixedUpdate ()
	{
		SetTargetToClosestUnmarkedRabbit();
		RotateTowardTarget();
		Accelerate ();


		if (NumberOfAvailableCheeses () >= 1) 
		{
			SetTargetToClosestCheese ();
			RotateTowardTarget ();
			Accelerate ();
		}

		if ( IsHoldingCheese() == true )
		{
			SetTargetToBase (); 
			RotateTowardTarget();
			Accelerate ();	
			if ( IsInTheBase() == true )
			{
			ReleaseCheese ();
		}
#10

Tous vos codes regroupés :
Sources Unity

1 Like