[Merged by Bors] - Improve many sprites example - #2785
Closed
willolisp wants to merge 4 commits into
Closed
Conversation
alice-i-cecile
approved these changes
Sep 8, 2021
This was referenced Sep 8, 2021
Member
Contributor
|
I disagree with the addition of the _system postfix, but other than that it looks good |
Sheepyhead
approved these changes
Sep 8, 2021
IceSentry
approved these changes
Sep 8, 2021
IceSentry
left a comment
Contributor
There was a problem hiding this comment.
While I'm not opposed to anything here, I would prefer not using unwrap() in example code, but it's still good without.
Member
|
bors r+ |
bors Bot
pushed a commit
that referenced
this pull request
Sep 10, 2021
# Objective My attempt at fixing #2075 . This is my very first contribution to this repo. Also, I'm very new to both Rust and bevy, so any feedback is *deeply* appreciated. ## Solution - Changed `move_camera_system` so it only targets the camera entity. My approach here differs from the one used in the [cheatbook](https://bevy-cheatbook.github.io/cookbook/cursor2world.html?highlight=maincamera#2d-games) (in which a marker component is used to track the camera), so please, let me know which of them is more idiomatic. - `move_camera_system` does not require both `Position` and `Transform` anymore (I used `rotate` for rotating the `Transform` in place, but couldn't find an equivalent `translate` method). - Changed `tick_system` so it only targets the timer entity. - Sprites are now spawned via a single `spawn_batch` instead of multiple `spawn`s.
|
Build failed: |
Member
|
bors retry |
bors Bot
pushed a commit
that referenced
this pull request
Sep 10, 2021
# Objective My attempt at fixing #2075 . This is my very first contribution to this repo. Also, I'm very new to both Rust and bevy, so any feedback is *deeply* appreciated. ## Solution - Changed `move_camera_system` so it only targets the camera entity. My approach here differs from the one used in the [cheatbook](https://bevy-cheatbook.github.io/cookbook/cursor2world.html?highlight=maincamera#2d-games) (in which a marker component is used to track the camera), so please, let me know which of them is more idiomatic. - `move_camera_system` does not require both `Position` and `Transform` anymore (I used `rotate` for rotating the `Transform` in place, but couldn't find an equivalent `translate` method). - Changed `tick_system` so it only targets the timer entity. - Sprites are now spawned via a single `spawn_batch` instead of multiple `spawn`s.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Objective
My attempt at fixing #2075 .
This is my very first contribution to this repo. Also, I'm very new to both Rust and bevy, so any feedback is deeply appreciated.
Solution
move_camera_systemso it only targets the camera entity. My approach here differs from the one used in the cheatbook (in which a marker component is used to track the camera), so please, let me know which of them is more idiomatic.move_camera_systemdoes not require bothPositionandTransformanymore (I usedrotatefor rotating theTransformin place, but couldn't find an equivalenttranslatemethod).tick_systemso it only targets the timer entity.spawn_batchinstead of multiplespawns.