Book Image

Sparrow iOS Game Framework Beginner's Guide

By : Johannes Stein
Book Image

Sparrow iOS Game Framework Beginner's Guide

By: Johannes Stein

Overview of this book

Table of Contents (20 chapters)
Sparrow iOS Game Framework Beginner's Guide
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Afterword
Index

Managing our assets


Now that we know what assets are, how can we manage them for our game? Before we get to that, let's take a look at what we know so far and what the prerequisites to effectively load assets are.

Firstly, we know that there are different kinds of assets that can either be plain text files or binary.

One thing to keep in mind is the memory in mobile devices nowadays. While it is the same as the memory in desktop devices from a few years back, not all of this is reserved for our application. We should also keep in mind that the size of an asset on the disk may not be the same in memory as it is for compressed files, especially if the file content is compressed on the disk but has to be uncompressed in memory.

Consequently, there are a few things we can do, which are as follows:

  • Limit the number of assets we are loading; this can prove difficult as a game can require a high amount of assets

  • Limit the number of assets that are currently loaded in memory

  • Cache assets that are already...