My answer is not following the waterfall methodology response you were looking for because I think you will need to learn the skill of game programming before you can plan, design, implement and test it. Game programming is VERY different to business programming and a whole other field in and of itself.
Due to your lack of experience in programming games there are a few concepts that you will need to learn before you can program a game period, let alone one on the iPhone.
Some of these things will depend on whether you are programming a 3D game or going for the 2D platform style.
OpenGL ES The first thing you will need to learn is the OpenGL ES programming language. This is basically a 3D API which enables you to do drawing of 3D primitives. You will still need to use this if you are coding a 2D game as it is quick due to using the GPU for acceleration. There are some good tutorials on the Google that you should begin with.
Vector Math If you are doing anything 3D, you will need to learn about 3D vector math, vectors are basically used for everything in games, camera look direction, position of characters, speed, collision detection, etc. 2D vectors (x,y) minus the z component are still needed for 2D games programming.
Collision Detection How do I know when my ball hits the wall? The answer is collision detection. There are many forms of collision detection such as Sphere to Sphere, AABB, OOBB, Convex Hulls, Triangle Mesh, etc.
AI How do I get the enemy to attack my player character? Artificial intelligence is another large field essential to give NPCs/Enemies the ability to make intelligent decisions. AI can be simple such as if else statements but usually requires Finite State Machines or Fuzzy logic to be effective.
Pathfinding If you want to move a character from Point A to Point B while avoiding enemies and moving obstacles, you will need to use a pathfinding algorithm. A Star (A*) is one of the most popular.
Scene Graph If you wish to have 10-20+ enemies on screen at a time, you will need to code a scene graph to manage the dynamic drawing, logic and creation and deletion of resources. If you don't know what polymorphism is you will need to know it as it is essential for your game objects to adhere to and it ties in with the scene graph.
Physics Position, Speed, Acceleration, Gravity and Rays are all represented using vectors and you may need to brush up on your physics math in order to code any game. Start with Newton's Second law of motion F=MA (Force = Mass * Acceleration). An open source physics engine such as Bullet, ODE, Newton, Tokamak will make things easier, meaning you won't need to write these physics rules yourself.
Objective-C++ This is optional although recommended. If you don't know C++ this is essentially a mixture of C++ and Objective-C. I tend to use C++ for the core game engine and programming because of the speed of C++ and availability of third party libraries in C++.
Sound If you need sound you can just go ahead and use the simple audio frameworks that Apple provide, however 3D positional audio is going to require something better. I would recommend learning the FMOD SDK for iPhone. As @Stowelly mentioned, FMOD requires a license for commercial distribution but there are others you can look for which are royalty free.
Use a Game Engine There are game engines available for the iPhone at the moment which will make it much easier for you to get a game going, in your case this will be faster although you will still need to learn the concepts I mentioned above.
Here are some game engines I know of:
Unity3D This probably the most popular one that I know of. Unity is a PC/Mac game engine that lets you write code on the Mac and compile for Windows/Linux/Mac OS X. I doubt the iPhone building is compatible directly with other platforms, I would imagine you'd be restricted to iPhone if you started a new project. This engine does however have a commercial deployment cost of $199-$399.
Cocos2D This one is an open source 2D game engine that might be useful for a lot of games. Worth taking a look at. Hosted on Google code.
The main difference between business apps and games, especially on mobile devices, is the importance of performance. An app that puts up a form and waits for user input probably isn't doing anything in the meantime. A game loop, on the other hand is going all the time and probably doing alot. Business programmers are not used to thinking in these terms, but games draw down battery power and, believe it or not, how you implement your game will have a great effect on how quickly that battery is drawn down.
So, one question is, what is this game that you "have to" develop? If it is sudoku, no worries. If it's a real-time 3D space battle, that's another story.
If your business apps were on the iPhone, then you probably used 100% Objective-C. (If you were doing C# or Java apps on desktops, then welcome to managing your own memory.) There are those who will tell you that the runtime type management of Objective-C is too slow for complex games. People certainly make OK games using it with Cocos2D and other engines, but again it depends on the game. There are professional developers who will only work with C++ or even straight C.
发布评论
评论(2)
我的答案不是遵循您正在寻找的瀑布方法响应,因为我认为您需要先学习游戏编程技能,然后才能规划、设计、实现和测试它。 游戏编程与商业编程以及其本身的整个其他领域非常不同。
由于您缺乏游戏编程经验,因此在对游戏周期进行编程之前,您需要学习一些概念,更不用说在 iPhone 上进行编程了。
其中一些事情取决于您是在编写 3D 游戏还是追求 2D 平台风格。
OpenGL ES
您需要学习的第一件事是OpenGL ES 编程语言。 这基本上是一个 3D API,使您能够绘制 3D 图元。 如果您正在编写 2D 游戏,您仍然需要使用它,因为由于使用 GPU 进行加速,它的速度很快。
谷歌上有一些很好的教程,你应该开始学习。
矢量数学
如果您正在做任何 3D 工作,您将需要学习 3D 向量数学,向量基本上用于游戏中的所有内容、相机视线方向、角色位置、速度、碰撞检测等。2D 向量 (x,y) 减去2D 游戏编程仍然需要 z 组件。
碰撞检测
我怎么知道我的球何时撞到墙上? 答案是碰撞检测。 碰撞检测有多种形式,例如球体到球体、AABB、OOBB、凸包、三角网格等
AI
如何让敌人攻击我的玩家角色? 人工智能是让 NPC/敌人能够做出明智决策所必需的另一个重要领域。 人工智能可以很简单,例如 if else 语句,但通常需要有限状态机或模糊逻辑才能有效。
寻路
如果您想将角色从 A 点移动到 B 点,同时避开敌人和移动障碍物,则需要使用寻路算法。 星级 (A*) 是最受欢迎的星级之一。
场景图
如果您希望屏幕上同时显示 10-20 个以上的敌人,则需要编写场景图来管理动态绘图、逻辑以及资源的创建和删除。 如果您不知道什么是多态性,您将需要了解它,因为它对于游戏对象的遵守至关重要,并且它与场景图相关联。
物理
位置、速度、加速度、重力和射线都使用矢量表示,您可能需要温习物理数学才能编写任何游戏代码。 从牛顿第二运动定律 F=MA(力 = 质量 * 加速度)开始。 Bullet、ODE、Newton、Tokamak 等开源物理引擎将使事情变得更容易,这意味着您不需要自己编写这些物理规则。
Objective-C++
尽管建议这样做,但这是可选的。 如果您不了解 C++,这本质上是 C++ 和 Objective-C 的混合体。 我倾向于使用 C++ 作为核心游戏引擎和编程,因为 C++ 的速度和 C++ 第三方库的可用性。
声音
如果您需要声音,您可以继续使用 Apple 提供的简单音频框架,但是 3D 位置音频将需要更好的东西。 我建议学习适用于 iPhone 的 FMOD SDK。 正如 @Stowelly 提到的,FMOD 需要商业发行许可证,但您可以寻找其他免版税的许可证。
使用游戏引擎
目前有适用于 iPhone 的游戏引擎,这将使您更轻松地玩游戏,在您的情况下,这会更快,尽管您仍然需要学习我上面提到的概念。
以下是我所知道的一些游戏引擎:
Unity3D
这可能是我所知道的最受欢迎的一种。 Unity 是一个 PC/Mac 游戏引擎,可让您在 Mac 上编写代码并为 Windows/Linux/Mac OS X 进行编译。我怀疑 iPhone 构建是否与其他平台直接兼容,我想如果您只能使用 iPhone,你开始了一个新项目。 然而,该引擎的商业部署成本为 199-399 美元。
Cocos2D
这是一个开源 2D 游戏引擎,可能对很多游戏有用。 值得一看。 托管在 Google 代码上。
以下是其他一些值得查看的内容:
Ston3D for iPhone< /a>
OOlong 引擎
SIO2Engine
2D 游戏 iTGB
My answer is not following the waterfall methodology response you were looking for because I think you will need to learn the skill of game programming before you can plan, design, implement and test it. Game programming is VERY different to business programming and a whole other field in and of itself.
Due to your lack of experience in programming games there are a few concepts that you will need to learn before you can program a game period, let alone one on the iPhone.
Some of these things will depend on whether you are programming a 3D game or going for the 2D platform style.
OpenGL ES
The first thing you will need to learn is the OpenGL ES programming language. This is basically a 3D API which enables you to do drawing of 3D primitives. You will still need to use this if you are coding a 2D game as it is quick due to using the GPU for acceleration.
There are some good tutorials on the Google that you should begin with.
Vector Math
If you are doing anything 3D, you will need to learn about 3D vector math, vectors are basically used for everything in games, camera look direction, position of characters, speed, collision detection, etc. 2D vectors (x,y) minus the z component are still needed for 2D games programming.
Collision Detection
How do I know when my ball hits the wall? The answer is collision detection. There are many forms of collision detection such as Sphere to Sphere, AABB, OOBB, Convex Hulls, Triangle Mesh, etc.
AI
How do I get the enemy to attack my player character? Artificial intelligence is another large field essential to give NPCs/Enemies the ability to make intelligent decisions. AI can be simple such as if else statements but usually requires Finite State Machines or Fuzzy logic to be effective.
Pathfinding
If you want to move a character from Point A to Point B while avoiding enemies and moving obstacles, you will need to use a pathfinding algorithm. A Star (A*) is one of the most popular.
Scene Graph
If you wish to have 10-20+ enemies on screen at a time, you will need to code a scene graph to manage the dynamic drawing, logic and creation and deletion of resources. If you don't know what polymorphism is you will need to know it as it is essential for your game objects to adhere to and it ties in with the scene graph.
Physics
Position, Speed, Acceleration, Gravity and Rays are all represented using vectors and you may need to brush up on your physics math in order to code any game. Start with Newton's Second law of motion F=MA (Force = Mass * Acceleration). An open source physics engine such as Bullet, ODE, Newton, Tokamak will make things easier, meaning you won't need to write these physics rules yourself.
Objective-C++
This is optional although recommended. If you don't know C++ this is essentially a mixture of C++ and Objective-C. I tend to use C++ for the core game engine and programming because of the speed of C++ and availability of third party libraries in C++.
Sound
If you need sound you can just go ahead and use the simple audio frameworks that Apple provide, however 3D positional audio is going to require something better. I would recommend learning the FMOD SDK for iPhone. As @Stowelly mentioned, FMOD requires a license for commercial distribution but there are others you can look for which are royalty free.
Use a Game Engine
There are game engines available for the iPhone at the moment which will make it much easier for you to get a game going, in your case this will be faster although you will still need to learn the concepts I mentioned above.
Here are some game engines I know of:
Unity3D
This probably the most popular one that I know of. Unity is a PC/Mac game engine that lets you write code on the Mac and compile for Windows/Linux/Mac OS X. I doubt the iPhone building is compatible directly with other platforms, I would imagine you'd be restricted to iPhone if you started a new project. This engine does however have a commercial deployment cost of $199-$399.
Cocos2D
This one is an open source 2D game engine that might be useful for a lot of games. Worth taking a look at. Hosted on Google code.
Here are some others to check out:
Ston3D for iPhone
OOlong Engine
SIO2Engine
iTGB for 2D Games
商业应用程序和游戏(尤其是在移动设备上)之间的主要区别在于性能的重要性。 一个放置表单并等待用户输入的应用程序可能在此期间没有执行任何操作。 另一方面,游戏循环一直在进行,并且可能会做很多事情。 业务程序员不习惯用这些术语来思考,但游戏会消耗电池电量,无论你相信与否,您实现游戏的方式将对电池消耗的速度产生很大影响。
那么,一个问题是,你“必须”开发的这款游戏是什么? 如果是数独,不用担心。 如果是实时3D太空战斗,那就另当别论了。
如果您的商业应用程序在 iPhone 上,那么您可能使用 100% Objective-C。 (如果您在桌面上开发 C# 或 Java 应用程序,那么欢迎管理您自己的内存。)有些人会告诉您 Objective-C 的运行时类型管理对于复杂的游戏来说太慢了。 人们当然可以使用 Cocos2D 和其他引擎来制作不错的游戏,但这又取决于游戏。 有些专业开发人员只会使用 C++ 甚至直接使用 C。
The main difference between business apps and games, especially on mobile devices, is the importance of performance. An app that puts up a form and waits for user input probably isn't doing anything in the meantime. A game loop, on the other hand is going all the time and probably doing alot. Business programmers are not used to thinking in these terms, but games draw down battery power and, believe it or not, how you implement your game will have a great effect on how quickly that battery is drawn down.
So, one question is, what is this game that you "have to" develop? If it is sudoku, no worries. If it's a real-time 3D space battle, that's another story.
If your business apps were on the iPhone, then you probably used 100% Objective-C. (If you were doing C# or Java apps on desktops, then welcome to managing your own memory.) There are those who will tell you that the runtime type management of Objective-C is too slow for complex games. People certainly make OK games using it with Cocos2D and other engines, but again it depends on the game. There are professional developers who will only work with C++ or even straight C.