Apr-17-2020, 06:00 PM
This is the code I use to get enemies shoot at the player:
self.gun_rot = (vec(self.game.player.current_ship.rect.center) - self.position).angle_to(vec(1, 0))It should work for you after modification like:
vec = pygame.math.Vector2 angle = (vec(mouse_pos) - vec(bot_position)).angle_to(vec(1, 0))
angle
will be the angle to the bot from the mouse pointer relative the to the x axis.