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

Refactor movement code. #18

Merged
merged 2 commits into from
Jan 28, 2024
Merged

Conversation

karnkaul
Copy link
Member

@karnkaul karnkaul commented Jan 28, 2024

Summary:

  • Format all modified files.
  • Use consistent casing for functions.
  • Use constants where warranted.
  • Store world_space in Player instead of App*.
  • Store Player in DogTales instead of optional<Player>.
  • Simplify bounce detection and resolution.

This also takes care of bouncing correctly when the window is resized.

Note: this PR does not target main but Jake/Movement+KeyInput.

- Format all modified files.
- Use consistent casing for functions.
- Use constants where warranted.
- Store `world_space` in `Player` instead of `App*`.
- Store `Player` in `DogTales` instead of `optional<Player>`.
- Simplify bounce detection and resolution.
@karnkaul karnkaul marked this pull request as ready for review January 28, 2024 12:24
@karnkaul karnkaul requested a review from Legac3e January 28, 2024 12:24
@Legac3e
Copy link
Contributor

Legac3e commented Jan 28, 2024

Thank you, all of these refactoring choices are great!

@Legac3e Legac3e merged commit e194205 into Jake/Movement+KeyInput Jan 28, 2024
2 checks passed
@Legac3e Legac3e deleted the karnage/movement-refactor branch January 28, 2024 23:39
Legac3e added a commit that referenced this pull request Jan 29, 2024
* Movement added to the player, wall collision detection added to the player, and the viewport is now set each frame

* Refactor movement code. (#18)

* Refactor movement code.

- Format all modified files.
- Use consistent casing for functions.
- Use constants where warranted.
- Store `world_space` in `Player` instead of `App*`.
- Store `Player` in `DogTales` instead of `optional<Player>`.
- Simplify bounce detection and resolution.

* Update comments.

---------

Co-authored-by: Karn Kaul <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants