-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Overlap game #90
base: master
Are you sure you want to change the base?
Overlap game #90
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried playing the game but it wasn't clear what the goal is.
I also think there may be some bugs. Try playing the game more and adding tests (as the other games have).
freegames/overlap.py
Outdated
top_size = {0: 300, 1: 200} | ||
|
||
|
||
def rectangle_top(x, y, size): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use a more descriptive name. What does "top" mean?
freegames/overlap.py
Outdated
left(90) | ||
|
||
|
||
def rectangle_move(x, y, size): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactor the repeated code between rectangle_move
and rectangle_top
freegames/overlap.py
Outdated
top = {0: vector(0, 0)} | ||
top_size = {0: 300, 1: 200} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should these be dictionaries or lists? Seems like only the last value is ever deleted.
freegames/overlap.py
Outdated
if top[len(top) - 1].x - top_size[len(top) - 1] / 2 < top[len(top) - 2].x - top_size[len(top) - 2] / 2 or \ | ||
top[len(top) - 1].y - top_size[len(top) - 1] / 2 < top[len(top) - 2].y - top_size[len(top) - 2] / 2 or \ | ||
top[len(top) - 1].x + top_size[len(top) - 1] / 2 > top[len(top) - 2].x + top_size[len(top) - 2] / 2 or \ | ||
top[len(top) - 1].y + top_size[len(top) - 1] / 2 > top[len(top) - 2].y + top_size[len(top) - 2] / 2: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This expression is much too complex. Break these lines into separate parts/variables.
Also, the use of backslash in Python code should be discouraged. Break long lines into more readable parts and use parens instead only if you must.
Changes:
Thank you very much for feedback. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I posted the second game incorrectly here.
Sorry for the confusion.
Can you record a video of you playing the game and share it? I tried playing it again but a black square just flickers up and down. I don't get it. |
Overlap game is a game of fitting a moving square to a fixed square frame.
If you succeed in this mission, your score will go up.
The square and square frame get smaller and smaller.
I'd appreciate it if you could give me a feed. thanks