Game Development Reference
In-Depth Information
/img
Inside this folder we store all the image assets used in the game. Since all of these
images are rendered inside a canvas, we could have very well combined all of the
images into a single image atlas. This would be a very nice optimization, especially
as the game grows and the number of image assets grows. Since most browsers
limit the number of parallel HTTP requests that an application makes to the same
server, we can only fetch a limited amount of images at the same time. This means
that if there are too many individual image files being fetched from the same server,
the first 4-8 requests are processed (the default number of parallel connections to
the same server varies from browser to browser but is usually around 6 or so) while
the rest of them wait in a queue.
Thus, it is easy to see how creating a single image atlas asset is a much better
choice over downloading multiple individual image files. Even if the total image file
size of the atlas is greater than the total size of all the other images combined, the
big gain is in the transfer latency. Even if the game doubles in individual image as-
sets at some point in time, we would still only have to download a single image atlas
(or a few separate atlases which can all be downloaded simultaneously).
Note
Since not everybody is highly talented when it comes to creating awesome look-
ing graphics for your games and even fewer people have the time to create each
image to be used in the game. Many game developers find it worthwhile to buy
graphics from digital artists.
In this game, all of the graphics were downloaded from websites where artists
share their creations for free or very low costs. The website address to this won-
derful community is http://opengameart.org .
/js
As mentioned earlier, this game is built on a component-based model. The file struc-
ture is divided into four main categories; namely components, entities, widgets, and
general purpose code. Each of these pieces of code are meant to be somewhat
Search WWH ::




Custom Search