Why use Cocos for UI Kit for 2D iPhone game?

I have been developing the coconut game for a while. Now it just occurred to me that using UIKit could have been a lot easier.

Could you help me weigh the pros and cons and share the experience that you have.

Here is my basic list of benefits for everyone. I feel like I don’t know enough about coconuts to make an informed decision that is best.

Coconut

  • The game engine is free. Pause / resume callbacks in each frame
  • Sprite Animations
  • Uses open GL (is this true? Is this an advantage?)
  • ... Help me think more about this!

set of user interfaces

  • Further help / documentation / sample code
  • Familiar iPhone programmers
  • Easy to carry touch
  • Simple viewing animation
  • Easy setup
  • Faster loading times? (it's true?)

Any feedback would be great!

EDIT . I just saw a developer video (in an open GL game called Quest) where they used the UI Kit for the user interface elements drawn above the top of the GL View. Is it possible / practical with coconuts?

+4
source share
2 answers
  • Cocos2d uses OpenGL to draw its sprites, movements, and particles. An attempt to use Quartz / Core graphics (which is NOT accelerated!) Is significantly slower and starving.
  • Cocos2d is a reference library with a script in the first place. You will be duplicating efforts to make a scenario graph using UIKit.
  • Cocos has many good freebies that you will need to develop from scratch.

So, in short: it works faster than CPU-bound calls, it provides 95% of what most sprite-based games need without re-inventing the same thing over and over, and is free.

+11
source

Although UIKit is incredibly useful for games, Cocos2D offers many easy ways to perform many common gaming operations. For example, he has the ability to create simple scrolling-tiled games (very common and very popular), using a simple few lines of code to import the Tile map set. Regarding some of the advantages of UIKit over Cocos2D that you mentioned, they are very easy to implement in Cocos2D.

Touch control: It's as simple as replacing the UIKit touchhesBegan method with ccTouchesBegan and setting self.isTouchEnabled = YES in the init method.

Animations: This is much easier in Cocos2d, mainly because the frame rate and animation problems have been resolved. In UIKit, you cannot use CoreAnimation to move an object while detecting a collision. You will need to animate the object using NSTimer. In Cocos2d, you can easily animate objects (called sprites) and still use collision detection and interaction with the object.

More Help / Documentation: Cocos2D offers incredible documentation and, moreover, code examples! If you cannot find it there, the number of iPhone game developers is growing, who are integrating Cocos2D into their applications and are ready to help in many problems.

If you plan to develop games for the iPhone, and not just general applications for performance, music, etc., I highly recommend Cocos2D. Remember that you can always find ways to combine this and UIKit for many operations! These operations are not completely lost!

+3
source

Source: https://habr.com/ru/post/1343064/


All Articles