使用MVC设计iPhone游戏时的最佳做法? [英] Best practices when Design iPhone Game with MVC?

查看:87
本文介绍了使用MVC设计iPhone游戏时的最佳做法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经为iPhone制作了两款游戏,第一个是一团糟,第二个虽然不那么混乱,但仍然不够完美.

我很想听听是否有人在使用MVC制作游戏时是否有指向优秀班级组织建议的链接?

解决方案

您的控制器是将所有内容结合在一起的粘合剂,它是MVC三重奏中最少可重用的.您应该集中精力使视图和模型具有可重用性.控制器处理所有特定于游戏的操作.这些模型是控制器操纵的.

也不要为将来设计,只准备好一个良好的基本设计,并在坚持该设计的同时尝试进行编码.不要克制重构.

以正确的方式实施MVC 上看到我的问题. /p>

I have made two games for the iPhone already, the first one was a mess, and the second one is less messy but still, not perfect.

I would love to hear if someone had some links that pointed to good class organization advice when creating games using MVC ?

解决方案

You controller is the glue that holds everything together, it is the least reusable out of the MVC trio. Your views and models are what you should concentrate on making reusable. The controller handles all of the game-specific manipulation. The models are what the controller manipulates.

Don't design for the future either, just get a good basic design in place, and try to code while sticking to that design. Don't refrain from refactoring.

See my question on Implementing MVC the right way.

这篇关于使用MVC设计iPhone游戏时的最佳做法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆