Timing on Different Systems with Three.js
Let's consider the effect of timing on games. Typically, all moving game objects and players/characters are updated every cycle through the game code. This means that if you instruct the game to "move a character/object by 1 unit", it will indeed move by 1 unit on every pass through your game program. Take our sun light object for example. On every frame of animation we want its height to move smoothly, so we type: sunHeight = sunHeight + 1; Just like we expect, the sun will rise smoothly, and it will work on any computing device or smartphone. That's all good, until you consider that not everyone's device is running at the same rate. A powerful desktop computer might loop through this statement 60 times a second, while a smartphone or old computer might only get around to it 20 times a second. That means that the person playing your game on their powerful desktop computer will see and feel a different game experience than the person ...