I want to modify from the topLeft from midleft.
import pygame
from pygame.locals import*
from sys import exit
ALTO_Y_ANCHO_VENTANA = 960,600
COLOR_ROJO = 255,0,0
# ENEMIGO_UNO_SURF I IMPORTED FROM OTHER FOLDER.
# Enemigo_1
enemigo_1_escalado = pygame.transform.scale(enemigo_uno_surf, (80,70)).convert_alpha()
enemigo_1_rect = enemigo_1_escalado.get_rect(midbottom = (66, 530))
while True:
lista_eventos = pygame.event.get()
for event in lista_eventos:
if event.type == pygame.QUIT:
pygame.quit()
exit()
if event.type == pygame.MOUSEMOTION:
mouse_pos = pygame.math.Vector2(pygame.mouse.get_pos()) # tipo Vector2
centro_enemigo = pygame.math.Vector2(enemigo_1_rect.centerx, enemigo_1_rect.centery) # tipo Vector2
direction = mouse_pos - centro_enemigo
length = direction.length()
scaling_factor = 10000 / length
endpoint = centro_enemigo + direction * scaling_factor
###### THIS RECT THAT I WANT TO MODIFY THE PIVOT ########
draw_line = pygame.draw.line(main_screen, 'Pink', centro_enemigo, endpoint, 2) #linea principal
That's because i want the Rect collide whith others. But not like that:RECT from the Rect of the line