Help with physics in Pygame
Project description
This project is to help with creating physics with Pygame Knowledge of Pygame is still required
This package contains 2 modules: Collisions and Physics, you only need to worry about the physics module
init function: • This function is for creating the object. You can not use this package if you create your own Pygame rect object • Args- x of object, y of object, width, height, color, the window object that you would like the object to be placed on, velocity of object (Cannot be changed later on)
setDimensions function: • Args- windowWidth, windowHeight
move function: • Moves the object in the direction specified (up, down, left, right) • Args- velocity, direction
setGravity function: • Sets the gravity for the different axis • Args- x gravity, y gravity
keepInBounds function: • Keeps the object in the bounds of the screen (Called in the update function)
update function: • Updates all of the objects' gravity and does collision resolution • Args- A list of all of the objects
processCollisions functions: • Handles collision resolution • Args- A list of all of the objects
draw function: • Draws the object on the window specified in the init function
jump function: • Makes the object jump • Args- jump power, object_list (This can be left with a None value, it is not used
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for PygamePhysics-0.0.1-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 10a7a1e9cc1260e676c95bbc6ca898bfd2e8d660d69552796f91bb0ef3e167d4 |
|
MD5 | 1f1adf4f490665a80a49b13f2971334b |
|
BLAKE2b-256 | 02c8da7818a3589ef2b1c21c9264cbabab5965c641d6331c5d9d2d968bbb6b2d |