Advertisement
Guest User

Untitled

a guest
May 19th, 2020
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. complex directionToThrust = next.l - myPod.l;
  2. if (myPod.getV() != complex(0.0f,0.0f)) {
  3. nextCheckpointAngle = arg(myPod.getV()) - arg(directionToThrust);
  4. } else {
  5. nextCheckpointAngle *= TO_RADIAN;
  6. }
  7. while(nextCheckpointAngle > PI){
  8. nextCheckpointAngle-=2*PI;
  9. }
  10. while(nextCheckpointAngle < -PI){
  11. nextCheckpointAngle+=2*PI;
  12. }
  13. if(abs(nextCheckpointAngle) > PI/2){
  14. // myPod.move(myPod.l + directionToThrust, 100);
  15. }
  16. if(abs(nextCheckpointAngle)<2*PI/3) {
  17. directionToThrust *= polar(1.0f, -nextCheckpointAngle / 2);
  18. }
  19. cerr << arg(directionToThrust);
  20. if (nextCheckpointDist > 5000 && abs(nextCheckpointAngle) < PI/6) {
  21. myPod.boost(next.l);
  22. }
  23. myPod.move(myPod.l + directionToThrust, 100);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement