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
1
vote
0answers
6 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
107 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
100 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 ...
1
vote
1answer
49 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
84 views

Improved snake game in SFML (C++)

This is the improved code of a question I asked some days ago. main.cpp ...
8
votes
3answers
167 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....
1
vote
0answers
29 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
90 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
66 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
78 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
54 views

PONG XI Platinum Edition

This is my first game. This header defines the constants: Constants.h: ...
1
vote
1answer
47 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: ...
6
votes
2answers
166 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
192 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: ...
0
votes
1answer
114 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 ...
4
votes
1answer
346 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
201 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
207 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 ...
4
votes
1answer
76 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
2answers
864 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 ...
6
votes
1answer
220 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) ...
5
votes
2answers
1k 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 ...
5
votes
2answers
4k 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 ...
4
votes
1answer
139 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 ...
5
votes
2answers
320 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 ...
3
votes
0answers
134 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) ...
8
votes
1answer
243 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 ...
3
votes
1answer
107 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
710 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
825 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: ...
3
votes
1answer
469 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 ...
3
votes
1answer
67 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 ...
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 ...
6
votes
1answer
928 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 ...
4
votes
2answers
197 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 ...
-2
votes
1answer
2k 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 ...
6
votes
2answers
2k 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
1answer
183 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 ...
1
vote
1answer
163 views

Array choice based on template specialization

I've got these two template functions responsible of adding/removing actors in-game in GameEngine.h: ...
6
votes
1answer
872 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 ...
1
vote
1answer
233 views

Trig based functions in sfml, angling of sprites

...
12
votes
1answer
581 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
0answers
307 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 ...
44
votes
7answers
15k 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 ...
9
votes
1answer
15k views

Pong game in C++

This is my second SFML game, which is Pong. Please tell me what you think. ...
5
votes
2answers
975 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
1answer
3k 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 ...
1
vote
0answers
2k views

Basic C++ server and client for chatting over TCP

...
3
votes
0answers
182 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 ...
2
votes
1answer
479 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 ...