Hey again :>
The problem is my 2 bodys Ammo and Player move in the same Speed ?
It's with SFML
Ammo Update(every frame)
Player Move(on a frame with input = true)
World Step every Frame
GetFrameTime:
How can i make it so that the 2 body move in different speed? Ammo faster as player 😉
The problem is my 2 bodys Ammo and Player move in the same Speed ?
It's with SFML
Ammo Update(every frame)
Code:
float xv = cos(Angle);
float yv = sin(Angle);
AmmoBody->ApplyForce(b2Vec2(xv*1000000,yv*1000000), AmmoBody->GetLocalCenter());
float yv = sin(Angle);
AmmoBody->ApplyForce(b2Vec2(xv*1000000,yv*1000000), AmmoBody->GetLocalCenter());
Player Move(on a frame with input = true)
Code:
PlayerMoveMagnitude = 100000
PlayerBody->ApplyForce(b2Vec2(-PlayerMoveMagnitude,PlayerBody->GetLinearVelocity().y), PlayerBody->GetLocalCenter());
PlayerBody->ApplyForce(b2Vec2(-PlayerMoveMagnitude,PlayerBody->GetLinearVelocity().y), PlayerBody->GetLocalCenter());
World Step every Frame
Code:
float ElapsedTime = App->GetFrameTime();
World.Step(ElapsedTime, 10, 10);
World.Step(ElapsedTime, 10, 10);
GetFrameTime:
Quote:
float sf::Window::GetFrameTime ( ) const [inherited]
Get time elapsed since last frame.
Returns:
Time elapsed, in seconds
Get time elapsed since last frame.
Returns:
Time elapsed, in seconds
How can i make it so that the 2 body move in different speed? Ammo faster as player 😉