kikito / anim8

An animation library for LÖVE
MIT License
730 stars 88 forks source link

Two new functions #17

Closed CesarNoll closed 8 years ago

CesarNoll commented 8 years ago

I added two new functions to check if the animation is flipped horizontally or vertically in a pretty way. Useful when you have a list of animations and you want to check if the animation is flipped. I also updated the documentation.

kikito commented 8 years ago

Hi, thanks for taking the time to send this PR. However, I will not accept it. There are several reasons.

First, the two methods you implemented can be implemented by simply calling animation.flippedH or animation.flippedV. In Lua, this isn't "less pretty" than calling methods (and it is a bit faster, but that's secondary). I also don't want to encourage this behavior by giving it a name - see third reason below.

Second, anim8 animations are coded so that they behave as expected even when they are flipped. If you find a case in which they are flipped which needs special handling, that means that there is a problem in anim8. (Please open an issue if you found such case)

Finally, if at some point the user needs to check if the animation is flipped, it means that he's storing game information in the animation itself. While this is possible, it is not desirable; the user should already know this information because of some other variable in his game objects. For example: if the users wants to know if the player is looking to the left, he should not be checking player.anim.flippedH. Instead he should be checking something like player.direction == 'right'.

Animations are "presentation things", like images. They should not be overloaded with "game information".

For all of the above, while I really appreciate that you took the time to send this PR, I must reject it. Please don't let this discourage you from sending me other pull requests in the future.