Tag Info

New answers tagged

0

I would suggest Perlin Noise to do this. Basically, generate N perlin noise values for each different factor, or, if you prefer 1 perlin noise value that gets hashed to a class (like planet, or emptiness): int x, y; // coordinates float scale; // The scale of the universe. Adjust this number to affect smoothness. float value = Perlin(x * scale, y * ...


2

I was going to type up an answer, but then I found this article, which seems to be exactly what you need: http://www.iforce2d.net/b2dtut/constant-speed I'll copy a few of the relevant bits. This assumes C++, but it's certainly applicable to any language. [...] in other situations you might want it to start and stop instantaneously. It is very tempting ...


1

Correct me if I'm wrong, but I believe the density of fixtures will affect the mass of the body. Anyway, the only settings that affect the "bounciness" is restitution. If changing the restitution of the box doesn't fix it, have you tried changing the restitution of the ground (or whatever the box shouldn't be bouncing off of)? If that doesn't work, as far ...


1

I believe the problem is that you're assuming that the ball is at a constant speed throughout the time step. The relevent parts of your code are: ball.y += ball.y_speed * deltaTime / 1000; ball.y_speed += 1.5 * deltaTime; Unfortunately, this method only gives an approximation of the position, and this is why you are seeing errors. You are not taking into ...


0

Try basing your calculations on system time if you want it to be non frame-rate dependent. The only thing I can say is that basing the movement calculations on frame-rate should mean that if the frame rate drops then then the ball should slow down with the frames. I have done something similar to this before and what I did is each gamestep or MainUpdate ...


2

Part 1: Interpolation: Interpolation let's us approximate something that already happened. Multiplying "trick" (which is just math) is to mix the previous state with the current state by a certain percentage. If previous was dark and now is bright, we assume in the middle it was grey. So if for example we take a moving train. We know that right now it is ...



Top 50 recent answers are included