Cocos2d-x 3.2 2048-Article 6 (final chapter)

Source: Internet
Author: User

Cocos2d-x 3.2 2048-Article 6 (final chapter)

 

 

It's really about to end,

I finally completed the development tutorial of 2048 ~

 

This is a migration to the Android platform:

Cocos2d-x 3.2 do APK, very simple it,

After the preceding environment is configured, we can generate it directly on the command line,

 

However, first, we need to change the icon Name:

This blog does not use Eclipse for configuration,

Instead, open it directly with EditPlus and set it,

 

 

The following content is available in the project folder:

Go to proj. android,

Those who have developed Android applications should know that,

Where is the icon,

That's right. res:

Hdpi-stores high-resolution images with 72x72 icons

Ldpi-stores low-resolution images with icons 48x48

Mdpi-stores medium-resolution images with 32x32 icons

Values -- stores a string. xml, which currently stores the name displayed on the mobile phone.

 

However, the names of the three icons in three different folders must be the same,

 

I put an icon_2048 icon in hdpi,

The image name should never be a pure number. It may cause problems ~

 

OK. Then, we can open string. xml in the Values Folder:

 

App_name indicates the game name,

You only need to change the name of the test to be set.

Because app_name is called elsewhere, we only need to change the content of app_name,

I changed to: 2048_beta

 

 
     
  
   2048_beta
  
 

Don't forget to save it ~

 

 

OK, the basic resources are all set up,

Now go back to the proj. android directory:

 

Open the AndroidManifest. xml file:

 

The three arrows I marked,

The first arrow is about the version:

Version code is invisible to users. It is used in the application market, internal program identification, and new and old versions.

Version name is visible to users, which makes it easy for users to view their new and old applications

 

The second arrow is the one we just set,

Application name,

Application icon.

 

The third arrow,

ScreenOrientation, which is important

This can be set, how do we play the game on a horizontal or vertical screen:

-- Landscape Screen

-- Portrait Screen

 

Here, we need to change the third arrow and the second arrow. We will change the name of the call icon to icon_2048.

Of course, we need to play our games in portrait mode ~

 

We need to know that the above items are selected as projects, and their settings are correct and will not affect APK generation.

 

Next, let's talk about the part that must be changed,

If you have developed a cocos2d-x before, you may be familiar with it.

This is a headache,

Open the jni folder of proj. android:

 

Open Android. mk. All of these are opened with EditPlus, and use notepad or something.

 

It's my arrow, where we need to use our project

ALL (ALL). cpp are added to the above

 

Of course, we can set Automatic addition (programmers are relatively lazy and can automatically add o (why do we need to do it)

Read this article-> Android. mk automatically reads cpp

 

You must set this parameter ~

 

After these settings are complete, we can generate an APK ~

 

Go to the command line and enter our project folder:

 

Of course, cocos compile has other settings, you can see this-> http://blog.csdn.net/lttree/article/details/37814991

 

Start generating APK ~

Saying, looking at these generated things, I feel very tall, although many do not understand

 

See the final SUCCESS

Congratulations! APK generation,

In the bin directory under the project folder:

 

OK. We can install it on the mobile phone to play tricks.

 

So far, our 2048 development tutorial series has ended.

This is just a basic implementation,

There are also many additional extensions that you can find on your own:

-- Local storage with the highest score

-- Ranking implementation

-- Skin change

-- And so on ..

Let's look at this ~

 

So hard to say .. (If you say you have worked hard, is it a bit ...)

(Partition _ tables)

My first series of tutorials is over,

In the past few days, we are engaged in three series of elimination,

Well, after getting it out, there will be a series of tutorials

(^ ω ^) Come on (^ ω ^)

 

This is the end ~

 

The sixth piece of code, with APK: http://pan.baidu.com/s/1eQgU6Nw

 

 

 

* *********************************** Please specify the source: bytes ********************************************

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.