Core Animation or OpenGL for simple iPhone game

后端 未结 7 1430
一向
一向 2021-01-02 18:37

I am writing a simple game that animates a ball image quickly across a background image.

Would Core Animation/Quartz be sufficient for this scenario?

I don\'

相关标签:
7条回答
  • 2021-01-02 19:10

    OpenGL ES isn't that hard, there are lot of really good resources in the web and step by step tutorials. Can be hard at first, but once you get the grip of It things will be easy. 71 Squared has very detailed tutorials:

    http://www.71squared.co.uk/iphone-tutorials/

    About the question, Core Animation Is great for most apps, but in a videogame It's fundamental to draw your game efficiently and have as much control as possible.

    Cocos2d Is great and I recommend It If you need to write a good game, but if you're doing It for educational purposes I recommend OpenGL, You will learn a lot with It and gain a lot of experience.

    0 讨论(0)
  • 2021-01-02 19:10

    yes, it will be fine, as long as you're not wanting to do hundreds of balls at once or something else complicated like that.

    0 讨论(0)
  • 2021-01-02 19:13

    I would say this very much depends on what you want to do with the ball. If you simply want to fire off an animation and forget about it Core Animation will probably be fine. However, if you are trying to interact with the ball, for example by changing the direction of the ball mid-flight based on user interaction, then you probably want to consider OpenGL ES. Of course, you're other option is to use neither Core Animation or OpenGL ES and simply redraw your view on a timer.

    If you're a fairly competent C programmer I wouldn't be too put off the OpenGL ES stuff. Apple supply a lot of the framework for hosting OpenGL ES views in their templates. Although OpenGL can get fairly involved, if you're not trying to render huge multi-object 3D scenes then the basics are fairly straightforward and you should be able to get some nice results quite easily. Although it is for OpenGL rather than OpenGL ES, I would recommend this set of video demos as a good starting point:

    www.videotutorialsrock.com

    0 讨论(0)
  • 2021-01-02 19:16

    This is a commonly asked question. Other questions like this include:

    • "iPhone board game: OpenGL ES or CoreGraphics?"
    • "Are most games on the IPhone done with OpenGL ES?"
    • "Core Animation or OpenGL ES?"
    • "Does openGL ES have a better performance than Core Animation and UIKit when it comes to highly animated user interfaces?"
    0 讨论(0)
  • 2021-01-02 19:23

    OpenGL ES I suppose isnt too hard.

    But at the end of the day Core Animation is going to be fine, its super powerful and not to hard to work with. It will also get you up and running so quick that you will release you game "sucks" a bit and you want to change it and you didn't even have to learn OpenGL.

    I highly recommend looking at cocos2d. A very simple game engine for 2d stuff. http://cocos2d.org/

    Have a look at that.

    Cheers, John

    0 讨论(0)
  • 2021-01-02 19:25

    Just jump to something like Cocos2D so that the OpenGL is done for you. OpenGL ES is significantly faster and more adaptable than Quartz, plus it's not any harder. I even think Quartz is a big pain in the butt and difficult to figure out, although I came from an OpenGL background on desktop computers first, so naturally that jump is pretty small. The point is, though, that either with Quartz or with OpenGL ES you're going to need to spend a lot of time with resource management, etc., so you might as well go with Cocos2D.

    0 讨论(0)
提交回复
热议问题