14 questions
1
vote
0
answers
56
views
Outline Position in pool game
I'm developing a pool game using SFML and Box2D, and I'm currently facing an issue with creating the cue ball outline when the player aims. I have three rays that are cast: two black ones and one ...
0
votes
0
answers
61
views
problems with displaying sfml textures
I have created a kind of framework for a game that combines box2d and sfml. All game scenes are stored in the Game class. The scenes also contain information about static and dynamic objects: ...
0
votes
1
answer
355
views
Box2d Raycast C++. Always returning false? (trying to check if player is grounded)
I'm trying to add Box2d to my C++/SFML platformer game. I have my ground tiles with a b2staticBody. And the player character is b2_dynamicBody.
My usual method to check if player is grounded is to ...
0
votes
1
answer
1k
views
What scaling system to use in Box2d?
I'm worried about this Caution box from the Box2d manual:
Box2D is tuned for MKS units. Keep the size of moving objects roughly between 0.1 and 10 meters. You'll need to use some scaling system when ...
0
votes
1
answer
3k
views
SFML with Box2D
I'm using SFML and Box2D to create an application that spawns circles, triangles and rectangles at the current mouse point when the user presses the C, T, and R keys. The problem is that the shapes ...
-1
votes
1
answer
193
views
Game crashes when trying to access function inside of a class, inside of a vector
So, I have a object, inside of a vector and I'm trying to call a function in that object :
...
0
votes
2
answers
192
views
sf::RectangleShape's position is not same as I set it to
When I try to print my box.getSfShape()'s position it does not print out the position I set it to have.
( The box.getSfShape()'...
2
votes
1
answer
1k
views
Why do my Box2D bodies not fall, even though world.step is called?
I have SFML set up with a Box2D world that has gravity, but my bodies won't
move. I std::cout'ed the position of the body in the game loop, but it's always at <...
0
votes
0
answers
80
views
Trying to get Box2D bodies to fall [SFML, Box2D, C++] [duplicate]
As the title says I'm trying to make my Box2D body to fall, but it won't work.
It just stays at the same position.
Sorry for the long codes but I have no idea where I'm doing something wrong, so I ...
1
vote
1
answer
627
views
Box2D - Platformer tiled map problem
I'm using C++, Box2D and SFML.
I convert a Tiled map to world in my platformer game and I get stuck when I go against a block when I go forward like that :
I can use a circle as foot of my character ...
-1
votes
1
answer
895
views
C++ SFML and Box2D: Move world or move player?
I'm currently making a top-down shooter game and it's my first time developing with SFML. I came across and issue and I want to know if there is a better way to solve it.
I need to get the "camera" ...
1
vote
1
answer
488
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 ...
5
votes
1
answer
2k
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 ...
1
vote
1
answer
771
views
How to form a concave shape out of convex shapes? [closed]
I'm trying to get around the rule of only being able to form convex shapes in the SFML C++ library.
To do this I'm planning on testing given vertices, and if concave,
splitting the vertices into ...