Coder Profile - Show off your skills, get a coder profile.
 
 
 
The Author
fbalden
Francis Balden
Send A Message
Screenshot
View Full Size
polypy.jpg ( 0.01Mb )
Rating
7.00
out of 10
( 2 Ratings )
Please login to rate source codes.

Click here to register a free account with us.
General Details
Python
Posted 71 Days Ago
153 Views
Received 2 Ratings
More Codes By This Author
Python Polygons ("PolyPy"...

Python Polygons ("PolyPy")


Description
A regular polygon class, which I wrote for a physics engine I'm working on.

Define a polygon like so:

p = polygon.Polygon((xpos, ypos), radius, faces, (r,g,b), pygame_surface)

A blue hexagon with a radius of 10 at (10, 10) on 'screen':

p = polygon.Polygon((10, 10), 10, 6, (0,0,255), screen)

Gather the points of, and draw the polygon like so:

p.gather()
p.draw()
Technical
Requires pygame: http://pygame.org
Source Code
Download Download Source Code
polypy.zip ( 0.00Mb )
NEVER open a .exe, .bat, .cmd, or other executable file since that is where viruses are likely to live. Please virus scan all files you download.
Comments
Please login to post comments.
Page 1 of 1
More "Python" Source Codes By This Author
Recently Posted "Python" Source Codes
Recently Rated "Python" Source Codes
 
 
Part of the MyPingle Network
Development Blog :: Make A Donation :: Contact Me
Terms & Conditions :: Privacy Policy :: Documents
Version 1.44.00
Copyright © 2007 - 2008, Scott Thompson, All Rights Reserved