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
2 votes
1 answer
31 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 ...
user avatar
2 votes
1 answer
68 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....
user avatar
3 votes
2 answers
120 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 ...
user avatar
10 votes
1 answer
834 views

High performance physics simulation - core class design

Below is some stripped down code from a physics simulation. The classes Vector2, Line and ...
user avatar
1 vote
1 answer
96 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: ...
user avatar
  • 57
2 votes
2 answers
219 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 ...
user avatar
13 votes
2 answers
2k 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
835 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 <-...
user avatar
3 votes
1 answer
243 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
76 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. ...
user avatar
4 votes
1 answer
509 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 ...
user avatar
  • 175
5 votes
1 answer
125 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: ...
user avatar
  • 153
4 votes
1 answer
455 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 ...
user avatar
  • 209
2 votes
1 answer
161 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'...
user avatar
  • 151
3 votes
1 answer
540 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 ...
user avatar
  • 151
15 votes
3 answers
5k 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 ...
user avatar
  • 9,587
4 votes
1 answer
703 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++...
user avatar
  • 9,587
1 vote
1 answer
441 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 ...
user avatar
  • 490
1 vote
1 answer
930 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 ...
user avatar
3 votes
1 answer
330 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 ...
user avatar
4 votes
1 answer
361 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 ...
user avatar
5 votes
1 answer
487 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 ...
user avatar
2 votes
1 answer
163 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 ...
user avatar
  • 879
7 votes
1 answer
294 views

Improved snake game in SFML (C++)

This is the improved code of a question I asked some days ago. main.cpp ...
user avatar
  • 879
8 votes
3 answers
688 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....
user avatar
  • 879
3 votes
0 answers
39 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 ...
user avatar
  • 2,324
4 votes
0 answers
290 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 ...
user avatar
6 votes
2 answers
73 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 ...
user avatar
  • 2,324
1 vote
0 answers
92 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 ...
user avatar
4 votes
1 answer
59 views

PONG XI Platinum Edition

This is my first game. This header defines the constants: Constants.h: ...
user avatar
  • 43
1 vote
1 answer
318 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: ...
user avatar
7 votes
2 answers
811 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 ...
user avatar
6 votes
2 answers
790 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: ...
user avatar
0 votes
1 answer
135 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 ...
user avatar
4 votes
1 answer
540 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 ...
user avatar
  • 347
3 votes
2 answers
414 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 ...
user avatar
  • 139
3 votes
0 answers
557 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 ...
user avatar
  • 4,452
5 votes
1 answer
96 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 ...
user avatar
  • 2,324
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 ...
user avatar
  • 4,452
8 votes
1 answer
374 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) ...
user avatar
  • 2,324
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 ...
user avatar
  • 123
8 votes
2 answers
11k 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 ...
user avatar
  • 315
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 ...
user avatar
  • 2,324
5 votes
2 answers
410 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 ...
user avatar
3 votes
0 answers
245 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) ...
user avatar
  • 363
8 votes
1 answer
356 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 ...
user avatar
  • 113
3 votes
1 answer
138 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: ...
user avatar
  • 113
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++...
user avatar
  • 363
7 votes
2 answers
1k 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: ...
user avatar
  • 375
3 votes
1 answer
699 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 ...
user avatar
  • 123