Began to study the library. It seems that everything is more or less turned out for the first guides, but that's the problem. I just don’t understand how to create games on it, that is, I can’t figure out where to use it yet. I have no knowledge except in C ++, I have not done a game before. The documentation does not have a full description of how and what, but only a description of the API. Maybe the problem is that there is no experience at all? Maybe it was necessary to study graphics first, opengl, and then just take on this library? What do you advise?

  • one
    I think your wording is not quite right:> 'I just don’t understand how to create games on it '> I didn’t make games before 'I can be wrong, but the problem here is not cocos2dx - Zowie
  • The formulation is correct in terms of the fact that the study of this library is the ultimate goal. The problem is that I just missed a lot and don’t know how to catch up. What to study? - AlexeyVorobyev
  • > "The documentation does not have a full description of how and what, but only a description of the API" And you can write code only by tutorials? :) - Zowie
  • Look for examples in the open source of games on this coconut, see how others are doing, find Cocos forums and try to catch up, young Padawan - Gorets
  • I have a question: what does android have to do with it? - DroidAlex

2 answers 2

Take examples of tutorials in the internet under Cocos2d-iphone, read the dock under it, open the code and use the same classes, but only in 2dx. According to the idea, there is a complete similarity down to the name.

UPD If you drop a little deeper (from my memory), then:

  • in coconut, the basic concepts are scene, layers, and textures. Usually one scene is one screen (in our case, activate). Layers are added to the scene. Textures or something else are added to the layers. The texture of the sute is a picture.
  • CCLabel and its derivatives are used for text. You can load your fonts from assets into the text, for example
  • the transition between windows (scenes, layers) is realized through the singleton pattern, as a rule, and we simply throw out one layer - we insert another, passing between them the parameters which layer is current.
  • we have one activit in which there is just a GLSurfaceView, but only coconut, inside it there is a whole mess.
  • work with animation, music is implemented on top of android (well, or another native OS) api, but there are all the necessary wrappers. At the expense of animation - there are many classes ala CCMoveTO with different function (curve) in the base. Google will help to drop deeper.
  • The UI update usually occurs to 1/60 and when dalvik starts the garbage collector stream, the entire logic of the game may get corrupted due to delays, so you need to remember this feature.
  • in the layer (in my opinion) there is an update () method, which just works on tick 1 to 60, updating the UI. This method is usually implemented in its own way, for example, stuffing the logic of the movement of a character or something similar.

All this is relevant for Cocos2d-android-1 - coconut port under the droid with a bunch of bugs. If I remember something else - add here.

    Coke is a cool tool, but a tool. Understand how to build a house, and build a house here. There is a cool book "Object-oriented analysis and design," Brett McLaughlin, understand how to design an application, understand how to design a game. You can even know 50 languages, but if you can’t adequately decompose a task and design it, you won’t win the game, you’ll get confused in cash registers, methods, etc.