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
feat: adding flutter mini sprite #40
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some small comments, but otherwise lgtm!
@@ -4,6 +4,8 @@ | |||
<modules> | |||
<module fileurl="file://$PROJECT_DIR$/packages/flame_mini_sprite/example/melos_example.iml" filepath="$PROJECT_DIR$/packages/flame_mini_sprite/example/melos_example.iml" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file shouldn't be committed
|
||
for (var y = 0; y < sprite.pixels.length; y++) { | ||
for (var x = 0; x < sprite.pixels[y].length; x++) { | ||
if (sprite.pixels[y][x] != -1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are the X and Y axis flipped? π€
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wouldn't consider it flipped because that is by design haha
I find it more natural to keep the vertical axis as the first dimension of the matrix, when projecting it to the plane, the positions are just as they are declared.
I am open to discussing this more if you feel otherwise though, but we should do that on a different PR :)
@@ -0,0 +1,160 @@ | |||
# Generated by pub | |||
# See https://dart.dev/tools/pub/glossary#lockfile |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file shouldn't be checked in for the lib
Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com>
Description
Adding the flutter mini sprite package.
Type of Change