Simple and Fast Multimedia Library - a free, portable API that provides access to graphics, input, audio, etc.
1
vote
1answer
68 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
67 views
Procedural Tilemap generation
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
93 views
Using 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 ...
-2
votes
0answers
43 views
Having problems with collision response (SAT)
i been playing around with SAT collision, and figured out the most part. (By copying/writing codes from countless sites).
The SAT collision detection works, since it detects a collision. Now the MTV ...
1
vote
2answers
109 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
86 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
43 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 ?
0
votes
1answer
92 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
61 views
SFML Stuttering issue with Linux
I wrote a little game of a bouncing ball, using SFML and Box2D.
When running on Windows, the graphics animate smoothly. The problem is on my Linux machine. The animation stutters randomly. To be ...
1
vote
0answers
100 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
227 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 ...
0
votes
1answer
138 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
123 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
297 views
How can I load an SVG file and create a shape and collision data from it?
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
112 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
93 views
How can I align a 2D object properly using tilemap collision
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
207 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
81 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 ...
1
vote
2answers
170 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
122 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
170 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
140 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
94 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
139 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
520 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
557 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
117 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
542 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
394 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
116 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
195 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
182 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
159 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
445 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
150 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
1k 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:
...
4
votes
1answer
126 views
Can SFML load anything other than RGBA8888? (RGBA4444, RGB565, etc.)
I have tried searching google, and there's next to nothing on there.
I tried searching the SFML forums, but still have no luck.
Am I missing it in the documentation somewhere obvious? Or does SFML ...
12
votes
2answers
900 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, ...
4
votes
2answers
358 views
How would I display a unit that is hidden behind another object
Right, I've tried searching for this but as you might be able to tell from the title, I didn't really know how to word it anyway...
In some games such as rts games, when a unit is hidden or half ...
2
votes
1answer
139 views
Development with multiple libraries
I'm almost fresh to the game development and I have one question about libraries.
If I choose one library, such as SFML, to develop the menu of my game, is it possible to merge with, for example, ...
-1
votes
2answers
323 views
Shooting many bullets toward the mouse position
I try to shoot a bullet toward the mouse position by this code.
float deltaX = mousePosition.x - (aircraft.getPosition().x + aircraft.getLocalBounds().width / 2);
float deltaY = mousePosition.y - ...
0
votes
1answer
1k views
How to use C++11 chrono header for a clock
In first, sorry for my bad english. :)
I'm making a game using SFML and C++11 new features, but I've got a problem with my custom Clock class (made to replace the SFML one).
When I get the elapsed ...
1
vote
1answer
232 views
Drawing a textured 3D object breaks SFML text render
I writing a OpenGL game using SFML.
I'm using the push/pop function to combine OpenGL with SFML like the tutorial SFML+OpenGL but, when I added textures to my model, the SFML text rendering appears ...
0
votes
2answers
447 views
SFML networking rts
You will be controlling only one person directly in the game. But, you can issue vague command like to build something here or attack at this square.
So I'm trying to make a multi-player roguelike ...
0
votes
0answers
121 views
SFML programs fails to debug with glslDevil
I'm testing the glslDevil debugger with a simple (and working) SFML application in Linux + NVidia. But it always fails in the window creation step:
W! Program Start
| glXGetConfig(0x86a50b0, ...
2
votes
2answers
314 views
Framerate-independent acceleration
Is this the right way, or at least a way that works, for dealing with accelerations in variable time steps evironments?
// Pseudo-code
void onUpdate() {
mySpeed += acceleration * ...
3
votes
1answer
274 views
Jittery Movement, Uncontrollably Rotating + Front of Sprite?
So I've been looking around to try and figure out how I make my sprite face my mouse. So far the sprite moves to where my mouse is by some vector math.
Now I'd like it to rotate and face the mouse as ...
3
votes
1answer
340 views
SFML RenderWindow Unhandled Exception
So I've been following an SFML tutorial but unfortunately, it doesn't seem to be working. The tutorial shows a RenderWindow as a global variable and then accesses it like this:
LevelState.h:
struct ...
11
votes
4answers
546 views
How to determine range of possible movement in turn-based, distance-based strategy game?
I'm creating a 2-dimensional, turn-based strategy game using c++ and SFML-2.0. Movement is distance-based rather than grid-based, with several different triangle-shaped pieces that, on a given turn, ...
4
votes
1answer
444 views
C++ SFML Box2D - Somewhat confused when it comes to syncing phyisical body with a render body
While testing Box2D with SFML I encountered something which confuses me: The relation between physical body centroids and SFML's sprite origin.
As an example I have a test class GameObject which is ...