Skip to content

Commit

Permalink
renamed mathods from pycollision.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul committed Aug 13, 2021
1 parent 077e4c1 commit c775c70
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This class is used to load images and detect collisions.
| init | img_path(str), split(tuple[int, int]), img_pos(tuple[int, int]), optimize(bool), optimize_padding(Tuple(int, int, int, int)) | The image specified must have a alpha channel else `ImageError` will be raised. `split` specifies how many rows and columns you would like to split the image into. `img_pos` specifies the current position(x, y) of the sprite. `optimize` makes sure only outer wall of the image is stored. Sometimes optimize doesn't do a good job specifying `optimize_padding` will correct it. (left, top, right, bottom)|
| setSpritePos | img_x(int), img_y(int) | sets the image position. You must use this method if the sprite is moving |
| point_collide | pos_x, pos_y, coll_pos( tuple[int, int]), offset(int) | Checks collision given pos_x, pos_y. Specify coll_pos if the sprite is moving, this will internally call setImagePos. Offset specifies how much distance from the collision rectangle before alerting collision. |
| smart_check | pos(tuple[int, int]) , coll_pos(Tuple[int, int]) ,offset(int) | Checks first the object is inside the bounding rectangle before calling the check_collision method, this can improve efficiency. All the parameters are same as mentioned above. |
| smart_check | pos(tuple[int, int]) , coll_pos(Tuple[int, int]) ,offset(int) | Checks first the object is inside the bounding rectangle before calling the `point_collide` method, this can improve efficiency. All the parameters are same as mentioned above. |
| rect_collide | rect(tuple[int, int, int, int]) , coll_pos(Tuple[int, int]) ,offset(int) | Use this if you want to check collision with a rectangular sprite, all the other parameters remains the same as above. |
| collision_points | - | returns collision rectangles |

Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

setup(
name='PyCollision',
version='0.0.1',
description="This library helps to detect collision for image with transparency. Useful in game development ",
version='0.0.2',
description="This library helps to detect collision for image with transparency. Useful for game development ",
license="MIT",
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down

0 comments on commit c775c70

Please sign in to comment.