Introduction
Codecar.io offers an entertaining educational opportunity to anyone who wants to learn software. By playing games, you can get an idea about many topics you will need in the software world and build your algorithm infrastructure.
copy
Start();
copy
Stop();
copy
MoveRight();
copy
MoveLeft();
copy
MoveUp();
copy
MoveDown();
copy
GetOil();
copy
OvertakeBlock();
copy
WaitAtRedLight();
copy
WaitAtCrossWalk();
copy
WaitForTrain();
copy
LeftSignal();
copy
RightSignal();
copy
JumpFromBomb();
if
With the if method, it gives the command it needs to do if the object matches the specified object.
copy
if(gameObject == Oil)
{
GetOil()
};
else
The else method specifies the code that will be activated if the first condition of the object is not met.
copy
if(gameObject == TrafficLight)
{
WaitAtRedLight()
}
else
{
Start()
};
For
The for loop enables the execution of commands within the specified loop if the conditions are suitable for the object within the specified range.
copy
int i=2
for(i=0, i<2, i++)
{
GetOil()
}