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

feat/stars #27

Merged
merged 10 commits into from
Oct 4, 2023
Merged

feat/stars #27

merged 10 commits into from
Oct 4, 2023

Conversation

thombruce
Copy link
Owner

closes #25

By submitting this pull request, you agree to follow our Code of Conduct: https://github.com/thombruce/.github/blob/main/CODE_OF_CONDUCT.md


Internal use. Do not delete.

  • Tests passing
  • Coverage sufficient
  • Manual review
  • No A11y regression
  • Translations provided or not needed

This was referenced Oct 3, 2023
@thombruce
Copy link
Owner Author

We have circular orbits that will have different orbital periods dependent upon the distance from the parent star.

That's enough to call this good enough for now.

In theory, I know how to implement Kepler orbits, but we might want to shift focus towards generating more than just the two planets we can do right now (maybe by porting Deep-Fold's Pixel Planet Generator and associated shaders to Bevy).

Implementing Kepler orbits would require knowledge about the planet's apoapsis and periapsis or its semi-major axis which can be derived from those. These are extra values to generate. I believe we also need knowledge of the central body's mass, though I am unsure of this.

Happy to plough forwards into different waters and circle back. There is an open issue for Kepler Orbits here: #28

@thombruce
Copy link
Owner Author

Actually, there is a major problem that needs to be resolved before merging.

Because the position in an orbit is calculated for a given real value of time, when the player pauses for any length of time and then unpauses the planet will jump forwards in its orbit.

We need to setup a different timer. One that takes into account the pausing and unpausing.

@thombruce
Copy link
Owner Author

This might be outdated, but the way to do this as of 0.9 was to create a stopwatch I think. Reference here: https://bevy-cheatbook.github.io/features/time.html#stopwatch

The stopwatch counts up from some time value that we could save and load ("game time") and needs to be manually ticked in an update function. Manual ticking means we can opt to manually not tick too, e.g. when in the pause state.

That's what we need to implement. A game_time system ticking a stopwatch which we can reference to get the time ticked in an unpaused state since game start.

That should do it.

@thombruce
Copy link
Owner Author

Yup, 4af11b8, that's fixed it!

@thombruce thombruce merged commit 327c27d into main Oct 4, 2023
@thombruce thombruce deleted the feat/stars branch October 4, 2023 11:56
@thombruce thombruce mentioned this pull request Oct 5, 2023
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.

Stars
1 participant