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

Commit

Permalink
Put logic in condition animation and loop, and rename attr frame for …
Browse files Browse the repository at this point in the history
…currentFrame #44
  • Loading branch information
Guilherme committed Oct 26, 2016
1 parent 9eaa752 commit c07f9cd
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions dist/origami.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Date: 2016-10-23T15:49Z
* Date: 2016-10-26T03:41Z
*/

(function( window ) {
Expand Down Expand Up @@ -763,7 +763,7 @@ function SpriteShape(params) {

drawSprite.call(this, {
image: params.image,
posX: (properties.frame > 0 && properties.frame <= properties.frames ? (dw *(properties.frame -1)) : 0),
posX: (properties.currentFrame > 0 && properties.currentFrame <= properties.frames ? (dw *(properties.currentFrame -1)) : 0),
posY: 0,
frame: properties.frames,
loop: properties.loop,
Expand All @@ -774,16 +774,16 @@ function SpriteShape(params) {
dy: params.y,
speed: properties.speed,
update: null,
animation: properties.animation === true ? true : false,
loop: properties.loop === true ? true : false
animation: properties.animation,
loop: properties.loop
});
}

function drawSprite(sprite) {
var self = this;

if (sprite.posX === sprite.widthTotal) {
if (sprite.loop === false) {
if (!sprite.loop) {
window.cancelAnimationFrame(sprite.update);
return;
}
Expand Down
2 changes: 1 addition & 1 deletion dist/origami.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit c07f9cd

Please sign in to comment.