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
4 votes
1 answer
111 views

An implementation of Conway's Game of Life using C++ and SFML

I recently started learning C++ again, and I wrote a simple version of Conway's Game of Life. This version doesn't use 2 buffers to transfer changes over to the main view. Instead, it uses a stack of ...
imapyromain's user avatar
7 votes
1 answer
600 views

John Conway's Game of Life in C++

I have created Game of Life in C++ SFML. The code works just fine. However since I am not used to working with C++, I implemented a lot of stuff the way I would in python (for example I have not used ...
Doruk's user avatar
  • 73
3 votes
2 answers
622 views

"Asteroids" style arcade game

My Game class does not satisfy me. I use some cheat-code to delete bonuses from their list, I think this is not a better way to do it. Any other requests will be greatly appreciated. Latest version is ...
Paul Nick's user avatar
2 votes
1 answer
503 views

Minesweeper using SFML with C++

Hi, I am making a Minesweeper game using SFML 2.0. I am just a beginner in C++ and started using the framework for 2 weeks now, so it is safe to say I may have made lots of mistake especially when it ...
Allen's user avatar
  • 23
5 votes
2 answers
903 views

Simple virtual piano

The application is a virtual piano with only one octave for simplicity. What can I improve with this code? ...
Isaí's user avatar
  • 51
3 votes
1 answer
318 views

A Flappy bird game using C++ and SFML

I have written a Flappy Bird using SFML and C++, kindly review my code. I'm hoping for objective criticism. main.cpp ...
Lir's user avatar
  • 33
2 votes
1 answer
164 views

Reimplementation of Diep.io in C++ with SFML and Box2D

Here's my attempt at reimplementing part of https://diep.io/, a 2D game where tanks battle with each other. The tanks are circular and they have cannons which fire bullets. The bullets can hit other ...
eesiraed's user avatar
  • 123
1 vote
1 answer
82 views

game interface setup

I've learned that magic numbers are bad in code. However, should the coordinates, and rotation angles of all the sprites be stored in variables? Is the convention in game development to leave those ...
Đạt Phạm's user avatar
2 votes
1 answer
166 views

C++ Connect 4 in SFML

After a substantial amount of programming experience in high level languages like Javascript and Python, I decided to try learning a low level language for once, so I did C++. As my first project I ...
Kotetsu Chan's user avatar
2 votes
1 answer
366 views

Chess game setup: Initial board state

This app only creates a chess board set to the start-of-game state. It does nothing else. I'd appreciate feedback on the files that are relevant to this board setup (all shown below: board.cpp, pieces....
tarstevs's user avatar
3 votes
2 answers
143 views

Game of life with options like windows and board size

Mainly I am looking for a better way to control the user input in the game loop which is in the first file. Since the nested switch with many ...
yolo expectz's user avatar
10 votes
1 answer
897 views

High performance physics simulation - core class design

Below is some stripped down code from a physics simulation. The classes Vector2, Line and ...
Oliver Schönrock's user avatar
1 vote
1 answer
105 views

Text rendering for a Node class in SFML

I needed a method which would print a square with 4 values in each corner, my current "prototype" looks like this: ...
a a's user avatar
  • 157
2 votes
2 answers
498 views

Game States / Pong: SFML Box2D EnTT

Trying to make a little 2D engine I can play with. The end goal is a simple multiplayer PVP game just using shapes. I will make one version using ECS and one using OOP for learning. This is the shell ...
Teach_Me_Something's user avatar
13 votes
2 answers
4k views

A Flappy bird Game

Here is a project that I have been working on for the past few days. I have used the SFML library in C++ to make a flappy bird game of my own. I made this as a ...
user avatar
5 votes
2 answers
1k views

Maze Generator using C++ and SFML

I have created a DFS backtracking maze generator (non-recursive) using C++ and SFML. It works great but the final results of creating a 9000 x 9000 with cell size 2 is around 1 min and 46 seconds <-...
theirrevocableSake's user avatar
3 votes
1 answer
303 views

C++ Snake game using SFML libraby

Here is my little snake game which I made in c++ using the SFML library. The game is very simple. I have also included a screenshot of how the GUI looks. The files which I am loading are 30x30 colored ...
user avatar
2 votes
0 answers
91 views

Pong Implementation using Rust SFML

Getting my feet wet with Game Development, and was wanting to see where I could improve in my usage of Rust as well as Game Development concepts. ...
Konnor Timmons's user avatar
4 votes
1 answer
1k views

Snake game in C++ with SFML

I started learning programming about a year ago, starting with Python. Half a year ago, I moved onto C++ and this is my first large project with that language. Have I understood the basics of the ...
JensB's user avatar
  • 175
5 votes
1 answer
206 views

C++ SFML fonts loader

I am writing a game via SFML. In difference places I want to use loaded fonts. So I decided to write the fonts loader, so that load fonts only one time and use them in the future from class. My code: ...
asd's user avatar
  • 153
4 votes
1 answer
715 views

Resource management classes in C++ game

This is a part of simple sfml C++ game, but I think neither the library nor the language is that much crucial here. I am mainly worried about the design. I have a class template ...
weno's user avatar
  • 209
2 votes
1 answer
189 views

C++/SFML Visualisaiton of doubly linked list

I wrote a program which visualizes a doubly linked list in C++/SFML. The code is working as intended, and does exactly what I want. Could you give me some feedback / criticism on some do's and or don'...
expl0it3r's user avatar
  • 151
3 votes
1 answer
856 views

C++/SFML Boid/Flocking Simulation

I have created a flocking simulation based on Craig Reynolds Boids. Could you give me some feedback on my code? I am a newbie and would really appreciate some criticism. Files: Boid - this is the ...
expl0it3r's user avatar
  • 151
16 votes
3 answers
6k views

2D Collision Detection in C++

I'm attempting to rewrite the classic snake game in c++. What I am inquiring about is my implementation for a 2D collision detection function. I am utilizing ...
Linny's user avatar
  • 9,948
6 votes
1 answer
1k views

Snowflakes in C++

I've started learning C++ using Microsoft Visual Studio. I'm decided to create a simple GUI program that creates a "snowflake" wherever the user clicks on the screen. Seeing as how this is my first C++...
Linny's user avatar
  • 9,948
1 vote
1 answer
672 views

Event handler for SFML

Below is code for handling events in SFML. It works by reading a text file containing a sequence of functions to be called when a given event is detected: EventManager.hpp ...
Cortex's user avatar
  • 500
1 vote
1 answer
1k views

Basic Pong game using C++ and SFML

I am making use of C++ and SFML to make a basic Pong game. I have made it so that there are two players who can control the paddle on each side and the ball will bounce off screen and paddles except ...
AaySquare's user avatar
3 votes
1 answer
534 views

C++ SFML Animation System

I'm attempting to write an animation system on top of SFML, and I've come up with a design where I can wrap sf::Drawable objects into a RenderComponent class, and the RenderComponent class can be ...
Daniel G's user avatar
4 votes
1 answer
508 views

C++ beginner wrote Conway's game of life using SFML

I'm an intermediate Java programmer trying to learn the basics of C++. Thus, I decided to write "Conway's game of life" as my second C++ program (I already wrote a Mandelbrot image generator). It was ...
Toerktumlare's user avatar
5 votes
1 answer
678 views

Beginner's Snake Game using SFML and C++

Never really got past the beginner stage of programming so I'm trying to get better this Summer. I think games are a fun way to learn how to program so I decided to start with snake. I'd appreciate ...
Yung Yung's user avatar
2 votes
1 answer
191 views

Improved snake game in sfml (C++) #2

So i took even more suggestions and improved the code from this question. Some of the suggestions i wasn't able to implement simply because of my "newbieness" in c++ programming main.cpp ...
Nadpher's user avatar
  • 889
7 votes
1 answer
358 views

Improved snake game in SFML (C++)

This is the improved code of a question I asked some days ago. main.cpp ...
Nadpher's user avatar
  • 889
8 votes
3 answers
774 views

SFML snake game in C++

I made a snake game in sfml and i'm kind of proud of the code's structure, but proud doesn't mean it's good, so i'm putting it here so that if there is something that could be bettered, you would know....
Nadpher's user avatar
  • 889
3 votes
0 answers
40 views

GUI Button Element with Unit Tests follow-up

This is my second attempt with unit-tests. Like my previous attempt, I would prefer a focus on the unit-tests, however I am always happy to improve my code in any way reviewers can help. Once again ...
Summer's user avatar
  • 2,334
4 votes
0 answers
343 views

Central class for SFML game engine

I have worked on a SFML Game/Game-Engine Project for 2 months now and am looking for some feedback in terms of... Is this a valid approach for a Game class? Are there any glaring C++ coding practice ...
Moritz Schäfer's user avatar
6 votes
2 answers
94 views

GUI Button Element with Unit Tests

I would like a review on just a single class today. More important to me than a review on the class itself, however, is a review of the unit-tests I wrote for it. You see this is my first attempt at ...
Summer's user avatar
  • 2,334
1 vote
0 answers
131 views

SFML Circle of Stars

Im trying to make a SFML code that takes my code i already have to make a star with a convex shape and put it into a circle of stars surrounding the point the user chooses. The User is also able to ...
Walt Melon's user avatar
4 votes
1 answer
68 views

PONG XI Platinum Edition

This is my first game. This header defines the constants: Constants.h: ...
lilxak's user avatar
  • 43
1 vote
1 answer
415 views

Moving character in given direction C++ SFML

I have written simple input manager which is used for me to detect key press, and fire assigned function. For example I can do something like that: ...
VirtualUser's user avatar
7 votes
2 answers
1k views

2D falling snow animation

I was hoping that someone could review this code. My main concern is that the contents of main() are difficult to read. I thought about extracting some segments of code into functions (to aid ...
ReachForTheLeech's user avatar
6 votes
2 answers
926 views

Snake game using SFML CPP

I made using SFML my first game project. It's a snake game, and I used 2 custom classes: snake fruit (snake grow by 1 when eat it) Here's main.cpp code: ...
qmwnebrv's user avatar
0 votes
1 answer
151 views

Double loop for input handling

I'm writing a simple game with multiplayer mode in C++, using the SFML framework. Since I don't want to make it more complicated than necessary, I handle everything on a single thread, so that when ...
user3738870's user avatar
4 votes
1 answer
583 views

Macau Card Game (with graphics)

I've already made a version of this game which was supposed to be played on the console. I got it reviewed and applied almost all of the recommendations I received in that topic. Thus you can consider ...
I. S.'s user avatar
  • 347
3 votes
2 answers
645 views

Sokoban Clone using SFML

I am new to C++ and game programming. I am using SFML for graphics. I wrote a clone of Sokoban in my free time and to be honest, I am not happy about the result. I feel like I reused some code too ...
AliTeo's user avatar
  • 139
3 votes
0 answers
718 views

Conway's Game Of Life using SFML and MVC

This is a follow-up to my previous question. I followed the given advice and implemented the MVC design pattern. As I've never used MVC before I am quite unsure about the quality or if it is even ...
yuri's user avatar
  • 4,450
5 votes
1 answer
106 views

Viewport for Card Match Game

This is the 2nd half of my Memory game. The first half can be found here. The repository can be found on Github. I am using SFML 2.4.2. In this project I focused on a few key aspects of design and ...
Summer's user avatar
  • 2,334
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 ...
yuri's user avatar
  • 4,450
8 votes
1 answer
408 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) ...
Summer's user avatar
  • 2,334
9 votes
2 answers
4k 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 ...
Julien's user avatar
  • 123
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 ...
Tomek's user avatar
  • 315