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] Acceleration and Flipping Gravity #100

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

blunt-axe
Copy link

New keys are added:
[x]: The ball rotation has 1.5x acceleration when holding
[c]: Flip the ball's gravity

@blunt-axe blunt-axe closed this Jan 19, 2024
@blunt-axe blunt-axe reopened this Jan 19, 2024
@blunt-axe
Copy link
Author

However, my implementation for flipping gravity has some limitations.

The "glfwGetKey" function is rarely consecutive when holding a key. So, for every rigid body (src/GameX/physics/rigid_body.h), I choose to ignore the "flip gravity" signals which are too close to the last signal (precisely, less than 1/8 seconds). And I added a variable in every rigid body, representing the time lapsed since the last "flip gravity" input.

If there are better implementations, you may replace this one.

1 similar comment
@blunt-axe
Copy link
Author

However, my implementation for flipping gravity has some limitations.

The "glfwGetKey" function is rarely consecutive when holding a key. So, for every rigid body (src/GameX/physics/rigid_body.h), I choose to ignore the "flip gravity" signals which are too close to the last signal (precisely, less than 1/8 seconds). And I added a variable in every rigid body, representing the time lapsed since the last "flip gravity" input.

If there are better implementations, you may replace this one.

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.

1 participant