Asteroids Game with Python Turtle

Develop the Asteroids Game with Python Turtle. Because this project is fairly large, you may want to use Object Oriented Programming by defining several classes and put them in separate files. You may also need to know how to detect collisions. These projects will help you develop this game:

You can also add music and sound effects to this game with PyGame’s sound library.

Closest Point On a Line Segment to Another Point

Write a program that finds the closest point of a line segment to another point. Randomly pick a point and color it in blue. Also, randomly generate several lines. Find the closest points on these lines to the blue point and mark these closest points in red as show in the picture below:

Closest Point On a Line Segment to the Blue Point

What’s next?
Intersecting Lines with a Circle

Two Randomly Moving Intersecting Lines

Continue from a previous project with one moving line, and knowing how to detect if two lines intersect, animate two randomly moving lines. When these two lines intersect, color the the line in green. Knowing the orientation of triangles may help you solve this problem.

Triangle Orientation with Python Turtle

Given three ordered points (red, green, blue) of a triangle, the orientation of the triangle is clockwise if a right turn happens from the first line (red to green) to the second line (green to blue). Similarly the orientation of the triangle is counterclockwise if a left turn happens from the first line (red to green) to the second line (green to blue).

Draw many random triangles and color triangle in yellow if the triangle is clockwise, color triangle in cyan if the triangle is counterclockwise.

Triangle Orientation with Python Turtle

What’s next?
Random Intersecting Lines with Python Turtle
Two Randomly Moving Intersecting Lines