Cocos2d-x-iOS platform lua encrypted luac resource method and Jsc file & lt; MAC platform development trial -- windows platform has not been studied & gt;, luacjsc

Source: Internet
Author: User

Cocos2d-x-iOS platform lua encrypted luac resource method and Jsc file <MAC platform development trial -- windows platform has not been studied>, luacjsc

First of all, it's really too busy recently. I haven't written a blog for a long time. Today, I just want to write about some of the latest discoveries in the game;
In other words, writing a game based on the Cocos2dx engine + script has been able to perform incremental updates and real-time compilation, saving a lot of time; well, I don't need to talk much about it, so I will go into the topic;
Here I am taking Cocos2d-x-2.2.2 as an example <in fact, when writing articles Cocos2d-x-3.2 seal version>;
Today I will talk about how to use the cocos-console in the Cocos2d-x3.2 to batch encrypt lua script-into luac files, js files into jsc encrypted files <in fact, very simple on a line of command can be, of course, I am taking the mac platform as an example>:

(This chapter is to teach big home Cocos2dx-3.2 cocos-console to batch processing a path under the lua file encryption for luac specified path, this reduces the trouble of using the previous luajit + shell script:


First, enter the Cocos2d-x-3.2 in the mac terminal to specify the path: for example, My:

/Users/your username/cocos2d-x-3.2/tools/cocos2d-console/bin

After entering the./cocos luacompile-h command, related usage instructions will appear,


Then you can follow the instructions;

For example, input

./Cocos luacompile-s/Users/your username/Desktop/lua-encode-oldfiles-d/Users/your username/Desktop/lua-encode-finish


-S: the original path of these lua files to be encrypted <You can also specify the src directory of the game project>;

-D: The Path to store these encrypted luac files. <if it is still in the src directory of your project, you can also>


View



OK! At this point, our lua encryption is achieved by luac. Isn't it easy! Now let's talk about how to encrypt js files into jsc files. The principle is the same as lua's encryption. To save time, I directly:





OK! So far, is it super simple and saves a lot of time!

Next time, let's talk about how to port ios from mac to Android! In fact, it is also very simple. reading a lot of online writing is too complicated,

Coming soon!























































































































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.