-
Notifications
You must be signed in to change notification settings - Fork 73
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]Enable ball jump, easy exit, two types of halting, and mass changing. #77
Open
chenzunh23
wants to merge
16
commits into
Yao-class-cpp-studio:main
Choose a base branch
from
chenzunh23:Naive_games
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
… of halting, and ball activities such as jumping, mass adjustments, etc.
Now I use termios.h and unistd.h to implement the password entering. But these two headers aren't available in windows. |
A brutal exit is prone to seg fault, I'm trying to fix this bug.,,,,,, |
chenzunh23
changed the title
[feat]Enable ball jump, easy exit, two types of halting, and mass changing.
[feat]Enable ball jump, easy exit, two types of halting, and mass changing.Close #17
Jan 18, 2024
chenzunh23
changed the title
[feat]Enable ball jump, easy exit, two types of halting, and mass changing.Close #17
[feat]Enable ball jump, easy exit, two types of halting, and mass changing.
Jan 18, 2024
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.
1.Ball jump can be achieved by pressing J, and the ball can jump if and only if it is resting on the block surface.
2.We can press ESC to exit the game freely. If the ball has mass larger than 2.0f, we can also exit with key E since it is very hard to move a high-mass ball.
3.Ball halting by pressing H, originally designed to let the player input his or her own password and lock the game, is incomplete, since I have not found an alternative to the "obsolete" header conio.h and obsolete function getch(). So I simply enabled restarting the game by pressing ENTER. The ball stopped by T, on the other hand, can be restarted by pressing T once again.
4.The player can lower the mass of the ball at will by repeatedly pressing 0, with each press deleting 10% of the mass. If the ball has mass smaller than 0.5f, it will be given two chances to return (press R) to its starting point since low-mass balls would fly off when colliding, making it easy to fall. Pressing R when the ball's mass is higher will make no difference, but this action also accounts for a chance to return.
The player can also increase the mass of the ball by 10% by pressing 1 in the supply base, i.e. inside a circle around the starting point of the sphere.
Close #82.