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

Game::Game random_w & random_h has bug #4

Closed
derekgui opened this issue Aug 20, 2019 · 1 comment
Closed

Game::Game random_w & random_h has bug #4

derekgui opened this issue Aug 20, 2019 · 1 comment

Comments

@derekgui
Copy link

Your random_w should be 0 to screen_width/grid_width and random_h should be 0 to
screen_height/grid_height. Otherwise, you will place food out of screen sometimes.

  random_w(0, static_cast<int>(screen_width/grid_width)),
  random_h(0, static_cast<int>(screen_width/grid_height)
@SudKul
Copy link
Contributor

SudKul commented Mar 23, 2021

Hi @derekgui
Thank you, for flagging this issue.
It has been resolved in this PR
Wishes.

@SudKul SudKul closed this as completed Mar 23, 2021
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

2 participants