Tag Info

New answers tagged

0

I have found the solution to this somewhere else. Adding a bigger if statement such as this : private int elapsedTime = 0; //Declared at class level public override void Update(GameTime gameTime) { elapsedTime += gameTime.ElapsedGameTime.TotalMilliseconds; if (elapsedTime > 500) { elapsedTime = 0; birdbox3.X += 5; birdbox3.Y -= 5; ...


0

You should update the relativePosition inside your FixedUpdate function. If you don't the behaviour will have different results depending of your FPSs.


1

Box2d has a body type that fits your need: KinematicBody. Kinematic bodies aren't affected by collisions, you programmatically set their velocity from outside of Box2d. Also you can directly set their positions, instead of manipulating their speed, though it's not recommended. In case when you set kinematic bodies' speed, their position is still controlled ...


1

One way to do this is create a kinematic body for each dynamic body as a 'shadow' body, with exactly the same fixtures. After very time step, set the position, angle, linear velocity and angular velocity of the kinematic body to match that of the dynamic body it is shadowing. The original dynamic fixture should be set to not collide with its own shadow ...


2

One way you could do it is by simulating it as a grid of particles and springs, and then performing physics on each of the particles. For each filled pixel, if it has a filled neighbor pixel, add a spring with a rest length of 1 pixel, and a fairly high spring constant. Each filled pixel has a velocity, position, and mass. At each timestemp, move all of ...



Top 50 recent answers are included