Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

README.md

Vector2

Red lines are always directed to mouse and they always have the same length.

length = 100

mouse = pygame.mouse.get_pos()

start = pygame.math.Vector2(x, y)

end = start + (mouse - start).normalize() * length

pygame.draw.line(screen, RED, start, end)

direction.py

#1

direction-many-lines-1.py

#2

direction-many-lines.py

#3