Questions tagged [sfml]

SFML (Simple Fast Media Library) is a portable and easy to use multimedia API written in C++. You can see it as a modern, object-oriented alternative to SDL. SFML is composed of several packages to perfectly suit your needs. You can use SFML as a minimal windowing system to interface with OpenGL, or as a fully-featured multimedia library for building games or interactive programs.

Filter by
Sorted by
Tagged with
5 votes
2 answers
2k views

Simple implementation of Conway's game of life with SFML

This is a very simple version of Conway's game of life. It treats the edge of the grid as dead cells and uses a very basic algorithm. Despite this it works fine. As people might not have the SFML ...
8 votes
1 answer
420 views

The Last Lost Bubble Shooter - a Board game for children

In this game the pieces are trains and you move forward on the track (never backwards) in search of your goal. The players move based on a combination of resources (Soap and Water to make Bubbles) ...
9 votes
2 answers
5k views

Resource manager with SFML

I decided to write a 2D game with SFML, and for the beginning of the game I wrote classes to manage resources like sounds, musics, textures... I would like to get reviews of my code: how would you ...
8 votes
2 answers
13k views

2D raycasting implementation

I have implemented a 2D raycast algorithm in SFML to detect walls in a 2D game: How it works Player can move in every direction by w ...
6 votes
1 answer
2k views

Button click logic with SFML

I wrote some functionality that works as intended in order to create functional clickable rectangles. I inherit from RectangleShape in SFML and I have several objects (not just buttons) that inherit ...
8 votes
1 answer
385 views

SFML dice game with logic-presentation separation

I asked for feedback on my Dice class and I was suggested that I should separate logic from view. I decided to completely refactor my project and I'd like to share ...
5 votes
2 answers
432 views

SFML game with a sprite in a dungeon

I am making a game with c++ and sfml for the first time and I would like someone to review my current code before I advance and add more rooms/levels, any input is gratefully appreciated. I was also ...
6 votes
1 answer
3k views

Building a 2D Game Engine Using SFML

I've always loved making games and using SFML, and up until a few days ago, I've had to re-write code over and over again. So I decided to write a game engine so I can reuse my code. I've never done ...
3 votes
0 answers
272 views

Chat program with C++ and SFML

This is my client code: (My server is very similar at the moment but I will upload it below this one just in case somebody wants to run it) ...
3 votes
1 answer
173 views

SMFL Dice class

I'm writing game in SFML and I got question about class design. For example, I have a dice class that looks like this: ...
4 votes
2 answers
1k views

Countdown timer for new year

Please help me improve my code. Note that it runs just fine. Especially with the way I use SFML, I need lots of guidance since I've just started learning how to use this library. I'm still learning C++...
7 votes
2 answers
2k views

Drawing a circle segment

I wrote code to draw a circle segment, such that the segment angle will be facing the mouse. My code: ...
7 votes
2 answers
4k views

Pong game in C++ SFML

This is my first game, I need to know how I could improve this code: main.cpp ...
3 votes
0 answers
204 views

Simple Snake Game - Follow-up 2

Based on the previous question, I have implemented all suggestions. Also, I worked a bit in this project to improve it. Summary of improvements: split the code into multiple files as .hpp and .cpp ...
3 votes
1 answer
788 views

Rain effect with SFML

I decided to write a rain effect to learn how to use SFML, and I would like to get some review on my code: i want to know how you would have write the program, and how to improve my code. This program ...
5 votes
1 answer
2k views

TicTacToe with MiniMax algorithm

I just got into C++ a few days ago and decided to make a MiniMax based TicTacToe game, I don't really know much about the conventions and best uses of the C++ language so I'd really appreciate any ...
3 votes
1 answer
90 views

Server-side implementation for a chip-capturing board game

I am currently coding a game in C++ with a network connection. The game consists of two players on a game-board who compete for capturing chips. I am aware that this program is a little bit useless ...
4 votes
2 answers
501 views

Cursor module for a text-editor

A few weeks ago, I had started to write a text-editor in C++ using SFML library. The work is now paused pretty much because I am a lazy freak. So, I thought I might use this passive time to get ...
6 votes
1 answer
2k views

SFML-based chat in C++

I wanted to get some review on this code I wrote. The repo is here if you want to download the CodeBlocks project. This program is several things: it is a console using SFML graphics; it is a console ...
-2 votes
1 answer
6k views

C++ Erasing an object from vector of pointers

I am making this simple game in SFML and I have this vector of pointers std::vector<Brick*> bricks; which stores objects of class ...
3 votes
1 answer
314 views

Rendering the periodic table in C++ using SFML

I have created this as an example. It uses SFML as its core dependency along with JSON for modern C++ to load the elements from a file. Basically what happens is when an object that contains an ...
48 votes
7 answers
20k views

Mandelbrot image generator and viewer

This is a C++ program which outputs a Mandelbrot fractal image in a graphics window and lets the user zoom and pan around the image, generating a new image each time the user does so. I'm using SFML ...
1 vote
1 answer
223 views

Array choice based on template specialization

I've got these two template functions responsible of adding/removing actors in-game in GameEngine.h: ...
1 vote
1 answer
399 views

Trig based functions in sfml, angling of sprites

...
12 votes
1 answer
789 views

Sketch of Chutes and Ladders game

The classic Chutes and Ladders game has a grid of 100 squares with various "chutes" (which send a player backwards) and "ladders" (which promote a player forward). The goal here was to randomly ...
2 votes
0 answers
404 views

Shortest bitonic tour

This a solution to the shortest bitonic tour using dynamic programming. Bitonic tour starts at the leftmost point then goes strictly rightward to the rightmost point and finally strictly leftward to ...
4 votes
3 answers
387 views

Master engine class for a Pong game

Question: Is having a master class bad practice? I am making a simple pong game, but I'm writing the code as if I were making for something that might be for something more complicated I want to ...
5 votes
2 answers
2k views

SFML game using moving circles

This is my first SFML game. There are 2 players: the red circle and the yellow circle. The red circle is controlled by Up,down,left and right keys, the yellow one is controlled by WASD keys. The ...
4 votes
1 answer
6k views

Snake game in C++ (using SFML)

I haven't done any programming in a while, and I'm getting back into it. I made this Snake clone to refresh me a bit, and I would like to get some feedback in the "elegance" and "well-done"-ness of ...
2 votes
1 answer
1k views

Snake class for simple Snake clone

NOTE: I'm only including the snake class (only one file) here because the rest of the code doesn't need reviewing. If you need to see the complete code for whatever reason, it is available on GitHub ...
1 vote
0 answers
2k views

Basic C++ server and client for chatting over TCP

...
6 votes
1 answer
3k views

Ping Pong game in SFML

I am learning C++ and SFML so I want to know if I am laying my code out neatly and if my code is efficient. I know this is not a full game yet but I want to know if I am on the right tracks. ...
2 votes
1 answer
533 views

Simple Snake Game - followup

Based on the previous question, I have implemented all suggestions. Also, I added new features to the game. Summary of improvements: Implemented smooth movements to snake instead of tile movements ...
7 votes
1 answer
1k views

Simple OpenGL-2D Program

I have created mini-opengl program that draw simple chess board on screen by using SFML windows model only. The program runs fine. The main purpose of this program is to keep it as simple as possible ...
9 votes
3 answers
2k views

Performance of collision detection in a grid

I have fairly simple collision checking and handling Python code which is currently bottlenecking my performance quite a bit. I haven't done too much coding in python and I'm quite sure there's ...
6 votes
1 answer
483 views

N-body sim with Barnes-Hut - Follow up

Link to previous question: Barnes-Hut N-body simulator It still has issues I'm sure. Node.h ...
4 votes
1 answer
309 views

Cart-creation class using SFML

My code is for a simple "cart-creation" class and sample use in SFML. The Cart class inherits sf::RectangleShape and will end up ...
2 votes
2 answers
155 views

Generic 2D engine for simulation

I'm using SFML to manage my windows and I'm writing this engine to visualize some PSO work. I'm trying to make it generic enough that I can extend it for other simulations later on and keep it as ...
5 votes
0 answers
204 views

Fake 3D effect in SFML - follow up 2

Based on my previous question, I have implemented all the recommendations received. In addition, i have implemented new features and completed road geometries. Here is a summary of the improvements: ...
4 votes
1 answer
197 views

Fake 3D effect in SFML - follow up

Based on my previous question, I have implemented all the recommendations received. Here is a summary of the improvements: Use meaningful names as much as possible. Removed multiple declarations in ...
4 votes
1 answer
3k views

Simple Breakout/Arkanoid clone with SFML

I'm doing this small Breakout clone for school, and I've looked at heaps of people's takes on Breakout and tried to combine bits and pieces that I liked. Only problem that I'm having is getting the ...
5 votes
2 answers
2k views

QuadTree for collision detection

I was recently working on a game using the SFML library, Later on, I experienced performance issues due to collision detection. I have been told to use a QuadTree ...
3 votes
1 answer
1k views

2D Tile Engine game

The game basically has a player (PlayerCharacter class) that can move around the world. It has a 2D world made of tiles managed by ...
3 votes
1 answer
1k views

Drawing a colored rectangle on-screen

I have made my first program that draws a colored rectangle on-screen. I want to know the best practices of making OpenGL and GLSL programs. ...
2 votes
0 answers
761 views

Tic Tac Toe - NxN

This is a graphical Tic Tac Toe game by using SFML cross-platform library. It seems to work fine. I'm actually new to SFML and making GUIs. If anyone is familiar with SFML, I'd appreciate some ...
5 votes
1 answer
661 views

A Trivia game with SFML

So I've been making a trivia game with SFML and C++ for quite a while now for my school project and I would like to get some constructive criticism, anything helps from best practices to overall ...
10 votes
3 answers
2k views

Network programming for an IRC Bot

I'm currently making my first steps into the territory of network programming, using the SFML Network library to simplify things. Later on, my bot shall post new pull requests and changes concerning ...
2 votes
1 answer
356 views

SFML Pong Game Performance

I was hoping I could get some feedback on performance of my animations overall. It could just be me but I keep getting a bit of lag despite being at 60FPS constantly. Objects on screen seem to tear a ...
4 votes
1 answer
1k views

SFML Ping Pong improved (V0.3)

Some of you may have seen my previous post asking if my code was efficient and easy to read. I have made some more improvements to it by adding sounds, visual count down and checking if the window ...
3 votes
1 answer
3k views

Graphical Tic-Tac-Toe game using SFML

First of all, I'm really new to SFML and making GUIs. This is my first real program using this. Right now, when I click outside the window when the program is first run, the first piece is placed in ...