Skip to content
This repository has been archived by the owner on Oct 26, 2021. It is now read-only.

ppizarror/pygame-toolbox

Repository files navigation

Pygame toolbox

Pygame toolbox

Toolbox for pygame

@ppizarror License GPL v3 Python 2.7

Toolbox for pygame, contains functions and classes to manipulate figures, points, sounds, etc.

File Description
centered_figure.py Create figure with a (x,y) center. Detects collision, and plots into pygame surface.

Usage

  • centered_figure

    triangle = CenteredFigure([(0, 0), (0, 1), (0, 3)], [10, 10])
    square = CenteredFigure([(0, 0), (0, 1), (1, 1), (1, 0)], [10, 10])
    
    triangle.collide(square) # true
    triangle.rotate(15)      # Rotate 15 grads Counterclockwise
    triangle.scale(10)       # Multiply 10 to all vertices position

Requirements

  • Pygame
  • Shapely
    • Windows users:
      Download Shapely whl and install it through pip.
    • Linux users:
      pip install shapely
    • OSX users:
      pip install shapely==1.6b2

License

This project is licensed under GPLv3 [https://www.gnu.org/licenses/gpl-3.0.html]

Author

Pablo Pizarro R. | 2017