Categories
71squared.com class development game iphone programming singleton WordPress

iPhone Game Programming – Tutorial 7 – Singleton Class


This is a small tutorial on how to create and use a Singleton class. Whilst I’ve been creating these tutorials it has become clear that managing state is important in your game. The ability to manage both the OpenGL state locally and also any state related to your game is a key building block for a game.

The Singleton pattern is a design pattern that is used to restrict the number of instantiations of a class to just one object. For our purposes we are going to use it to control state information we want to make global and share throughout our game, or at least available to other objects which want to get state information.

This tutorial covers the creation of a simple Singleton class and how it is implemented to provide state control of the currently bound OpenGL texture. I will be using this Singleton class in coming tutorials to help manage any state which is why I’ve done this tutorial to get the concept introduced.
Check out these cool WordPress plugins! – CodeRevolution.

Categories
71squared.com game iphone programming Tutorial WordPress

iPhone Game Programming – Tutorial 5 – Animation Class


Tutorial 5 is now uploaded and ready to view and runs for around 37mins. This tutorial covers the Animation class which allows you to specify a series of sprites which are displayed on screen in order. This class allows you to add any number of frames to an animation and also specify how long each frame should appear, so, rather than having every frame only appear on screen for the same period of time, each frame can have its own display time.
The class also supports the ability to repeat animations and ping pong backwards and forwards.
Check out these cool WordPress plugins! – CodeRevolution.

Categories
71squared.com development game iphone programming WordPress

iPhone Game Programming – Tutorial 2 – Image Class


I have finally been able to upload the second tutorial on writing a game on the iPhone using OpenGL.

This Tutorial has turned out to be longer than I thought and comes in at around 1.5 hours. It covers the creation of an Image class which wraps around the Texture2D class and functions which I think would be useful in a game such as scaling, rotation and applying a colour filter and alpha etc. This image class will form the basis for the next tutorials where we will create a class for handling sprite maps, animation and bitmap fonts.
Check out these cool WordPress plugins! – CodeRevolution.