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
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
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
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
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 ...
8
votes
Accepted
Play Snake Game on Mac OS Terminal using C with ncurses Library
It works on more than just MacOS
Congratulations, you have written code that compiles just fine on Linux as well, and probably works on every other UNIX-like operating system. However, that's just ...
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 small project - Snake in C
As a complement to JS1's already good review, here are some things that may help you improve your code.
Fix the bug
The code currently includes this:
...
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 with ncurses in C
Your render function could be re-written as constants, shows that the snake is not changed by this function. e.g.
...
6
votes
Accepted
Xaml Wpf Snake game
I'm going to review only the code in your post.
You don't use WPF as you have to. In WPF you don't need to perform clear/draw sequence. The right way is to use MVVM and update coordinates of the ...
6
votes
Accepted
Javascript Snake
Worst use of linked list, ever!
Linked list are convenient for many reasons, one of them is fast splicing, much faster than array splicing and thus the best option when you are often inserting and ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
snake-game × 169c++ × 48
game × 45
beginner × 42
python × 40
object-oriented × 30
javascript × 29
pygame × 23
console × 21
python-3.x × 18
java × 16
canvas × 12
c# × 11
c × 11
sfml × 11
windows × 9
performance × 8
ecmascript-6 × 6
curses × 6
javafx × 5
design-patterns × 4
css × 4
rust × 4
swing × 4
html5 × 4