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

Ball speed calculation is wonky #5

Open
cogwheel opened this issue Jul 31, 2023 · 1 comment
Open

Ball speed calculation is wonky #5

cogwheel opened this issue Jul 31, 2023 · 1 comment
Labels
polish Make something nicer to use or look at

Comments

@cogwheel
Copy link
Owner

The ball moves a lot faster diagonally than orthogonally.

The ball_x_delta and ball_y_delta are both set to speed on game start. This means the actual distance covered per frame is sqrt(2) * speed.

When the ball hits a paddle, the ball delta perpendicular to the paddle is set to +/- speed. The ball delta parallel to the paddle is set to a value that only depends on where along the paddle the ball hit.

So after the first hit with the paddle, one component is always equal to speed and the other is unrelated to speed entirely.

This makes the movement erratic and unintuitive. Maybe should be a hard mode?

@cogwheel cogwheel added the polish Make something nicer to use or look at label Jul 31, 2023
@cogwheel
Copy link
Owner Author

cogwheel commented Jul 31, 2023

Partially addressed by 507f122

The ball starts out moving at the actual speed instead of sqrt(2) * speed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
polish Make something nicer to use or look at
Projects
None yet
Development

No branches or pull requests

1 participant