Game Development Reference
In-Depth Information
Listing 9-4. JSMemoryLog.json - Logged Allocations from the Game
{"memory_used":
[
{ "label" : "Textures", "value" : 10.0 },
{ "label" : "Models", "value" : 20.0 },
{ "label" : "Particle", "value" : 5.0 },
{ "label" : "Characters", "value" : 50.0 },
{ "label" : "Geometry", "value" : 120.0 },
{ "label" : "Collision", "value" : 50.0 },
{ "label" : "Sound", "value" : 30.0 },
{ "label" : "Scripts", "value" : 10.0 },
{ "label" : "Animation", "value" : 25.0 }
]
}
Figure 9-2. A memory threshold visualization
More on JavaScript: Live Reporting with AJAX
Statically reporting on the data generated by an application once it has completed is a very useful feature. However,
with some applications, you will be interested in the data generated by the application before it has completed its
process. To do this, you can make use of AJAX (Asynchronous JavaScript and XML). 6
6 van Kesteren, Anne. “XMLHttpRequest Level 2.” W3C. www.w3.org/TR/XMLHttpRequest/ .
 
Search WWH ::




Custom Search