Game Development Reference
//double sx, sy, sz mapped to short
//double tn, bs, ct mapped to byte
sht = key->frame;
if (key->linear) sht |= 0x8000;
WriteShortVector(ar, key->x, scale, key->y, scale,
WriteShortVector(ar, key->h, scale, key->p, scale,
WriteShortVector(ar, key->sx, scale, key->sy, scale,
byt = (char)(key->tn * 128.0);
byt = (char)(key->bs * 128.0);
byt = (char)(key->ct * 128.0);
Strategies for delivering content quicker
If you have experienced the Internet via a dial-up modem, then you will
know it can be very frustrating.
For many users this is the way they will see your content. You owe it to
them to deliver this content as quickly as possible. We can approach this
in one of three ways.
Using loading scenes
The simplest technique is to use loading screens. By keeping loading
screens small, the browser will at least be able to display some content.
If the loading screen includes game play instructions, then this can keep
the user occupied while the actual content downloads. A useful method is
to load the main character while the user is reading game instructions.
When the main character is loaded you can switch to a scene where the
main character can be displayed, often including some animation. This
could be used to provide some background to the game while the first
environment loads. As the navigation through the 3D environment
evolves, you may need to return to the main character scene or the pre-
loader if your code detects that resources are not yet available. It is a very