Tag Archives: patterns

cocos2d meets MVC – wrap up

This post is going to be short. If you have any questions regarding the previous parts or something is unclear please let me know. I have some contract projects going on (which going to be HUGE!!!) so not so much time for blogging. To wrap up the previous parts: We implemented the Model which helps [...]
Posted in idevblogaday, iPhone | Also tagged , , , , , , , | 2 Comments

How to implement MVC pattern in cocos2d game–part 2

My last post about implementing MVC pattern in cocos2d was definitely lacking some code examples. I must admit – I was writing it on my PC notebook when I was on a business trip and I didn’t have an access to my game source code. This is a follow-up post to the previous one, so [...]
Posted in iPhone | Also tagged , , , , , , , | 45 Comments

How to implement MVC pattern in cocos2d game

Model-View-Controller (MVC) is a widely adopted pattern for handling user interface interactions in web based applications. Web development stacks such as Ruby On Rails, Django or ASP.NET MVC are different approaches to MVC in web development on different platforms, but all of them share the same main principle – separation of domain logic from the [...]
Posted in iPhone | Also tagged , , , , , , , , | 12 Comments

3 ways to implement Singleton pattern in Objective-C

Singleton pattern is used when you need to ensure that only one instance of a class can be instantiated and you need a global access to it. The most widely used implementation of this pattern in .NET is the following (from MSDN): public sealed class Singleton { private static readonly Singleton instance = new Singleton(); [...]
Posted in iPhone | Also tagged , , , , , | 1 Comment

How to preload your game assets in loading scene

If you are building a game for an iPhone then most probably, at some point of time, you will realize that you need a loading screen in which some (or even all) of your game assets should be preloaded. If you are not going to preload it but rather load it on demand, then you [...]
Posted in iPhone | Also tagged , , , , , , , , | 21 Comments