Tag Info

New answers tagged

1

What's the context? For UI, it's very sensible to poll per-frame, especially for cases where the UI and the game simulation have no good reason to be tied together, e.g. highlights when you mouse over a selectable object. For control of a character or the like inside the game simulation, this advice can be flipped. Consider batching up all inputs for ...


0

It depends on what you want to do, whether it's GUI-like or game-like. Most game situations only care about where the mouse is right now, so you go through all the mouse move events and simply act on the last one. This would be per-frame. One example is using the mouse to look. However, there are some GUI-like situations where the intermediate mouse ...


1

In the first function, the division will be integer division and the result of the division will be casted to double. It is thus equivalent of return (double)(System.nanoTime() / 1000000000); So for example if the System.nanoTime() gives a value of 142154, the getTime() will return 0, because in integer division the fractions are ignored. 142154 / ...


0

I am working on an OpenGL Shader Engine from www.MarekKnows.com and the framework is setup as follows: An Engine Class that is part of a static library with other helpful and important classes. Then there is the main startup project where the Game Class resides along with Game Properties. This structure is to keep all Engine code separate from Game code. The ...


2

Basically, what a hashmap does is store the objects in a random location in your memory. Complexity is O(1) which means that it will always take the same amount of time to retrive an object from the hashmap. The amount of time depends on various factors. This might be quite fast for few objects, but as soon as you start drawing scene with hundreds of ...


1

It's hard to tell for sure from the information given but it sounds like what you are trying to do is make the client and server run deterministic code such that if they start with the same starting state and process things on the same loop numbers that they will result in the same values for the same calculations. Is that correct? One thing you are doing ...


1

LibGDX is formally a Framework and does implement the game loop for you. getDeltaTime() does smooth out over a number of frames. Instead you could use getRawDeltaTime(). I have seen some people get smoother results by capping the framerate to 30/60 instead of using getDeltaTime.



Top 50 recent answers are included