Simple and Fast Multimedia Library - a free, portable API that provides access to graphics, input, audio, etc.

learn more… | top users | synonyms

-1
votes
0answers
20 views

SFML draw throws exception [on hold]

Whenever I try to call the draw function (RenderWindow), I get an unhandled exception: Unhandled exception at 0x74A0C9F1 in Shard.exe: 0xC0000005: Access violation executing location 0x00000000. ...
1
vote
1answer
51 views

How can I fix user input for this pong paddle?

I have been having trouble with my pong paddle - It responds to user input as if it was typing. Sometimes, people try to react to KeyPressed events directly to implement smooth movement. Doing so ...
1
vote
0answers
101 views

How to read neighbor pixels in GLSL?

I'm using SFML 2.1, it's much more straightforward for me so I can jump directly to learning the shading language. I'm trying to do something similar to conway's game of life. I already learned that ...
0
votes
0answers
63 views

SFML transparent splash screen

How would I show a splash screen when the game starts? The splash screen would be an image with transparent edges: Notice how part of the splash for this game is outside the window, or should I ...
0
votes
1answer
84 views

Can't seem to get Sprite to face left in sfml c++

I am having some small issues getting my sprite character to flip around. Basically I have a character that can walk to the right.. I am looking to flip it so that it looks like it is walking left. I ...
3
votes
5answers
285 views

Is it bad practise to have an object for every tile?

In the game I am working on, many of my tiles must have special attributes (such as triggers when the player steps on them). I was wondering if it would be bad practise to create an object for every ...
2
votes
0answers
86 views

Problems with instaling SFML [closed]

I've followed the instructions on installing SFML on the website to the letter. But, I get this when I try to build the sample program on the same page using Code::Blocks. ...
0
votes
0answers
68 views

How do I scale a Spine animation at runtime?

The spine docummentation shows how to scale the skeleton when loading. Is it a must to reload the skeleton to scale the animation while playing it?
2
votes
1answer
56 views

How do I pause a single bone with spine?

I'm using spine along with SFML. I have a character that is always animated. When he shots, I set an animation that affects only his arm. The arm goes up, but I need to stop this animation in the ...
-2
votes
1answer
148 views

GLSL- How to change a certain color of a sprite, to another color passed into the shader?

I have been googling for over an hour, trying to find out how to do something very simple, which I see in tons of games. I tried to understand GLSL, but it seems like a ton of learning for a single, ...
0
votes
0answers
53 views

OpenGL textures trigger error 1281 if SFML is not called

I am using SOIL to apply textures to VBOs, without textures i could change the background and display black (default color) vbos easily, but now with textures, openGL is giving an error 1281, the ...
0
votes
2answers
102 views

SFML: Monster following player on a straight line

I've searched for this and found a few topics , usually they used a function normalize and using simple vector subtracting which is ok , but how should I do it in sfml ? Instead of using: Movement = ...
0
votes
0answers
48 views

How does character creation work in 2D games? [duplicate]

My question is how does character creation work in (multiplayer) 2D game? For example player wants to have long yellow hair, black armor and white leggings. What should I do? Already have all ...
1
vote
1answer
81 views

Henry Hatsworth kind of blocks minigame, std::vector sorting or alternative?

I'm not sure if this is the right place to post this, or if I'm doing it right. But I believe I've kept to the rules. If not, please let me know and I'll remove my post or edit it accordingly. I'm ...
0
votes
0answers
291 views

Procedural Tilemap generation [on hold]

So i'm building a 2d game but i have never really done any procedural generation i followed the SFML tutorial for tilemaps and i have the maps loading what i know want to know is how can i convert the ...
1
vote
1answer
272 views

How can I correctly use an unordered_multimap as entity and component storage?

The Setup I've made a few games (more like animations) using the Object Oriented method with base classes for objects that extend them, and objects that extend those, and found I couldn't wrap my ...
1
vote
2answers
178 views

Really simple count down timer

I'm making a little 2D tank game that fires bullets depending on where you click (This has been done and works a treat). I'm currently working on a timer class with a simple function that displays a ...
0
votes
1answer
106 views

How do I handle this type of collision?

So I've been messing around with simple game development for a while and just found an interesting game idea here . I'm using SFML 2.1 with C++ and so far I have a tilemap in a VertexArray using a ...
0
votes
1answer
71 views

OpenGL +SFML + GLFW3

I'am maybe asking a stupid question, but can we mix OpenGl + SMFL and add to it some GLFW in the same SFML window ?
1
vote
1answer
173 views

Why is my Simplex Noise appearing in four columns?

I'm trying to make a Texture out of Simplex noise, but it keeps appearing like this regardless of how big or small scale is: The following code is used to produce the image's color date: private ...
0
votes
1answer
182 views

Why does my SFML game cause screen tearing on Linux?

I wrote a little game of a bouncing ball, using SFML and Box2D. On Windows, the graphics animate smoothly. However, on my Linux machine, the animation stutters randomly. To be precise, I get a ...
1
vote
0answers
177 views

Which will be better for a beginner, SDL, SFML or OpenGL? [closed]

I want to make games.For now simple 2D games, but I don't know from where to start. I "know" C++, but i havent worked with classes.I want to begin with game development and I searched in the internet ...
3
votes
2answers
288 views

How can I improve my collision detection's performance?

I'm new to programming and want to speed up the collision detection in my C++ 2D platformer game engine. Currently, only the player's collision detection works: Every frame, the player's update ...
-1
votes
1answer
201 views

Slight pause/delay when moving

I've been working on this little framework for my game today and realized that moving delays when moving around. I've used SFML before and have had the same problem, but never bothered to fix it. I'm ...
0
votes
2answers
136 views

Synchronizing mob states in online multiplayer game

I'm developing an exploration-based platform game in which from the start there were plans about including local multiplayer support, but recently I've been considering an online multiplayer mode, ...
0
votes
0answers
460 views

How can I load an SVG file and create a shape and collision data from it? [on hold]

I'm looking to write a game in C++ with vector-styled graphics. For this, I will need to turn an SVG shape into a Box2D body and a polygon for rendering in SFML. I don't need the full capabilities of ...
1
vote
1answer
316 views

How do I make my SFML mouse position capture fast enough?

I'm new to game development and making a Pong clone in SFML. I am trying to set the screen's top and bottom as bounds for the paddle. Here is my attempt: #include "main.h" #include "objects.h" int ...
0
votes
0answers
133 views

How can I align a 2D object properly using tilemap collision [duplicate]

I'm making a mario clone, and I have been working on the collision but I can never seem to get it right. I started out with "true/false" collision, aligning the player at it's last position, and as ...
1
vote
0answers
231 views

Why are png files so much larger in RAM than on disk? [closed]

I have images that take up 119 MB on disk, but when I load them into my game, they use 850 MB of RAM. Why is this? How can I decrease the amount of RAM they use? My images are high resolution PNG ...
0
votes
1answer
105 views

GLSL/SFML - Only make portion of texture alpha

I'm trying to take a portion of the current texture and turn it to 50% transparent. I send in four values, signifying the rectangle I want to make transparent. It seems every time, however, that ...
2
votes
2answers
210 views

Collision detection via adjacent tiles - sprite too big

I have managed to create a collision detection system for my tile-based jump'n'run game (written in C++/SFML), where I check on each update what values the surrounding tiles of the player contain and ...
0
votes
2answers
128 views

What interface should be responsible for specifying the initial position of a game object?

I'm making a simple Pong clone game and have been having an issue deciding on how my classes should handle the initial placement of an object. For instance, my Ball class's constructor is: Ball ...
-3
votes
1answer
371 views

Simple collision detection implementation [closed]

I'm making a game with C++ where the program extracts the lines out of an image (via openCV), stores them in an std::vector< std::vector< int > > and the builds a tile map out of it which is ...
1
vote
1answer
213 views

How to adjust a font to fit inside a speech bubble?

I'm creating a game that contains a speech bubble for dialog. The idea of this function is to allow one call to set new text in a speech bubble. The speech bubble will adjust in size of the new font ...
-1
votes
0answers
130 views

What's wrong with my tileMap implementation? [closed]

I need to implement a 2d platformer and decided to use a tilemap. I found this tutorial and tried to implement the second solution. The text says: Decompose movement into X and Y axes, step one at a ...
2
votes
1answer
168 views

How can I make an animation using arrays?

I want to take an array of sprites, for example sf::Sprite animation[3] = { stepLeft, inMiddle, stepRight }; and construct an animation by looping them. Is this possible? How do I go about it?
1
vote
2answers
1k views

C++&SFML Moving Sprites Smoothly in Tiles [duplicate]

As a student, I've always wanted to become a game developer. So far I've managed to learn the basics of C++ and SFML 2.1 For my first project, upon deciding to make a 2D RPG-ish game, I encountered a ...
5
votes
3answers
1k views

How do I create a color picker with variable hue and saturation?

I am trying to create a Color Picker similar to that of MS Paint. Unfortunately, I can't figure out the algorithm for saturation. This is what my current algorithm creates. Anytime I try to ...
1
vote
1answer
129 views

Implementing collision response, current implementation does too many checks

I don't know how I should handle my collision response when collision between two entities leads to second collision with third entity. Blue arrow is velocity of the rightmost entity and numbers ...
2
votes
1answer
759 views

Why do I have to run my 2D game at 300+ FPS for movement to be passably smooth?

I'm working on a simple game with SFML, and the only way to make the game reasonably smooth is to allow it the highest framerate my machine can handle (that is, giving it no limit). 60 FPS in my game ...
0
votes
1answer
815 views

implementing collision detection and handling for tiled 2D world with smooth wall sliding

Im using SFML 2.1 for graphics and my game structure follows SFML book quite closely (SceneGraph implementation etc) My world consists mostly of characters (around 1-400, moving around) and tiles ...
1
vote
1answer
141 views

SFML image extension for best performance

I am using SFML library in my 2D game. The Texture Class has a method to load an image from file: Texture.loadFromFile("image.*") Which file extension should I use to achieve best performance? ...
1
vote
1answer
293 views

Clearing an SFML scene with a partially transparent color

Is there way to clear a scene with a transparency (alpha) value, in pure SFML? I'm trying to clear with rgba(0,0,0,128) so the previous frame still partially shows through, which would create a ...
1
vote
0answers
211 views

SFML 2.0 Too Many Variables in Class Preventing Draw To Screen [closed]

This is a very strange phenomenon to me. I have a class definition for a game, but when I add another variable to the class, the draw method does not print everything to the screen. It will be ...
0
votes
1answer
164 views

How do I get information about the level to the player object?

I have a design problem with my Player and Level class in my game. So below is a picture of the game. The problem is I don't want to move on the black space and only the white space. I know how to do ...
2
votes
1answer
657 views

Improving Click and Drag with C++

I'm currently using SFML 2.0 to develop a game in C++. I have a game sprite class that has a click and drag method. The method works, but there is a slight problem. If the mouse moves too fast, the ...
-1
votes
1answer
162 views

Texture doesn't draw correct

I'm writing a game using SFLM and Opengl but when I create a terrain i got some OpenGl problems. I use heightmaps to generate a terrain but when I load the texture on it the texture is not correct ...
1
vote
2answers
2k views

SFML: Generate a background image

I want to generate a background, which is used in the game, on every instance of the game based on certain conditions. To do so, I'm using a sf::RenderTexture and a sf::Texture like this: ...
6
votes
1answer
192 views

Can SFML load anything other than RGBA8888? (RGBA4444, RGB565, etc.)

I can't see this mentioned in the documentation. Am I missing something obvious? Or does SFML really give you no option, forcing everything to be loaded as RGBA8888? Searches on Google and the SFML ...
12
votes
2answers
1k views

Should I be using spritesheets, because of or despite of my vast number of images?

I am developing a 2D game, and I have a lot of sprites. I used 3D animations and models to render into 2D, to give them that "Fallout" or "Diablo" look to them. It is also easier than drawing by hand, ...