What design pattern to use for 2D iPhone games?

To tell a little about the game: falling objects float from above, and the goal is to click / move another object to hit them. If an object hits the ground, you lose your life and get points for hitting falling objects.

That's where I'm a little confused. In the development of O'Reilly iPhone games. They claim that AppDelegate inherits the object of the game’s final machine and has a main game loop in the App Delegate. Nothing about MVC.

I was going to use MVC. I have all the objects identified for the models, and was going to use one controller to update each model and the corresponding view. Then in the application manager there should be a navigation controller, and on the main screen - some controllers (Play, instructions, statistics). Then run the game loop in my gameViewController. By the way, I use Chipmunk as a physics engine.

This is my first game, so I'm a little confused. I would really appreciate any advice on how to proceed. I would like to get an object oriented design from the very beginning before moving on to the code.

+3
source share
3 answers

MVC - . , , . . , . Brain Brain. , .

- , . , . . , , ( ). , , .

iPhone, . ' , , , .

[NSThread detachNewThreadSelector:@selector(GameLoop:) toTarget:self withObject:nil];

( " " ), ( " " ).

, , - . iPhone . touchsBegan touchs.End , InputManager. InputManager .

+1

, ? O'Reilly, , , , MVC.

MVC , . "" MVC , -... , .. , , , , script, , , -. , .

It is not uncommon in an iOS application to delegate an application to an instance of a model. Then you have view controllers that know how to talk to the model and translate the data it provides into something that can be displayed in the views. If some of the data that the model provides are graphic elements, such as textures or meshes, everything is fine ... this is the data that the game works in the end.

0
source

All Articles