Game Development Reference
In-Depth Information
No changes were necessary to any of the UI layout configuration since we used the
approach of sizing controls based on the screen dimensions of the device. We just
need a slightly bigger sized font to fill the larger screen area better.
To make deployments easier and to reduce the overall memory size of install
packages, the Derbh API has also been used. If you look in the root project directory,
you will see two new files called skiing.dcl and skiing-highres.dcl . These files
list all the resources needed by the game and are used as input to the DZip tool to
create the archive files. A batch file called MakeDerbh.bat has also been included to
demonstrate use of the DZip tool.
Note that the Derbh archives can obviously not be created until the various .group.
bin files have been generated. In order to do this you will need to run the game
twice, once with the ResBuildStyle=highres setting set in the app.icf file and
again with this line commented out.
The two DCL files create the target archives inside the data-ram\data-gles1 and
data-ram\data-highres directories, but both generate an archive called skiing.
dz . The deployment types in the Skiing.mkb file include the relevant version of this
file so our code becomes independent of the deployment type. At the start of the
program we just have to attach the skiing.dz archive with the dzArchiveAttach
function in order to access the correct resource files.
Summary
In this chapter we have learnt how Marmalade makes it easy to organize our
resource files so that we can create different versions of them for devices of different
specifications. We only need to provide alternative versions of resources that must
be different, for example higher resolution textures. Any common files, such as
configuration and GROUP files, can generally stay the same.
We've also covered the use of resource templates to allow us finer control over
how our resources will be used in the game (for example, by specifying a particular
type of texture compression to be used) and we've seen how to make different
deployment types that include the same core code but different resource files.
Finally, we've also looked at the Derbh API to allow us to compress our resource files
to save space in the installation package.
In the next chapter we'll be looking at how we can make use of social media to allow
our players to share information about our game with their Facebook friends.
 
Search WWH ::




Custom Search