Simple and Fast Multimedia Library - a free, portable API that provides access to graphics, input, audio, etc.
0
votes
1answer
38 views
SFML game loop and FPS problems
first off, sorry if this is a silly question.
I've been working on building an SFML engine and I've been very confused on the FPS, frame independent movement and game loop.
Here's a link to where ...
0
votes
1answer
39 views
Sorting sprite's layers in isometric view
I'm making a strategy game with isometric view and I'm having some problems with deciding which sprite should be drawn first (I'm using SFML 2.2 as graphic library).
I'm using std::sort to sort ...
1
vote
1answer
58 views
C++ Frogger game - Logs on Water bounding boxes?
I am making a Frogger game in C++ using SFML but have come across a problem.
I have a block of water and log rectangles moving over it (All sprites) and would like the Frog sprite to do something when ...
0
votes
1answer
26 views
Extra sprite spawning when the enemies are redrawn SFML
I am making a game in sfml and at the moment when all of the enemies die. They are set to respawn however when this is happening they are respawning with one extra sprite than before.
The code for ...
0
votes
1answer
19 views
Moving a Sprite using Mouse in SFML (setOrigin logic needed)
I trying to make a card game using SFML. I want to move the card relative to the position the player selects on the card. I managed to check if the card is pressed. However, when I click and drag, the ...
0
votes
1answer
61 views
Handling (spawning/removing) entities in SFML
I am unsure which method to use to handle my enemies in SFML.
The idea that I am trying to recreate is to spawn enemies every so many seconds. Initially I wanted to do this using a vector such as ...
1
vote
1answer
96 views
How can I do sprite batching in SFML?
I'm new to game dev and using SFML. I need to use lots of sprites at the same time, so I will probably need sprite batching.
I know that sprite batching is used to draw multiple sprites with a single ...
1
vote
1answer
70 views
How can I hide game asset files in my release build?
My SFML 2.0 release build has a file path to game assets relative to the .exe file, so folders such as Fonts, SoundEffects, etc. are explicitly listed in Windows Explorer with the .exe. I'd like to ...
1
vote
2answers
72 views
How do I create and implement a sprite sheet for my SFML game?
I have a game I am currently working on, and I have created 6 16 frame animations for my player character. Currently each of these are saved as seperate .jpg files, which are about 1.5x bigger than I ...
0
votes
0answers
63 views
Preferred way to integrate box2d with SFML
I'm trying to integrate Box2D with sfml. My current solution is to have overloaded functions creating sfml shapes from box2d fixtureDef shapes. I store created sfml shapes under the name 'visual' in a ...
0
votes
1answer
70 views
Drawing faded lightmap in 2D polygon
I have been making a 2D visiblity algorithm by following this tutorial http://simblob.blogspot.se/2012/07/2d-visibility.html
I have managed to create the light vertices and it works fine when I draw ...
0
votes
1answer
36 views
Using Box2D for soccer physics
I've learned quite a bit of Box2D and I've succeeded basic stuff concluding ball physics.
I want to implement 'opposing forces', as the character kicks the ball with a certain strength, with the leg ...
0
votes
1answer
46 views
How do I center the view around specific coordinates in SFML
I want to use sf::View in SFML in order to change the position of the view, such that the player sprite is always in the center of the screen. Thus I want to write a function which allows me to input ...
0
votes
1answer
50 views
Can I display text in SFML without setting a font?
I'm trying to render text without setting a font.
#include <SFML/Graphics.hpp>
#include <iostream>
using namespace std;
string culoare;
int main()
{
sf::RenderWindow ...
0
votes
1answer
55 views
SFML - How do I create an OpenGL context before showing the window?
I want to create an OpenGL context to initialize some assets before actually showing the window with SFML. How can I do this?
1
vote
1answer
120 views
Static SFML 2.2 libraries and Code::Blocks on windows 7 [closed]
I am starting to program games for the first time, but I've been doing general programming for a couple years now. I have Code::Blocks, which I am fairly comfortable with, but now I am struggling with ...
0
votes
0answers
85 views
Scrolling background loop however produces little gaps
I have myself a parallaxing background, i'm using SFML to render my background, I have myself 3 sf::Sprites, each sprite has the width of 576, I create myself 3 sprites with x positions 0, 576 and ...
0
votes
0answers
123 views
Alternative to a timer in a separate thread in a turn-based game
I'm making a 2d turn based game and I'm having some difficulties with the timer itself.
3 characters vs 3 characters, two players. A timer giving them a chance to preform acts within a set amount of ...
1
vote
1answer
351 views
Problem with update/render in game loop (scrolling view, render interpolation)
I use SFML 2.2 and program a 2d prototype game (2d mario style where the camera follows the player).
I am experiencing the buggy imagery during rendering, for example a chunk of vertex array blocks ...
0
votes
0answers
57 views
SFML - Rendering a torch with a fire animation [duplicate]
I have coded a 3D maze simulator in SFML using raycasting. However, I want to add a torch to the screen, so that the lighting seems more realistic. From my understanding, I would have to use ...
0
votes
0answers
88 views
C++ - SFML - OpenGL - GLSL - smooth waving texture
I have this shaders:
Fragment:
uniform float time;
uniform sampler2D texture;
void main()
{
float t = time;
vec2 aux = gl_TexCoord[0].xy;
// This would also make waving/deform the ...
0
votes
2answers
179 views
Collision Direction Detection
I'm making an RPG game where players and enemies can collide with walls.
Right now it pushes the player off the wall when he tries to 'go through' it.
However, I detect which way he should be pushed ...
1
vote
1answer
68 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 ...
2
votes
0answers
198 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
1answer
116 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
341 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
122 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
107 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
114 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
248 views
GLSL- How to change a certain color of a sprite, to another color passed into the shader?
There are sprites, with certain pixels being bright pink, and a shader dyes these pink or grayscale pixels to a custom color determined by the player. For example, a character looks normal except for ...
0
votes
0answers
85 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
145 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
49 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
87 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 ...
1
vote
2answers
393 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
280 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
114 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
92 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
180 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
218 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
254 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
354 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
265 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
145 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, ...
1
vote
1answer
483 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
134 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
261 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
122 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
258 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
132 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 ...