What's the deal with Deno? We talk with a major contributor to find out. Listen now.

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
2answers
168 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 <-...
3
votes
1answer
94 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 ...
2
votes
0answers
26 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. ...
4
votes
1answer
172 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 ...
5
votes
1answer
74 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: ...
4
votes
1answer
104 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 ...
6
votes
1answer
1k views

Fake 3D effect in SFML

I was reading about making fake 3D effects or so-called "mode 7" on 2D contexts. I have made a small program to demonstrate the fake 3D effect by using SFML. How can I improve it? ...
2
votes
1answer
54 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'...
3
votes
1answer
62 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 ...
15
votes
3answers
3k 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 ...
4
votes
1answer
131 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++...
1
vote
1answer
92 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 ...
1
vote
1answer
335 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 ...
3
votes
1answer
101 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 ...
4
votes
1answer
224 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 ...
5
votes
1answer
88 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 ...
5
votes
1answer
204 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 ...
8
votes
3answers
400 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....
2
votes
1answer
99 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 ...
7
votes
1answer
151 views

Improved snake game in SFML (C++)

This is the improved code of a question I asked some days ago. main.cpp ...
3
votes
0answers
36 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 ...
4
votes
0answers
142 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 ...
6
votes
2answers
68 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 ...
1
vote
0answers
83 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 ...
4
votes
1answer
55 views

PONG XI Platinum Edition

This is my first game. This header defines the constants: Constants.h: ...
1
vote
1answer
103 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: ...
7
votes
2answers
404 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 ...
6
votes
2answers
445 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: ...
5
votes
1answer
1k views

Simple Snake Game

I was working on this game for while and I have made it for education purposes by using SFML. The game works fine but I would like to know how I can improve it. ...
0
votes
1answer
121 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 ...
9
votes
1answer
21k views

Pong game in C++

This is my second SFML game, which is Pong. Please tell me what you think. ...
4
votes
1answer
430 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 ...
3
votes
2answers
298 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 ...
3
votes
0answers
362 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 ...
5
votes
2answers
1k 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
1answer
303 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) ...
7
votes
2answers
2k 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 ...
6
votes
2answers
7k 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
1answer
457 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
1answer
290 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
2answers
377 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
1answer
2k 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
0answers
186 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
1answer
113 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
2answers
923 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
2answers
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: ...
6
votes
2answers
3k 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
0answers
195 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
1answer
573 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
1answer
1k 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 ...