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]Enable ball jump, easy exit, two types of halting, and mass changing. #77

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

Conversation

chenzunh23
Copy link

@chenzunh23 chenzunh23 commented Jan 16, 2024

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.

@chenzunh23
Copy link
Author

Now I use termios.h and unistd.h to implement the password entering. But these two headers aren't available in windows.

@chenzunh23
Copy link
Author

A brutal exit is prone to seg fault, I'm trying to fix this bug.,,,,,,

@chenzunh23 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 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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feat]Brutal exits are subject to seg-fault.
1 participant