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

SlimeVolley initial ball velocity is incorrect #76

Open
lowrollr opened this issue Mar 2, 2024 · 0 comments
Open

SlimeVolley initial ball velocity is incorrect #76

lowrollr opened this issue Mar 2, 2024 · 0 comments

Comments

@lowrollr
Copy link

lowrollr commented Mar 2, 2024

Small issue with game state initialization:

def get_random_ball_v(key: jnp.ndarray):
result = random.uniform(key, shape=(2,)) * 2 - 1
ball_vx = result[1]*20
ball_vy = result[2]*7.5+17.5
return ball_vx, ball_vy

result[2] is out of bounds, which means it accesses the same value as result[1] -- and therefore ball_vx and ball_vy depend on the same value. This means the ball has higher y-vel when x-vel is positive, so the ball will be thrown higher to one player compared to the other.

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

No branches or pull requests

1 participant