Advertisement
imk0tter

Transform Coordinates

Jun 9th, 2023
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. float enemy_offset_x = 250;
  2. float enemy_offset_y = 50;
  3.  
  4. float enemy_velocity_x = 0.707107;
  5. float enemy_velocity_y = 0.707107;
  6.  
  7. float enemy_x = sqrt(pow(enemy_offset_x - (enemy_offset_x * pow(enemy_velocity_x, 2) + enemy_offset_y * pow(enemy_velocity_x, 2)), 2) + pow(enemy_offset_x - (enemy_offset_x * pow(enemy_velocity_y, 2) + enemy_offset_y * pow(enemy_velocity_y, 2)), 2));
  8. float enemy_y = sqrt(pow(enemy_offset_x * pow(enemy_velocity_x, 2) + enemy_offset_y * pow(enemy_velocity_x, 2), 2) + pow(enemy_offset_x * pow(enemy_velocity_y, 2) + enemy_offset_y * pow(enemy_velocity_y, 2), 2));
  9.  
  10. std::cout << "X: " << enemy_x << ", Y: " << enemy_y << "\n";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement