I know very little about game programming but would like to learn more. I am trying to understand the code for this game. I am trying to understand why the code is passing a "delta" to Shipcontrols.js, which changes the direction of the ship based on user input.
Basically the game calculates "delta" every loop...
Here is an abbreviated version of the stack that uses delta thru one loop...
var delta = now - this.time;
this.time = now;
this.current.render.call(this.current, delta, this.renderer);
Steps into here...
ctx.manager.add("game", scene, camera, function(delta, renderer)
{
if(delta > 25 && this.objects.lowFPS < 1000) this.objects.lowFPS++;
var dt = delta/16.6;
this.objects.components.shipControls.update(dt);
Steps into here...
bkcore.hexgl.ShipControls.prototype.update = function(dt)
{
var pitchAng;
var yaw;
var roll;
if (undefined != hand){
Which does stuff like this...
if(this.key.forward)
this.speed += this.thrust * dt;
else
and this...
if(this.key.right)
{
angularAmount -= this.angularSpeed * dt;
What is the point of delta here? Is it just trying to introduce an element of randomness? The code for this game is very good. Why did this guy use delta?