stubma / cocos2dx-classical

A better cocos2d-x v2, for anyone who is still sticking to cocos2d-x 2.2.x+
112 stars 55 forks source link

这是什么

这是一个私人定制的cocos2dx版本, 基于cocos2dx v2分支的最新代码, 目标是创造一个cocos2dx的古典经典版. cocos2dx已经全面发力于3.x版本, 2.x版本已经被抛弃, 当然, 如果他们不抛弃2.x, 我也不会创建这个项目.

我觉得2.x仍然还有价值, 同时3.x并不让我感到多大兴趣. 实际上cocos2d作为一个2d引擎, 还有很多不完善的地方, 相信无数的人已经在2.x时代踩过了很多的坑, 也不得不自己去填上这些坑, 我也一样, 为了填这些坑, 我创建了cocos2dx-better项目, 把这些坑通过外挂的方式填掉, 但是总有一些坑, 外挂解决不了, 只能改原始代码. 对于我个人而言, 目前更需要一个好用的2.x, 而不是一个有未知新坑的3.x.

另外, 我日常使用mac, 主要做iOS和Android开发, 所以其它的平台我都会删掉. 我也删掉了很多没用的东西, 比如没用的工具, 没用的模板, 没用的插件, 没用的脚本, 没用的sample, 要创建新项目就复制个HelloLua改改就完啦! cocos2dx最大的优点就是简单, 我就是要把这玩意搞简单点, 当然我一个人也维护不了那么多没用的玩意儿, 也是为了减负.

所以, 如果你正好也是一个iOS/Android开发者, 也正好还在使用cocos2dx 2.x, 不妨可以看几眼.

What is this

It is a customized cocos2dx, based on latest code of cocos2dx v2 branch. Its purpose is creating a classical cocos2dx branch. I created it because cocos2dx already gave up v2 but v2 is still valuable to me. v3 doesn't interest me much because it may have more bugs. So I need a better v2, not a creepy v3.

To get a better v2, I created a cocos2dx-better project to overcome limitations of v2. Now I start this project to merge cocos2dx-better code to v2 branch, and more.

I deleted many useless stuff so you may find the directory structure is very different with original cocos2dx. Yes, I want it simple, and simplicity is the best virtue of cocos2dx. If you want to create a new project, just copy HelloLua! I don't need any script to do that because cocos2dx is so simple. Of coz I don't want to maintain a whole bunch of garbage. I can't do that on my own.

I care about iOS/Android only so other platform implementation will be deleted. Are you same with me? If so, take a look at this project.

目标

  1. 基于cocos2dx 2.x最新代码 (已完成)
  2. 将我个人的cocos2dx-better代码融入 (已完成)
  3. 把quick-cocos2dx那一套lua支持拷贝过来改吧改吧 (已完成)
  4. 专注于填坑改bug, 而非大刀阔斧的修改架构 (随时进行中)

Purpose

  1. based on cocos2dx v2 (Done)
  2. merge my cocos2dx-better (Done)
  3. provide full lua support, in quick-cocos2dx 3.x style (Done)
  4. fix v2 bugs (Always in progress)

何时结束

可能某天就结束了吧, 估计我也不会去用cocos2dx 3.x, 从触控的尿性和水平来看, cocos2dx没什么前途, 让我的版本成为经典吧! 有新项目还是玩玩unity吧.

Everything that has a beginning has an end

Maybe it ends at some day, and I won't touch cocos2dx 3.x because I don't think it has a future. All Hail 2.x! All Hail Classical! Go play Unity.

这些年, 已经填过的坑

cocos2dx-better新加的其它功能我就不列举了, 目前cocos2dx-better的代码已经合并完成, 有一部分代码我感觉写的用处不大就没有合并了, 不过只是一小部分, 95%的cocos2dx-better代码已经合并.

Things Improved

I don't want to list all new classes in cocos2dx-better. To get a overview about cocos2dx-better features, go to it and run its demo.

额外说明: CCImagePicker使用方法

我实现了一个CCImagePicker作为通用的图片选择/拍摄接口, 支持返回任意大小的图片, 具体可以看cocos2dx-better里的demo, 至少我觉得还是相当好用的. 在iOS里不需要什么配置, 直接用就行. 在Android上, 需要配置一下:

<activity
    android:name="org.cocos2dx.lib.cropimage.CropImage"
    android:configChanges="keyboardHidden|orientation"
    android:screenOrientation="portrait"
    android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
</activity>
<activity
    android:name="org.cocos2dx.lib.ImagePickerActivity"
    android:configChanges="keyboardHidden|orientation"
    android:screenOrientation="portrait"
    android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
</activity>
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature
    android:name="android.hardware.camera"
    android:required="false" />
<uses-feature
    android:name="android.hardware.camera.front"
    android:required="false" />

OK了. 具体使用参考cocos2dx-better的demo.

Extra: How to use CCImagePicker

There is a CCImagePicker merged from cocos2dx-better, it can take image from camera or album and return it in any size. It is very handy, but you need more setup before using it. In iOS, just use it. In Android, don't forget to config something:

<activity
    android:name="org.cocos2dx.lib.cropimage.CropImage"
    android:configChanges="keyboardHidden|orientation"
    android:screenOrientation="portrait"
    android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
</activity>
<activity
    android:name="org.cocos2dx.lib.ImagePickerActivity"
    android:configChanges="keyboardHidden|orientation"
    android:screenOrientation="portrait"
    android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
</activity>
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature
    android:name="android.hardware.camera"
    android:required="false" />
<uses-feature
    android:name="android.hardware.camera.front"
    android:required="false" />

And that is it! No more settings needed.