-
Notifications
You must be signed in to change notification settings - Fork 23
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
Use point struct as position #28
base: main
Are you sure you want to change the base?
Use point struct as position #28
Conversation
7292da5
to
dd89316
Compare
Note: code compiles, but I still need to flash and validate everything is still fine. |
Wouldn't it be better to use |
At the time I wrote the original code (many years ago 🤣 ), image.Point was causing some compilation errors, that should have been fixed by now, but, image.Point uses |
I cannot say I had thought this through as I didn't know about |
@@ -29,6 +29,11 @@ const ( | |||
HEIGHTBLOCKS = 13 | |||
) | |||
|
|||
type Point struct { |
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.
For history of this structure, it could be nice to have a comment explaining why we are not using image.Point using the comment from @conejoninja.
type Point struct { | |
// Point is a custom type defining a point with x, y coordinates as int16 like the display coordinates. | |
type Point struct { |
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 will add the comment.
This PR intend is to improve code readability.
I introduce Point type that handle x and y value for an element (snake body, apple)
I hope it does bring more readability to the code.