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,864
26 votes
Accepted

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

Object Usage This code: ...
Jerry Coffin's user avatar
  • 33.5k
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,345
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

Snakes Game Using ncurses

if(b) return false; else return true; With the ! operator, you can negate a boolean value. So by ...
Pimgd's user avatar
  • 22.3k
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.2k
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,334
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,434
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,256
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.6k
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,056
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

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
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 ...
bazola's user avatar
  • 8,569
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
  • 21.6k
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.4k
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.4k
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.2k
7 votes
Accepted

Simple Snake Game

I don't know SFML at all, so very partial review. ...
Mat's user avatar
  • 3,005
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 ...
Martin York's user avatar
  • 94.6k
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 ...
Confettimaker's user avatar
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 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 ...
chux - Reinstate Monica's user avatar

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