Tag Info

New answers tagged

0

It's really only the creation of an object out of thin air that violates natural law, since it's the position at which the object is created that generates GPE. All forces are entropic, which is to say (in a tremendous simplification of terms) that they cause systems to evolve toward a resting state. The more starting energy the bigger the forces, and the ...


0

I've thought about it and taken some ideas from the answer from ratchet freak, and I have come up with the way I think I will do gravity. I'm going to strip away all the GPE stuff etc. so that each object falls towards other objects according to their gravitational field, rather than wasting precious CPU time working out a GPE then converting it into KE for ...


2

After some rounding errors energy will be different from one step to the next. Most physics engines just let you apply forces to objects nilly willy and don't care where the "energy" for the work it is doing would have come from and letting the programmer decide how it came about.


0

Adjust birdSpeed and pixelMovement in below code to achieve your 9.8m/s2 speed. s=0*t+1/2gt*t Public Class bird extends Actor { private float pixelMovement=30; // No of pixel you want to move bird in one touch private float birdNextPosition; //This will be used to hold next position of bird private boolean birdisMoving=false; // flag to track bird ...


-1

I decided to move everything up instead of the quad down.Not the optimal solution but perfect for my case


1

How the author specifically got that value was via experimentation. From the comments: Q: Hi James, you set acceleration.y to 460. How did you find this number? Is it static? A: Acceleration was experimentally determined. Its value does not change. And this is often the case when determining values for your game. You pick a value and play-test ...


1

You should check these for audio synthesis in C++. Check the sources as well. You may find a way to write audio buffer on the fly according to some parameters passed from physics engine. The Synthesis ToolKit in C++ (STK) NSound CSound and its resources page.


0

You can play with the physics material of your sphere (or quad, depends on which one makes more sense) in order to remove the bounciness. If you want to achieve an effect that would not normally be possible in the real life (as in following a moving platform without inertia) you will need an extra layer that will manage this between the two shapes, working ...


0

not sure how your gravity works in unity but in our jump and run we did years ago we checked if the player touched a moving platform and glued him on it unless the player jumps again. you could do this calling the physic system manually until the player touches the platform again or you just add the player in your scene graph to the platform. it was a very ...


0

i allways use something like this: if (keyboardManager.IsKeyDown(Keys.W)) { if (Math.Abs(_car.AngularVelocity) < 10f) { totalRotation = 0 -_car.Rotation; while (totalRotation < -MathHelper.Pi) totalRotation += MathHelper.TwoPi; while (totalRotation > ...


1

It's been a few years since this question was posted, but I came across it while searching, so I thought I'd update it. Google released LiquidFun (open source) for the Box2D system. It has some limitations, but it's a quick way to get started with liquid, sand, etc particles with pretty decent performance. https://github.com/google/liquidfun PixelJunk has ...


0

Should be alright if you are not using too complex shapes or too much bodies at once. If so you could reduce the Box2D frame rate ( lets say the game runs at 60 fps so you can call Box2D update on every second frame and double the ms ) or play around with velocityIterations and positionIterations to maximize performance. I actually used this trick in a ...


0

Slowing down time globally is possible, via the game.time.slowMotion variable. It defaults to 1.0, setting it to 2.0 makes things half speed for example. There's a demo on the Phaser examples page under Time > Slow Down Time. It appears that when slowed down, the number of updates slows down (i.e. movement becomes less frequent and jerky) as opposed to ...


2

My recommendation would be to approximate the surface with 2d wave simulation. That is, you have a plane and each point has a height property defined by the neighboring points and the wave equation. A google search for 2d wave dynamics algorithm gives a lot of papers and applets, so you can go crazy on that. Getting that information to a 3d model is as ...


1

Sticking to walls is a problem mentioned in this Unity learning module around 8:45, and they set the friction of the ground to zero to solve it. However, they don't address the sliding down slopes problem. Option 1: Give the character's body a frictionless rectangle collider that is just wider than the circle collider at it's feet, with its bottom ...


0

I have received help from a person on Youtube. He gave me an example, showing the code to be phy_speed_x=-10 for the object to move left or phy_speed_x=+10 to move right, whilst using physics. I was using the wrong code all along!



Top 50 recent answers are included