Tag Info

New answers tagged

1

The issue is the else condition after you check the A and D keys, since if no key is pressed it will reset the direction to 0, 0 every time the update() method is called. Instead of calling moveLeft() and moveRight() in the touchDown and touchUp you should keep track of each pointer passed by the touchDown and touchUp methods and check whether the pointers ...


2

You could define how these would affect the character and add flavor text. If you group them into something like biomes, you can randomly select a few at a time for each battle depending on where the battle takes place. For example, if you has just two attributes - Offense and Defense: "Rocky Biome" : { "Rock : { "Take cover behind rock" : { ...


0

The construction given is one parameterized by h - so you solve for h in terms of an additional constraint on the general solution given. As noted in the linked answer: where values of h > 0 correspond to arcs turning to the right/clockwise from A to B, and < 0 are arcs turning left/counterclockwise (assuming x+ points right and y+ points up - ...


7

To put it simply - winding order. Winding order is the way you define which side of a triangle is the front and which side is the back. For example, OpenGL's default winding order is counter-clockwise, which means the triangle on the left is pointed out of the screen and the triangle on the right is pointed into the screen. If you had back-face culling ...


0

If you accelerate for half the journey and then decelerate at the same rate for the remaining half you will come to a stop at your destination. Did you mean for the velocity to be exponential? That implies a variable acceleration, which is not very realistic. If this is what you intend then just apply the same logic to jerk (which is the derivative of ...


1

On LibGDX you have a so called InputProcessor public class MyInputProcessor implements InputProcessor { @Override public boolean keyDown (int keycode) { return false; } @Override public boolean keyUp (int keycode) { return false; } @Override public boolean keyTyped (char character) { return false; } ...


3

There is no usual way. It all depends on how precise you want your simulation to be. A very cheap way: You can improve on this by using it as a starting point and then adjusting the position more realistically. To rotate the vehicle as it moves have each wheel rotate the car by using its opposite wheel as the pivot point. If it becomes too ...


3

Just about the easiest way to do this is to calculate the cars position from the road, and it's rotation with the normal of the road, like you mentioned yourself. This will cause your car to stick to the road even if you create an abrupt fall in the road however. To solve jumps on the road you either have to simulate falling yourself by keeping track of the ...


0

I may have misunderstood what do you want to do. However, if you know the initial velocity, you can set an acceleration with inverse direction. For example, if velocity is 10 you can set an acceleration -1. Continue to decelerate until the minimum velocity is reached, which is 0. Your velocity will be unlikely to equal 0, so you have to check a change of the ...


0

You could just stare the roll value before each transform.LookAt(bezier(waypoints, handles, lookAhead)); And then just adjust the roll value as you want in a separate algorithm and then reassign it to the airplane's roll. The Euler roll 0 is always straight and 360 = 0. So the questions drictly: Use a quaternion and do a slerp to rotate to that ...


2

One simple options is to just draw everything twice. Consider a screenful of your background clouds and other stuff that you want to scroll: +------+ | CC | | RR| +------+ (Assume that CC represents a cloud, and maybe RR represents a rock or some other background object.) If you have a "second copy" (logically or physically) of this background ...


1

Simple, give the monster a hspeed, vspeed speed components, after that find the direction to the next point in the path with the tangent, which if I recall correctly would be y2-y1/x2-x1, being x2 and y2 the point of the next position and x1 and y1 the monster one. After that use the cosinespeed to find the x component or hspeed and -sinespeed for the y ...



Top 50 recent answers are included