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

Understanding the basics of Sparrow


Sparrow is a game framework that might feel familiar to those who already have some experience with ActionScript, the Flash API, and/or Starling. The familiarity to Starling is not a coincidence; the core development team of both Starling and Sparrow are the same. Starling could be considered the ActionScript version of Sparrow. We will delve into these aspects once we use the different features of Sparrow in detail.

Open Graphics Library for Embedded Systems (OpenGL ES) is a graphics renderer for mobile devices which is available on all kinds of devices ranging from iOS devices to Android devices and even consoles such as OUYA. OpenGL can be seen as the older and bigger brother of OpenGL ES. OpenGL itself is available for all desktop platforms such as Windows, Linux, Mac OS X, and next-generation consoles such as the PlayStation 4.

OpenGL and OpenGL ES are the kind of libraries that let us perform magic on the screen, be it drawing textures, or having some kind of geometrical shapes or particle effects on the screen.

Sparrow abstracts all the OpenGL components away from the developer. We don't have to worry about the inner workings of OpenGL at all. Sparrow fully concentrates on 2D rendering and puts it into a bunch of logically structured classes and methods. While the choice for performance-heavy graphics applications is usually C or C++ as far as programming language is concerned, Sparrow uses Objective-C to keep it familiar for Mac and iOS developers.

Sparrow is not only a 2D graphics engine, but it also provides the functionality to create animations on the screen—ranging from simple effects such as fading objects in and out to more sophisticated actions such as moving a ball from the left to the right of the screen with a bouncing animation. This mechanism is also referred to as tweening.

Apart from graphic-related features, Sparrow also gives us the means to load audio files and play music and sounds in our games.

When directly compared with other game frameworks, Sparrow does not impose a specific workflow on us. As a result, a few things need to be set up by hand, such as structuring all the needed assets for our game and managing our scenes.