Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - davidweschler

Pages: [1]
1
General discussions / Re: BOx2d with SFML
« on: June 16, 2024, 08:44:13 am »
I'm attaching a video that shows part of the problem, i need to use Box2D because its part of a project in University.

Also, here's the movement code:

void Player::move(sf::Time time)
{
        b2Vec2 boxPos = getBox()->GetPosition();

        auto dt = time.asSeconds();

        getBox()->SetTransform(boxPos + b2Vec2(VELOCITY * dt, 0.0f), getBox()->GetAngle());
        setPosition(sf::Vector2f(boxPos.x * 30, boxPos.y * 30));
}

2
General discussions / BOx2d with SFML
« on: June 15, 2024, 10:39:29 pm »
Hi everyone!
i am building the game 'Geometry Dash' using Box2d (in c++ and SFML of course), and my the movement of the player is very choppy.
I tried everything- erasing the Box2d part in the code, playing around with the framerate, using m_window.setVerticalSyncEnabled(true); , different ways to use the setp() func and different ways to handle time, but nothing seems to help!
In addition, i noticed that the Behavior of the player is different when i run the program on different computers, but its never smooth.
Does anyone have any idea what might be causing it? i'll take any advice at this point.
thanks!
David

Pages: [1]
anything