The Gospel of millions of Java developers: the creation of a cross-platform Cocos2d-java game engine

Source: Internet
Author: User
Tags lua


Portal


Cocoseditor Official website: http://cocoseditor.com/

Engine Tools Download and configuration: Installation configuration for the Cocos2d-java game engine and related development tools




Objective


The cross-platform Cocos2d-java game engine and the matching CocosEditor2.0 game development tools were finally born. Use the Java language to develop cocos2d cross-platform games, and-lua,-js's similar in style API, no doubt, this is indeed a new milestone for cocos2d. Welcome to the world of Cocos2d-java;






How many Java developers are there in the world?


Oracle says there are 9 million Java programmers in the world, Wikipedia says 10 million, and Numberof.net's buddies say it's accurate: There are 9,007,346 Java programmers in the world.




Why encapsulate the Cocos2d-java engine


All along, the two languages of Java and C/s + + are very powerful, whether it is the language leaderboard or the programmer circle, there is always a variety of saliva and controversy; C/s directly manipulating memory is really efficient, and this is the essence of many game engines choosing C + +, and it is indeed a wise choice, Java this block is weak, of course, because the C + + control of memory, resulting in its difficult to learn, and want to fully grasp, not a few years of internal strength can not really do, so many children's shoes daunting, and Java because easy to learn, flexible and fast, widely welcomed by programmers, has a large number of mass base, in addition, Many games need to quickly develop transplant release, not blindly pursue the game high performance miss the changeable market, performance and agile development need to find the balance of the two; this is the basic reason for our encapsulation cocos2d-java;

Looking back a year ago, the team is going through the biting winter, began to try to transform the hand tour market, the first choice is touch cocos2d, because the team technology on the Java, so did not choose to use the C/D + + development of cocos2d-x, but the use of cocos2d-js. Halfway through the use of Cocos2d-js did not find the right development tools, so the team made a set of IntelliJ idea on the plug-in development tools, named Cocoseditor. In succession, the plug-in is also a lot of developers in use, reflecting fortunately, although the use of JS development has been good, but always some short board, and the team has not been put Java this technology, so try to encapsulate Cocos2d-java. Technology is mainly based on or cocos2d-x, just a layer of JNI package, no great difficulty, mainly in the development of tools Cocoseditor spent a lot of time. This is the basic passing of the birth of Cocos2d-java;

In the production of Cocos2d-java, we are filled with contradictions and struggles, but also with confidence and dream; Java has a unique advantage, but also has the inevitable weakness, the predecessor of Cocos2d-android gradually become chicken, the market Java game engine few success stories, It makes us feel very sad. But we believe in our own technology, and firmly believe that the huge call of the market (millions of Java developers), adhering to the field of hand-tour to do something about the dream, so also in a firm walk.



A Brief History of Cocos2d


In 2008, Ricardo developed Cocos2d for Python, which had already sprouted the idea of " writing a game for a week ," and soon Apple released the iphone and also built the App Store,Ricardo grabbed opportunity to develop cocos2d for objective-c, to become a popular hand-tour engine. In 2010, Wang Zhe, who was engaged in operating system technology, developed the cocos2d-x, rapidly seize the market with unparalleled advantages such as Cocoachina community and cross-platform, Subsequently, the Cocos2d-x team, which was under the touch of Revenue, also released Cocos2d-lua and Cocos2d-js, at the same time Shinycocos (Ruby bindings), Cocos2d-android (Java based), Cocosnet (Mono based) also blossomed everywhere, and by now, in 2014, it was the touch of Cocos2d-x that dominated the top spot. Of course, the 2014 also ushered in a cross-platform Cocos2d-java.



Cocos2d-java Introduction


    • Principle and performance:

Principle: Similar to js-bings and Lua-bings, the use of JNI way to encapsulate Java C + +, so all the foundation is still cocos2d-x;

Performance: ported to Android: higher than Cocos2d-js; ported to iOS: Same as Cocos2d-js


    • Why can cross-platform Android and iOS:

Transplant to Android, natural is yes, this need not say much. And can be ported to iOS, because iOS itself does not have a Java virtual machine, we have modified an open source project avian (Java Virtual machine), the virtual machine is packaged in a user-developed iOS game, so the successful implementation of Cocos2d-java running on iOS system development tool Cocoseditor All Java code will be compiled into iOS available. A library, using Xcode to import the library and Java Virtual Library, porting is easy


    • CDK (Cocos2d-java Develop Kit) Development Kit:

CDK is the Coos2d-java development package that enables the development of Cocos2d-java games through any Java development tool, such as Eclipse. Of course in the development tool Cocoseditor, it is already built in;

Bin directory: stored in the computer operating system running Java Virtual machine, and Cocos2d-x C + + Core library are in the DLL file inside

Extreas Directory: Store third-party libraries, including advertising, payment, sharing, etc.;

Lib directory: This is where the JNI libraries dealing with the underlying C + + are stored, the core of the entire Cocos2d-java



    • Engine API structure, basic compliance with-X,-JS structure, including Sprite, Direction, Layer,event,particle,ui,audio and other basic concepts; the right side can clearly see how JNI is defined: public native Static Sprite Create (String fileName);



    • Cocos2d-java code style. See the following code style, the function is: Create a new wizard, set the relevant properties, join the root node, and then Runaction. Basic as long as familiar with cocos2d children's shoes are likely to start soon;






Cocoseditor product Line


Our team is a fan of the JetBrains company, JetBrains is a Czech tool developer, including IntelliJ idea, Webstorm, Phpstorm, Appcode and other excellent tools, Cocoseditor are based on their products;
Cocoseditor Basic product line structure: One engine and three tools
    • Cocos2d-java Cross-platform engine
    • Plugin based on IntelliJ idea Ultimate version: Cocoseditor for COCOS2D-JS
    • Standalone tool based on IntelliJ Idea Community Edition: Cocoseditor for Cocos2d-java
    • Tools based on Appcode and cppide: Cocoseditor for Cocos2d-x (planned)



CocosEditor2.0 Introduction ( development tools born of Cocos2d-java )


    • CocosEditor2.0 Tools Introduction
Cocoseditor2.0 is a mobile game development tool based on the IntelliJ idea Open platform, which runs on the WINDOW/MAC system, and the 1.x version supports the JS and Lua scripting languages. The 2.x version is temporarily supported in the Java language, and all game release packs can be quickly ported to Android and iOS platforms. Tool collection code editing, can be seen in the scene design, animation, font design, picture packaging, particle editing, physical systems, maps and other functions, and debugging convenient, and real-time simulation. If you are interested to know the source of the tool, you can directly view IntelliJ idea Community source, in addition to Google's Android studio is derived from the IntelliJ idea open platform

    • Basic Features:



    • interface design CCE; generally similar to the Android XML interface design, 1 You can drag the control, visible can be obtained; 2 you can write through XML by switching to the text directory




    • Image Texturepacker Automatic Packaging: 1.x version you need to manually import the picture for Texturepacker, now the 2.x version by identifying the note. plist Direct automatic picture packing, save a lot of effort




    • Font design: Get picture fonts by capturing pictures



    • Physical systems: Edit physical shapes by visualizing shape, which is the feature of the 2.x version. function is basically available, but there are some improvements.




    • Code writing and hints: IntelliJ idea has been the best Java development tool in the industry, and I am very much in favor of it; Cocoseditor inherits all of its virtues, code hints, code refactoring, code reviews, and so on, which is the developer's Gospel.




    • Simulator and code debugging: real-time analog debugging on Windows and Mac via Cocosplayer, which is standard for development games.




    • Third-party SDK: Built-in rich third-party libraries to meet most of your needs




    • Support for Mac and Windows dual-system development





    • Quick release multiplatform: iOS and Android






Games developed by Cocos2d-java


Cocos2d-java Engine-based jumping game, successfully published to the app Store and Android Market, verified its cross-platform release

~ iOS

Download Link: https://itunes.apple.com/us/app/jump-building/id890384335?mt=8


~ Android

Download Link: Http://url.cn/Kv7q3X






Postscript


1 at this point, the engine and tools are basically stable available, but do not rule out the existence of bugs and small pits, if you have encountered in the use of, I hope you can give us feedback, we sincerely thank;

2 Cocos2d-java is now more suitable for small and medium-sized games, large-scale games have not been verified, in addition, the engine in the heat update and the increment is weak, we will continue to conquer the technical difficulties;

3 Please feel free to use, we are also constantly through the development of the game to make this system more stable and better use;

4 Thanks to Cocos2d-x,intellij Idea,avian and other open source projects, so that we can stand on the shoulders of giants to do some interesting things;


We move on, just because we believe;





The Gospel of millions of Java developers: the creation of a cross-platform Cocos2d-java game engine

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.