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

learn more… | top users | synonyms

0
votes
0answers
34 views

Mouse input that 'sucks in' particles

I'm having trouble figuring out the equations behind the title, I did exactly this using OpenGL's fixed function pipeline, but while transferring this over to the programmable pipeline i'm running ...
0
votes
0answers
27 views

Data structure for storing game objects in a tile based game [on hold]

This is my first time developing a game using C++, so I want to do it right. I decided to start with a tile based game since it has always seemed simpler to me. Previously the way I managed objects ...
0
votes
1answer
62 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
97 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
70 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
50 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
60 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
182 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
54 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 ...
0
votes
2answers
95 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
109 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
110 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
84 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
56 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 ...
1
vote
1answer
110 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
253 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
247 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 ...
0
votes
1answer
103 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 ...
1
vote
1answer
368 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
282 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
96 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
135 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
164 views

SFML 2.0 Too Many Variables in Class Preventing Draw To Screen

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
154 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
338 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
140 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
850 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: ...
1
vote
0answers
86 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 ...
11
votes
2answers
743 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
340 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
132 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
285 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
568 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
201 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
366 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
100 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
245 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
205 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
290 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
478 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
394 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 ...
0
votes
1answer
1k views

SFML fail to load image as texture

I have come to a problem with the code below ... Using SFML 2.0 #include <SFML/Graphics.hpp> #include <iostream> #include <list> int main() { float speed = 5.0f; // create the ...
3
votes
1answer
162 views

Sfml: Sprite scale transformation animation

Is there any way to animate a transformation on sf::Sprite like setScale or setPosition? ie: sprite.setScale(0.5f,0.5f);. I want the transition between normal and half scale be smooth. Thanks!
0
votes
1answer
326 views

What happened to sprite::setSize in SFML2?

I'm porting one of my old projects to sfml 2.0, and I had a background that I scaled using sprite.setSize(windowWidth, windowHeight) Now, it seems like setSize has ben removed in 2.0, and I'm ...
3
votes
1answer
207 views

small independent game development on a virtual machine

I've been learning about OpenGL and SFML with c++ now for about 6-8 months, and would like to work on a small little personal game to put some of my skills to the test. Now I want to kill two birds ...
3
votes
2answers
324 views

Screen effects and antialiasing

I have been working on a game for a while using glut for basic window creation. I was rendering to an offscreen buffer so that I could implement various effects like screen bulging, motion blur, ...
-4
votes
1answer
220 views

C++ SDL/SFML advancing help [closed]

I've been playing around programming using SDL and SFML for a while now and done all the basic tutorials I can find(love lazyfoo). but I'm stuck and not sure how to move on from simple games like ...
-1
votes
1answer
177 views

Drawing multiple sprites with clear screen for every frame

I googled with best of my skills, but I cannot find any relevant answer to my problem. I'm making a game with an isometric view. I need to draw multiple sprites on the screen and before switching to ...
-1
votes
1answer
299 views

I want to start making 2D Games with C++ or #C [closed]

I know C++ pretty well, I think - polymorphism, vectors, templates, and more. I also know C#. I want to program a 2D game, but not like those programs where you click a button or two, and you ...
2
votes
1answer
131 views

pytmx: issue trying to get the correct texture rectangle for sprite for objetcs on map

:D Hello :D I am currently developing a game engine. I'm using maps designed with Tiled and I placed several objects on a test map to develop the feature of loading objects as sprites/entities and ...