Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Animation.loop should be true by default for sprites #583

Closed
alanag13 opened this issue Apr 17, 2016 · 10 comments
Closed

Animation.loop should be true by default for sprites #583

alanag13 opened this issue Apr 17, 2016 · 10 comments
Labels
bug This issue describes undesirable, incorrect, or unexpected behavior good first issue good for people new to open source and Excalibur

Comments

@alanag13
Copy link
Member

Perhaps this could be up for debate, but I feel that in the majority of cases it is desirable for a sprite to loop indefinitely.

@jedeen jedeen added the bug This issue describes undesirable, incorrect, or unexpected behavior label Apr 24, 2016
@jedeen jedeen modified the milestone: vNext Apr 24, 2016
@jedeen jedeen modified the milestones: 0.10.0 Release, 0.11.0 Release Nov 29, 2016
@jedeen jedeen added the on-deck label Mar 16, 2017
@jedeen jedeen modified the milestones: 0.11.0 Release, vNext Mar 16, 2017
@kamranayub kamranayub added the good first issue good for people new to open source and Excalibur label Jun 13, 2017
@jedeen jedeen modified the milestones: Drawing, vNext Jun 27, 2017
@vritant24
Copy link
Contributor

Hi, I'd like to try this out.
Could I get some help with finding where I would start?

@kamranayub
Copy link
Member

Yes (we need to make sure we do this for jump in's, sorry).

Change this LOC to true:

https://github.com/excaliburjs/Excalibur/blob/master/src/engine/Drawing/Animation.ts#L43

Then verify this in a test. We don't yet have an AnimationSpec so you can create a new one (hooray!):

https://github.com/excaliburjs/Excalibur/tree/master/src/spec

Just need to verify by default animation.loop is true then when constructing a new animation.

Finally, update the Animations.md readme in the src/engine/docs folder with the new default info, as well as add a CHANGELOG entry.

That should be it. Thanks!

@vritant24
Copy link
Contributor

vritant24 commented Jun 28, 2017

Alright thanks for the steps. I've made the change to Animation.ts and added an AnimationSpec.ts where I wrote the the test.
How am I supposed to run the tests? When I run npm tests it gives me the error Cannot find name 'ex'. for all the specs

Edit - fixed this issue with npm run all

@vritant24
Copy link
Contributor

I have created the test, and it works. I cannot complete npm run all because another test fails.
Should I go ahead and make the pull request?

@kamranayub
Copy link
Member

kamranayub commented Jun 28, 2017 via email

@vritant24
Copy link
Contributor

The following test fails. I'm running this on Mac OSX, and i also tried it out in a branch that didn't have the changes I made. It still failed.

A label
X can measure text width
     Expected 332.0625 to be 335. (1)

@kamranayub
Copy link
Member

@jedeen was this test disabled in your recent PR? I thought we disabled all label tests for now...

@eonarheim
Copy link
Member

@vritant24 Ah, this must have been missed in f88fa2a Mac OSX will render font width differently than other platforms, hence the reason we've disabled those tests because of the heartache they cause.

Feel free to x the test xit('can measure text width') so that this font test doesn't run and submit a PR for the Animation fix.

@vritant24
Copy link
Contributor

Alright awesome. That fixed it.

@jedeen
Copy link
Member

jedeen commented Jun 28, 2017

@eonarheim Yeah, I only disabled tests that failed locally on the new update of Windows 10.

eonarheim pushed a commit that referenced this issue Jun 30, 2017
Closes #583 

Sprites in most cases should loop infinitely, so the default for Animation.loop should be true.

## Changes:

- Animation.loop set to true by default
- disabled `Label` test `can measure text width`
@jedeen jedeen modified the milestones: 0.12.0 Release, Drawing Jun 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue describes undesirable, incorrect, or unexpected behavior good first issue good for people new to open source and Excalibur
Projects
None yet
Development

No branches or pull requests

5 participants