2D top-down camera example
This PR addresses the 2D part of #12658. I plan to separate the examples and make one PR per camera example.
Objective
- Top-down camera movements towards the player with smoothing
What I implemented
- [x] Player keyboard movements
- [x] Colors and bloom effect to see the movement of the player
- [x] Camera smooth movement towards the player (lerp)
Welcome, new contributor!
Please make sure you've read our contributing guide and we look forward to reviewing your pull request shortly ✨
The generated examples/README.md is out of sync with the example metadata in Cargo.toml or the example readme template. Please run cargo run -p build-templated-pages -- update examples to update it, and commit the file change.
The generated examples/README.md is out of sync with the example metadata in Cargo.toml or the example readme template. Please run cargo run -p build-templated-pages -- update examples to update it, and commit the file change.
The generated examples/README.md is out of sync with the example metadata in Cargo.toml or the example readme template. Please run cargo run -p build-templated-pages -- update examples to update it, and commit the file change.
@alice-i-cecile I decided to go with different PRs for the different examples. But if you prefer multiple ones in the same PR let me know.
I kept a simple scope for this one - should be straightforward. I wanted to add more like bounded camera but I don't think it would serve the purpose of the example. If you think it's valuable here I can add it.
Multiple small examples is perfect, thank you!
To help other reviewers, you might also consider including a video of the example in the PR description. Check the latest PR template, it has a "Testing" section.
Thanks for the review!
Regarding the video, I don't think it's easy for contributors to maintain the video through changes and it can be outdated at some point. Also it adds extra steps, you need tools to capture gif etc... maybe not ideal for everyone. Also I tried to add a gif but the file needs to be less than 10MB. My file is more than the max, I decided to not attach the gif. I added the cargo run command.
I'll send code changes soon.
Ok finally found a way to make lighter mp4 records - I attached the record to the PR. If it can provide a good example for other contributions. I think I've addressed all the comments from last review. Should I squash my commits into one? I also rebased on main
Don't worry about squashing, and thanks for the video! I'm happy with this, barring the complaints about the debug statements. Once those are removed you'll have my approval (and then we just need to find a second reviewer).
Thanks everyone for the reviews! I Learned a lot through this small example ✌️.