-
Notifications
You must be signed in to change notification settings - Fork 0
Loader
In general, a loader is the part of a system that is responsible for loading programs and libraries. It is one of the essential stages in the process of starting a program, as it places programs into memory and prepares them for execution. In our case the loader gives 2 basic functionalities. The first and most important is loading the game assets from the web onto the client browser. The second is to assign a name to each resource, making it easier to work it during the development of the game.
The loader interface will have methods to load the 3 most used types of files in game: images, audio and data ( json objects ).
For the sake of controlling loading times, instead of loading one file at a time, loaders use to have a loading queue that only loads the files on it when an event is fired or the user specifies it. The interface will have a start method which will start loading the files and return a promise that will be resolved after all the elements are loaded.
##Interface
loaderInterface = {
initialize : function( game ){...},
start: function(){...},
image: function( name, url ){...},
audio: function( name, url ){...},
json: function( name, url ){...},
getResource: function( name ){...},
}
//TODO separar las interfaces y modulos en una estructura de carpetas como la del trabajo
#Index