Skip to main content
26 votes
Accepted

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

Object Usage This code: ...
Jerry Coffin's user avatar
  • 34.1k
24 votes
Accepted

2048 with GUI in C

Well done. This is not a complete review, but instead a (short) list of possible improvements I found when I skimmed your code. Documentation First of all: thank you! It's great to have ...
Zeta's user avatar
  • 19.7k
22 votes

Chess engine for chess without checks in C++

Here are some things that may help you improve your code. Don't const qualify POD return values The code includes this member function within ...
Edward's user avatar
  • 67.2k
21 votes
Accepted

Pong game using SDL

Implementation Is it necessary to put the whole game execution into the Game constructor? (This will cause problems if you ever decide to inherit from ...
hoffmale's user avatar
  • 6,528
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,360
16 votes

A Pong Game using C++

Overall Observations If I were a teacher I would give you an A+ for effort and about a B- for implementation. From a design point of view try to separate the logic of the game as much as possible from ...
pacmaninbw's user avatar
  • 26.1k
14 votes
Accepted

Sorting algorithm visualizer in C++ and SDL2

In all, this is a nice program. In particular, it compiled and ran (almost) flawlessly on Linux, so keep up the good work on portability! Here are some things that may help you improve your program. ...
Edward's user avatar
  • 67.2k
13 votes
Accepted

SDL/C++ High-Low Guessing Game

Definitely not bad for a first attempt! Let's start at the top. ...
indi's user avatar
  • 16.5k
11 votes

Chess engine for chess without checks in C++

The answers so far are good critiques of the code at a technical level, but optimizing performance of a chess engine is a separate topic. Without aggressive optimizations at the algorithmic level you ...
james's user avatar
  • 211
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 one ...
user673679's user avatar
  • 12.2k
9 votes

Chess engine for chess without checks in C++

Note: this is just a review of graphics.h and graphics.cpp. Apply RAII consistently I see you used ...
G. Sliepen's user avatar
  • 69.3k
8 votes
Accepted

SDL2.0 Conway's Game Of Life

Turn your warnings on! I would always compile with -Wall -Wextra -pedantic -pedantic-errors :) Let's go through them: ...
Rakete1111's user avatar
  • 2,582
8 votes
Accepted

Conway's Game of Life in C

General Observations Initially I was very impressed because the file started with the declaration of 2 enums. All of the functions seem to follow the single responsibility principle and that is great! ...
pacmaninbw's user avatar
  • 26.1k
8 votes

Conway's Game of Life in C

Reduce number of tests. An if in the tight loop is a performance killer. Since you test for cells[x][y].alive in ...
vnp's user avatar
  • 58.7k
8 votes
Accepted

Modular synthesizer framework for C++

This was fun code to play with and to review. I haven't played with a modular synth for about forty years. Here are some things that may help you improve your code. Consider hiding data Right now ...
Edward's user avatar
  • 67.2k
7 votes
Accepted

Simple game loop using SDL

Design Single Responsibility Principle (SRP) Your current design, while serving its purpose, is rather restricted regarding future development. Game is trying to do ...
hoffmale's user avatar
  • 6,528
7 votes

Chess engine for chess without checks in C++

Use the single responsibility principle. Your board class stores a board state, evaluates it, runs the AI, provides a scoring function, stores game state, does profiling, supports undo, handles mouse ...
Yakk's user avatar
  • 1,030
6 votes
Accepted

Pausable Timer Implementation for SDL in C

I don't see too much that I feel like complaining about. Standard Types In timer.h, you use Uint32. This is not a standard type. It comes from SDL, which in turn ...
Reinderien's user avatar
  • 71.1k
6 votes
Accepted

Simple C++ SDL2 Wrapper for small game

Wrapping SDL_Surface like this to get automatic cleanup in the destructor is a good idea. However, the current implementation makes a few assumptions that aren't necessarily correct. Surface Creation ...
user673679's user avatar
  • 12.2k
6 votes

Pong game using SDL

In addition to hoffmale's answer. Don't use underscores to to prefix variable as you risk naming collisions. If you wish to prefix member variables m_ is widely ...
Wes Toleman's user avatar
5 votes

Fluid Simulation with SDL

I won't comment on the things you already mentioned you are planning to implement in the future, except that as Ilya Popov already said, you can use ...
G. Sliepen's user avatar
  • 69.3k
5 votes

Pausable Timer Implementation for SDL in C

Update After further usage, I did discover one issue with regard to usability. Once a Timer instance has been cancelled, it is no longer valid and should not be ...
Mark Benningfield's user avatar
5 votes

SDL Simple Wrapper Library

Things that you can do differently I don't think there is anything wrong with how you implemented the deleters, but there are two alternatives you could consider. First, you can create custom ...
G. Sliepen's user avatar
  • 69.3k
4 votes

2048 with GUI in C

Since the other reviews have already hit most points, I'll just mention a few not already covered. Avoid relative paths in #includes Generally it's better to ...
Edward's user avatar
  • 67.2k
4 votes
Accepted

TTF/SDL based class for text handling

Code: Prefix the header guard with something unique (at least to the project) to prevent possible collisions. (e.g. MYPROJNAME_TEXT_H ). ...
user673679's user avatar
  • 12.2k
4 votes

C++/SDL2 Tic-Tac-Toe

But because the copy function for the LTexture class was deleted I would just get an error about referencing a deleted function. This resulted in me using the default copy function. Right now your ...
Ryper's user avatar
  • 176
4 votes

Simple C++ SDL2 Wrapper for small game

#pragma once Be aware that you are giving up portability here as this is, while common, a non-standard compiler extension. For nearly all applications, as long as ...
Snowhawk's user avatar
  • 6,770
4 votes

SDL Simple Wrapper Library

Design review Wrapping SDL is not only a good idea, it is a great practice project for learning SDL and C++. Your take on it is unique and interesting, and might make for an interesting challenge, but ...
indi's user avatar
  • 16.5k
4 votes
Accepted

SDL3 Thread pool for fast cross-platform data parallelism

Allocate to the referenced object, not to the type. A style issue, yet one that is easier to code right, review and maintain. Rather than ...
chux's user avatar
  • 36.4k
3 votes
Accepted

C++ and SDL2: Snake implementation

This is pretty cool! Looks like a lot of fun. 🙂 I think your instincts are right about separating out the Snake from the ...
user1118321's user avatar
  • 11.9k

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