Skip to content

reddit-pygame/map-distance-challenge

Repository files navigation

#Map Distance Challenge

This challenge focuses on using Pygame's different event types to drag a measuring line between two points on a map. The code provided allows the user to select from a menu of six regional world maps and displays the map on the screen, the rest is up to you.

##Reddit Challenge thread: https://www.reddit.com/r/pygame/comments/3oc19d/map_distance_challenge/

#Challenge

Allow the user to drag a line between two points on a map and display the map distance between those two points. You will need to calculate the distance of the line in pixels then convert it to miles. There is a dict, SCALES, in prepare.py that contains the scale factor for each map: distance in pixels * scale = distance in miles.

#Achievements

Screw the Imperialists - Display the distance in kilometers

End of the Rainbow - Make the distance line change color depending on its length

Connect the Dots - Allow the user to set multiple waypoints and display the total distance (this will probably entail clicking to place each waypoint rather than dragging)

About

Challenge for r/pygame

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages