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

Sprite Sheet => frame count #1059

Merged
merged 2 commits into from Aug 28, 2014

Conversation

Projects
None yet
2 participants
@lucbloom
Copy link
Contributor

commented Jul 22, 2014

Instead of making a distinction between single frame images and Sprite
Sheets (images with more than one frame), I added a FrameData with one Frame to every image that
gets loaded. This way, some engine code & lots of game code can be simplified.

For instance, you can play animations on any Sprite without having to
check the “frame count” of its image anymore.

The engine doesn’t have to check for non-existing .frameData anymore.

An animation can keep on playing when an image happens to be set with 1
frame, continuing its animation and when after that another image is set
with multiple frames, it shows that animation.

Think of it this way: an image with one frame is an animation of just
one frame.

lucbloom added some commits Jul 22, 2014

Removed the notion of Sprite Sheets vs single frame images
Instead of making a distinction between single frame images and Sprite
Sheets, I added a simple FrameData with one Frame to every image that
gets loaded. This way, a lot of the engine code can be simplified.

For instance, you can play animations on any Sprite without having to
check the “frame count” of its image anymore.

The engine doesn’t have to check for non-existing .frameData anymore.

An animation can keep on playing when an image happens to be set with 1
frame, continuing its animation when after that, another image is set
with multiple frames.

Think of it this way: an image with one frame is an animation of just
one frame.

photonstorm added a commit that referenced this pull request Aug 28, 2014

@photonstorm photonstorm merged commit 7fe4abc into photonstorm:dev Aug 28, 2014

1 check passed

continuous-integration/travis-ci The Travis CI build passed
Details
@photonstorm

This comment has been minimized.

Copy link
Owner

commented Aug 28, 2014

A large change, but I like it - so merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.