share some source during my study in cocos2d-x

Hey all:
I have study cocos2d-x for some days, And I want to do something with it.
so this is the result. a uncompleted demo for a Tris Game,there isn’t any game logic, just UI effect.

If you are new to cocos2d-x like me, I think it may help you

This game is based on cocos2d-x 0.7.1 stable. I modified the code in CCDirector::end() to avoid data abort at game exit. You can download attachment:BTris_bin.zip and run directly


BTris_src.zip (8400.4 KB)


BTris_bin.zip (6912.9 KB)

Great! A semi-finished cocos2d-win32 game. The UI looks so cool
I run it on winxp sp2 desktop, and catch a video here

Great job

明杨 wrote:

Hey all:
I have study cocos2d-x for some days, And I want to do something with it.
so this is the result. a uncompleted demo for a Tris Game,there isn’t any game logic, just UI effect.
>
If you are new to cocos2d-x like me, I think it may help you
>
This game is based on cocos2d-x 0.7.1 stable. I modified the code in CCDirector::end() to avoid data abort at game exit. You can download attachment:BTris_bin.zip and run directly

good ,thx!

Nice video. I notice you are using parallels to run XP & Visual Studio on your mac. Is it very fast? I think I’ve tried it in the past, but maybe with VMWare and I found typing and debugging to have a lot of latency.

Parallels is very fast to run & debug win32 programs. I love it, hoho

Thank you. With your example I can quickly learn cocos2d. My development environment is win7, vs2008, cocos2d-0.99.5-x-0.7.2-rc.

I read all of the code. There are several questions about the class CResConvertor.

1, AddVirtualScreen() Why save the rate, why not value.
2, SetScaleStep() what is used to do, step Why is the value of 480, step_count is doing what.
3, several CRCScaleModes What is the difference.
4, Process () is difficult to understand.

What documents, or what knowledge can help me understand CResConvertor.

恩,这块比较难用英文表达,我先用中文描述,时间比较紧,以后附上翻译

对于相同高宽比的设备,如果游戏没有高DPI资源,那么我们只需要拉伸现有资源就能达到力所能及的最好效果。对于非相同高宽比的设备,我们要做的多一些,需要寻找最接近的高宽比,然后根据自己的设置决定等比拉伸(留黑边)还是全屏显示。所以我们需要记录的是高宽比,而并非高和宽的具体数值

step实际上并不精确。这里传递的是一个宽度,用来描述dpi,一般情况下,CResconvertor的会找最接近的宽度来判达到源最佳效果,由于我只有D1的资源,所以传入480
CRCScaleModes 就如同他字面的描述,对应各种拉伸方式,在非程序支持的分辨率下,CResconvertor会用这些方法来拉伸(等比拉伸会会产生黑边,全屏拉伸会让资源变形以适应屏幕分辨率)

process实际就是计算游戏支持的virutal screen和真实设备拉伸比例,寻找最接近的虚拟屏幕等等工作

Thank you for your share…

I noticed you already put a good resource manager for multiple resolutions.

Can you give more detail descriptions about the ResourceMgr and ResConvertor ?

For example, how to use them on iPad/iPhone to make my game an universal app?

Thank you again…

I can’t compile this code, im getting tons of errors (seems like linkaeg errors?)
My end is here: “c:2d-1.0.1-x-0.10.0\cocos2dx\platform\ccgl.h(68): fatal error C1083: No se puede abrir el archivo incluir: ‘GLES/gl.h’: No such file or directory”
Im trying to include all the paths in the project to reduce the errors, but i can not fix that one, it seems the ccgl.h is refering to an unexisting directory, is this a cocox2dx bug or a Btris bug? I included this path too “…2dx\platform\third_party\win32\OGLES\GLES” but it seems the compiler is trying to find “platform/GLES/gl.h” wich does not exist.
Also this one “#include <KHR/khrplatform.h>” does not exist?

I’m a newbie to cocos2d-x. I downloaded this example and cocos2d-x 1.0.1 and found the example call to API is old. I update it and run ok on ubuntu 12.04. Since resources file is too large, my zip ball don’t contain resources. You can download the resources from above.