47
votes
Beginner's snake game using PyGame
PEP 8
PEP 8 recommends that constants be written as "all capital letters with underscores separating words.". So something like:
yellow = (255, 255, 0)
Should ...
26
votes
Accepted
24
votes
Beginner's snake game using PyGame
In addition to another answer I will add these places to improve (I will not repeat all things from that answer, my answer is just an addition):
1. Code inconsistency
You have several places in your ...
24
votes
A Snake Game in C
You should keep your game loop as simple as possible with only an update and draw method and specifically in that order.
To ...
19
votes
Accepted
Snakes Game Using ncurses
if(b)
return false;
else
return true;
With the ! operator, you can negate a boolean value.
So by ...
19
votes
Accepted
OOP Snake Game C++
Never use using namespace std in header files
You should never write using namespace std in header files, as this can cause ...
17
votes
Accepted
Snake Game in C#
Just a few remarks. Reviewing bottom-up.
public class MultipleValuesDictionary<key, value>
Don't name classes dictionary if they aren't one (implementing ...
16
votes
Snake++ game (in C++ with SDL)
using namespace std; is a bad practice. I'm glad to see you didn't use it in the header. Better still to not to use it at all. Please see this post for more ...
14
votes
Snake Game in C#
I sense that you think too much about SOLID, padawon. You need to think about what the game IS, and the things that ARE. Objects do things. What they do defines what they are. Properties capture the ...
11
votes
Accepted
Console snake game in C#
Well, this is my first code review and by no means I'm an C# expert or something like that, but anyways I'd like to give a general opinion about your code.
First and foremost, you're using C# which ...
10
votes
Snake Game in C#
Beyond the SOLID principles, think about your classes and methods. Classes/objects are things that exist, methods are things they do. So when naming them, class names should be nouns, methods should ...
10
votes
Beginner's snake game using PyGame
size: int
...
self.size = 2
You never read size, and Python Lists already know their own length in case you did need ...
10
votes
A Snake Game in C
Enums
In the code s is used to indicate the movement direction. From the code it's not easy to tell what s or ...
9
votes
Snake++ game (in C++ with SDL)
Some additional points:
Avoid "God classes". Your Game class does absolutely everything. This makes it hard to see which member variables are used where, and is ...
9
votes
Accepted
My first C++ game (snake console game)
First of all congratulations for this little entertaining console game.
It is simple but entertaining. I felt like I was back in the old mobile games era.
I don't have the time to rewrite all of the ...
8
votes
Accepted
Java Snake game
Welcome to Code Review! There's lots that can be improved about this code, so lets get started.
Use the Random class instead of Math.random()
Instead of this
...
8
votes
First C# program (Snake game)
Ok so this is very cool code. I learned a lot looking at it myself. However, there is room for improvement. (When isn't there?) I wrote down the comments below while looking though your code and ...
8
votes
Accepted
Python! (Snake)
I'm not really the best at reviewing code (I have my own failures in coding too), but I have a few things that I'd like to point out and share.
Consider setting up the new ...
8
votes
Accepted
Snake on a Plane
Code review
I like the name "Snake on a plane" and was hoping to see some wings and the like. Maybe that's to come.
Not bad if this is your first game. I have gone over it from top to bottom and ...
8
votes
SFML snake game in C++
Here are some things that may help you improve your code.
Don't declare enum const
In ...
8
votes
Improved snake game in SFML (C++)
Your program is definitely improved over the last version. Good job! Here are some ideas for you about further improvements.
Make the object interface easy for the user
The ...
7
votes
Accepted
7
votes
Accepted
ASCII-based snake game in C++
Oh boy! A snake game. I'm excited, since this was also one of my first games. So let's get to work, shall we?
Keep it short and simple
The biggest concern with your code gets obvious if we just have ...
7
votes
Snake in JavaFX
A few recommendations per class:
Food.java
What's the point in this class? It just's just a Point with a constant colour. I would just have a FOOD_COLOUR constant ...
7
votes
First Python program: Snake
For efficiency reasons, you should always do x1**2 + y1**2 < r**2 rather than sqrt(x1**2 + y1**2) < r, because ...
7
votes
My first C++ game (snake console game)
You include the modern random.
#include <random>
But in your code you use the old srand() and ...
6
votes
First C# program (Snake game)
First up:
Good job on this game. Your logic is good. Yes, there are some improvements in the code and so on, and all of the above comments are spot on, so I'm not going to hammer on the same points.
...
6
votes
Snake game in C for Linux console
Minor
Only small things to add to the other 2 posts
Incomplete declaration. A declaration without parameters conveys no information about the parameters. Thus a call to ...
6
votes
First HTML5 game: Snake
You did really well with readability and documentation. On the design side, I would personally have the score off to the side and not in the middle, although it isn't that big of a deal. I would also ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
snake-game × 169c++ × 46
game × 46
beginner × 42
python × 41
object-oriented × 30
javascript × 29
pygame × 24
console × 19
python-3.x × 18
java × 16
canvas × 12
c# × 11
c × 11
sfml × 11
performance × 9
windows × 9
ecmascript-6 × 6
curses × 6
javafx × 5
design-patterns × 4
css × 4
rust × 4
html5 × 4
swing × 4