Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Falling on land when over trees - how to prevent?
#2
Here is my full code for flying Shooter:
Code:
extern void object::HuntAnt()
{
object ant, power;
power = radar(PowerStation);

point pos, pos2;
jet(0.2);
aim(-40);
while(true)
{
while(true)
{
while(radar(AlienAnt, 0, 360, 0, 20) == null)
{
ant=radar(AlienAnt);
turn(direction(ant.position));
motor(1,1);
/*errmode(0);
int err;
err = motor(1,1);
if ( err != 0 )
{
motor(-1, -1);
jet(1);
wait(0.5);
}*/
jet(0);
if (position.z - topo(position) < 8)
   jet(1);
if(position.z - topo(position) > 9)
   jet(-0.1);
wait(0.1);
pos = position;
wait(0.1);
pos2 = position;
if (pos == pos2)
{
move(-3);
turn(90);
move(3);
}
}
fire(1);
if (energyCell.energyLevel < 0.3)
break;
}
errmode(0);
int err;
err = goto(power.position);
if ( err != 0 )
{
motor(-1, -1);
jet(1);
wait(0.5);
}
while (energyCell.energyLevel < 1)
   wait(1);
}

}


Messages In This Thread
RE: Falling on land when over trees - how to prevent? - by Rinoldo - 03-17-2016, 02:27 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)