Skip to main content
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 ...
Dair's user avatar
  • 5,906
26 votes
Accepted

Snake++ game (in C++ with SDL)

Object Usage This code: ...
Jerry Coffin's user avatar
  • 33.6k
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 ...
vurmux's user avatar
  • 1,355
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 ...
kemicofa ghost's user avatar
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 ...
G. Sliepen's user avatar
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 ...
t3chb0t's user avatar
  • 44.3k
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 ...
Summer's user avatar
  • 2,330
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 ...
radarbob's user avatar
  • 7,744
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 ...
Xam's user avatar
  • 365
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 ...
Seth R's user avatar
  • 209
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 ...
Peter Cordes's user avatar
  • 3,346
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 ...
Lau G's user avatar
  • 218
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 ...
user673679's user avatar
  • 11.8k
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 ...
Sandro4912's user avatar
  • 3,074
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 ...
Thomas Ward's user avatar
  • 2,518
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 ...
asibahi's user avatar
  • 927
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 ...
Blindman67's user avatar
  • 22.3k
8 votes

SFML snake game in C++

Here are some things that may help you improve your code. Don't declare enum const In ...
Edward's user avatar
  • 66.5k
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 ...
Edward's user avatar
  • 66.5k
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 ...
G. Sliepen's user avatar
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 ...
Zeta's user avatar
  • 19.3k
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 ...
Michael's user avatar
  • 778
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 ...
Benoît P's user avatar
  • 799
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 ...
Loki Astari's user avatar
  • 95.7k
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: ...
Edward's user avatar
  • 66.5k
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. ...
Steven Oberholzer's user avatar
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. ...
B. Wolf's user avatar
  • 161
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 ...
Maxim's user avatar
  • 2,542
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 ...
Blindman67's user avatar
  • 22.3k

Only top scored, non community-wiki answers of a minimum length are eligible