-
-
Notifications
You must be signed in to change notification settings - Fork 218
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
Create snakegame.py #84
Conversation
White spaces removed.
Do I need to pass all the checks to successfully merge my file ? |
yes @SPM23 |
fix any one issue, the others will be fixed |
and please follow the Pull Request Template |
Snake/snakegame.py
Outdated
s.fill((255, 255, 255)) | ||
xs[i]=xs[i-1];ys[i]=ys[i-1];i-= 1 | ||
if dirs==0:ys[0]+= 20 | ||
elif dirs==1:xs[0]+= 20 |
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.
write the if statements in a new line instead of one single line.
it enhances readability of code
Snake/snakegame.py
Outdated
@@ -26,14 +26,12 @@ def die(screen, score): | |||
if xs[0] < 0 or xs[0] > 580 or ys[0] < 0 or ys[0] > 580: die(s, score) | |||
i = len(xs)-1 | |||
while i >= 1: | |||
xs[i] = xs[i-1];ys[i] = ys[i-1];i -= 1 |
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.
do in separate lines.
This is really not a good style
Reduced parameters of function collide.
Cannot remove the random number generator and nested if else as because of them the game is running smoothly. What should I do now ? |
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.
First of all this code needs to show some output.
It doesn't do anything in the present case
The game works well on my Laptop. @prateekiiest |
I guess, it will do good if you can put the output of your code in a separate readme file under the same folder. |
The output of the program is this. Now tell me what should I do get it merged. |
you need to fix the codacy/codeclimate issues first |
I don't know what to use in place of random function for the food of snake. |
I am approving this code |
Add my snake game written in python.