├── MyMoonWarrior
├── libs
│ ├── cocos2dx
│ │ ├── platform
│ │ │ ├── third_party
│ │ │ │ └── ios
│ │ │ │ │ ├── curl
│ │ │ │ │ ├── types.h
│ │ │ │ │ └── stdcheaders.h
│ │ │ │ │ └── libraries
│ │ │ │ │ └── libcurl.a
│ │ │ ├── ios
│ │ │ │ ├── CCPlatformDefine.h
│ │ │ │ ├── CCLock.cpp
│ │ │ │ ├── CCThread.mm
│ │ │ │ ├── CCDirectorCaller.h
│ │ │ │ ├── CCLock.h
│ │ │ │ ├── CCGL.h
│ │ │ │ ├── CCAccelerometer.h
│ │ │ │ ├── CCStdC.h
│ │ │ │ ├── Simulation
│ │ │ │ │ └── AccelerometerSimulation.h
│ │ │ │ ├── CCAccelerometer.mm
│ │ │ │ ├── AccelerometerDelegateWrapper.h
│ │ │ │ ├── CCEGLView.h
│ │ │ │ └── CCESRenderer.h
│ │ │ ├── CCApplicationProtocol.h
│ │ │ ├── platform.cpp
│ │ │ ├── platform.h
│ │ │ ├── CCThread.h
│ │ │ ├── CCAccelerometerDelegate.h
│ │ │ └── CCCommon.h
│ │ ├── actions
│ │ │ ├── CCActionInterval.cpp
│ │ │ └── CCActionTiledGrid.cpp
│ │ ├── kazmath
│ │ │ ├── src
│ │ │ │ ├── CMakeLists.txt
│ │ │ │ ├── utility.c
│ │ │ │ └── aabb.c
│ │ │ └── include
│ │ │ │ └── kazmath
│ │ │ │ ├── kazmath.h
│ │ │ │ ├── neon_matrix_impl.h
│ │ │ │ ├── GL
│ │ │ │ ├── mat4stack.h
│ │ │ │ └── matrix.h
│ │ │ │ ├── aabb.h
│ │ │ │ └── ray2.h
│ │ ├── shaders
│ │ │ ├── ccShader_Position_uColor_frag.h
│ │ │ ├── ccShader_PositionColor_frag.h
│ │ │ ├── ccShader_PositionTextureColor_frag.h
│ │ │ ├── ccShader_PositionTexture_uColor_frag.h
│ │ │ ├── ccShader_PositionTexture_uColor_vert.h
│ │ │ ├── ccShader_PositionTexture_frag.h
│ │ │ ├── ccShader_PositionTexture_vert.h
│ │ │ ├── ccShader_PositionColor_vert.h
│ │ │ ├── ccShader_PositionTextureA8Color_frag.h
│ │ │ ├── ccShader_Position_uColor_vert.h
│ │ │ ├── ccShaderEx_SwitchMask_frag.h
│ │ │ ├── ccShader_PositionTextureA8Color_vert.h
│ │ │ ├── ccShader_PositionTextureColor_vert.h
│ │ │ └── ccShader_PositionTextureColorAlphaTest_frag.h
│ │ ├── include
│ │ │ ├── CCEventType.h
│ │ │ └── ccTypeInfo.h
│ │ ├── cocoa
│ │ │ ├── CCInteger.h
│ │ │ ├── CCZone.cpp
│ │ │ └── CCZone.h
│ │ ├── cocos2d.cpp
│ │ ├── support
│ │ │ ├── ccUtils.cpp
│ │ │ ├── TransformUtils.h
│ │ │ ├── ccUtils.h
│ │ │ ├── base64.h
│ │ │ ├── CCVertex.h
│ │ │ └── TransformUtils.cpp
│ │ ├── effects
│ │ │ └── CCGrabber.h
│ │ ├── layers_scenes_transitions_nodes
│ │ │ └── CCScene.h
│ │ └── touch_dispatcher
│ │ │ └── CCTouch.cpp
│ ├── extensions
│ │ ├── GUI
│ │ │ ├── CCControlExtension
│ │ │ │ ├── CCControl.h
│ │ │ │ ├── CCControlSlider.h
│ │ │ │ ├── CCControlSaturationBrightnessPicker.h
│ │ │ │ ├── CCControlExtensions.h
│ │ │ │ └── CCInvocation.cpp
│ │ │ ├── CCScrollView
│ │ │ │ ├── CCTableViewCell.cpp
│ │ │ │ └── CCTableViewCell.h
│ │ │ └── CCEditBox
│ │ │ │ └── EditBoxImplIOS.h
│ │ ├── CCBReader
│ │ │ ├── CCNodeLoaderListener.h
│ │ │ ├── CCMenuLoader.h
│ │ │ ├── CCData.h
│ │ │ ├── CCNode+CCBRelativePositioning.h
│ │ │ ├── CCData.cpp
│ │ │ ├── CCBFileLoader.cpp
│ │ │ ├── CCLayerLoader.h
│ │ │ ├── CCBFileLoader.h
│ │ │ ├── CCBSequenceProperty.h
│ │ │ ├── CCMenuItemImageLoader.h
│ │ │ ├── CCMenuItemLoader.h
│ │ │ ├── CCBKeyframe.h
│ │ │ ├── CCBSequence.h
│ │ │ ├── CCControlLoader.h
│ │ │ ├── CCBSequenceProperty.cpp
│ │ │ ├── CCBMemberVariableAssigner.h
│ │ │ ├── CCLayerColorLoader.h
│ │ │ ├── CCBSequence.cpp
│ │ │ ├── CCBKeyframe.cpp
│ │ │ ├── CCMenuItemLoader.cpp
│ │ │ ├── CCLayerGradientLoader.h
│ │ │ ├── CCBSelectorResolver.h
│ │ │ ├── CCMenuItemImageLoader.cpp
│ │ │ ├── CCSpriteLoader.h
│ │ │ ├── CCControlLoader.cpp
│ │ │ ├── CCLabelBMFontLoader.h
│ │ │ ├── CCLayerLoader.cpp
│ │ │ ├── CCBValue.h
│ │ │ ├── CCScrollViewLoader.h
│ │ │ ├── CCNodeLoaderLibrary.h
│ │ │ ├── CCLayerColorLoader.cpp
│ │ │ ├── CCScale9SpriteLoader.h
│ │ │ ├── CCLabelTTFLoader.h
│ │ │ ├── CCParticleSystemQuadLoader.h
│ │ │ ├── CCControlButtonLoader.h
│ │ │ ├── CCNode+CCBRelativePositioning.cpp
│ │ │ ├── CCLabelBMFontLoader.cpp
│ │ │ └── CCSpriteLoader.cpp
│ │ ├── ExtensionMacros.h
│ │ └── cocos-ext.h
│ └── CocosDenshion
│ │ └── include
│ │ └── Export.h
├── Resources
│ ├── b01.png
│ ├── hit.jpg
│ ├── Enemy.png
│ ├── Icon.png
│ ├── bg01.jpg
│ ├── flare.jpg
│ ├── logo.png
│ ├── menu.png
│ ├── pause.png
│ ├── play.png
│ ├── Default.png
│ ├── Icon-72.png
│ ├── Icon@2x.png
│ ├── Monster.png
│ ├── arial-14.png
│ ├── bullet.png
│ ├── explode1.jpg
│ ├── explode2.jpg
│ ├── explode3.jpg
│ ├── gameOver.png
│ ├── loading.png
│ ├── ship01.png
│ ├── HelloWorld.png
│ ├── Icon-Small.png
│ ├── explosion.png
│ ├── iTunesArtwork
│ ├── menuTitle.png
│ ├── CloseNormal.png
│ ├── CloseSelected.png
│ ├── Icon-Small-50.png
│ ├── Icon-Small@2x.png
│ ├── Music
│ │ ├── bgMusic.mp3
│ │ ├── buttonEffet.mp3
│ │ ├── fireEffect.mp3
│ │ ├── explodeEffect.mp3
│ │ ├── mainMainMusic.mp3
│ │ └── shipDestroyEffect.mp3
│ ├── arial-14.GlyphProject
│ ├── Font
│ │ └── bitmapFontTest.png
│ ├── Info.plist
│ ├── game.tmx
│ └── bullet.plist
├── Prefix.pch
├── ios
│ ├── RootViewController.h
│ ├── main.m
│ ├── AppController.h
│ └── RootViewController.mm
└── Classes
│ ├── header
│ └── EnumAndStruct.h
│ ├── layer
│ ├── ScoreLayer.h
│ ├── TimerLayer.h
│ ├── AboutLayer.h
│ ├── BasicLayer.h
│ ├── OptionLayer.h
│ ├── ScoreLayer.cpp
│ ├── PauseLayer.h
│ ├── WarriorLayer.h
│ ├── BasicLayer.cpp
│ ├── WelcomeLayer.h
│ ├── HeroBulletManager.h
│ ├── GamingLayer.h
│ ├── TimerLayer.cpp
│ └── AboutLayer.cpp
│ ├── utils
│ ├── Effects.h
│ ├── DLog.h
│ ├── DLog.cpp
│ └── Effects.cpp
│ ├── CescMenu.h
│ ├── HelloWorldScene.h
│ ├── NewBullet.h
│ ├── enemy
│ ├── EnemyManager.h
│ ├── EnemyModel.h
│ └── EnemyManager.cpp
│ ├── CescMenu.cpp
│ ├── NewBullet.cpp
│ ├── AppDelegate.h
│ └── AppDelegate.cpp
├── Default-568h@2x.png
└── MyMoonWarrior.xcodeproj
├── xcuserdata
└── user.xcuserdatad
│ ├── xcdebugger
│ └── Breakpoints.xcbkptlist
│ └── xcschemes
│ └── xcschememanagement.plist
└── project.xcworkspace
├── contents.xcworkspacedata
├── xcuserdata
└── user.xcuserdatad
│ └── UserInterfaceState.xcuserstate
└── xcshareddata
└── MyMoonWarrior.xccheckout
/MyMoonWarrior/libs/cocos2dx/platform/third_party/ios/curl/types.h:
--------------------------------------------------------------------------------
1 | /* not used */
2 |
--------------------------------------------------------------------------------
/Default-568h@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/longlovewen/MyMoonWarrior/HEAD/Default-568h@2x.png
--------------------------------------------------------------------------------
/MyMoonWarrior/Resources/b01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/longlovewen/MyMoonWarrior/HEAD/MyMoonWarrior/Resources/b01.png
--------------------------------------------------------------------------------
/MyMoonWarrior/Resources/hit.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/longlovewen/MyMoonWarrior/HEAD/MyMoonWarrior/Resources/hit.jpg
--------------------------------------------------------------------------------
/MyMoonWarrior/Resources/Enemy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/longlovewen/MyMoonWarrior/HEAD/MyMoonWarrior/Resources/Enemy.png
--------------------------------------------------------------------------------
/MyMoonWarrior/Resources/Icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/longlovewen/MyMoonWarrior/HEAD/MyMoonWarrior/Resources/Icon.png
--------------------------------------------------------------------------------
/MyMoonWarrior/Resources/bg01.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/longlovewen/MyMoonWarrior/HEAD/MyMoonWarrior/Resources/bg01.jpg
--------------------------------------------------------------------------------
/MyMoonWarrior/Resources/flare.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/longlovewen/MyMoonWarrior/HEAD/MyMoonWarrior/Resources/flare.jpg
--------------------------------------------------------------------------------
/MyMoonWarrior/Resources/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/longlovewen/MyMoonWarrior/HEAD/MyMoonWarrior/Resources/logo.png
--------------------------------------------------------------------------------
/MyMoonWarrior/Resources/menu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/longlovewen/MyMoonWarrior/HEAD/MyMoonWarrior/Resources/menu.png
--------------------------------------------------------------------------------
/MyMoonWarrior/Resources/pause.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/longlovewen/MyMoonWarrior/HEAD/MyMoonWarrior/Resources/pause.png
--------------------------------------------------------------------------------
/MyMoonWarrior/Resources/play.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/longlovewen/MyMoonWarrior/HEAD/MyMoonWarrior/Resources/play.png
--------------------------------------------------------------------------------
/MyMoonWarrior/Resources/Default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/longlovewen/MyMoonWarrior/HEAD/MyMoonWarrior/Resources/Default.png
--------------------------------------------------------------------------------
/MyMoonWarrior/Resources/Icon-72.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/longlovewen/MyMoonWarrior/HEAD/MyMoonWarrior/Resources/Icon-72.png
--------------------------------------------------------------------------------
/MyMoonWarrior/Resources/Icon@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/longlovewen/MyMoonWarrior/HEAD/MyMoonWarrior/Resources/Icon@2x.png
--------------------------------------------------------------------------------
/MyMoonWarrior/Resources/Monster.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/longlovewen/MyMoonWarrior/HEAD/MyMoonWarrior/Resources/Monster.png
--------------------------------------------------------------------------------
/MyMoonWarrior/Resources/arial-14.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/longlovewen/MyMoonWarrior/HEAD/MyMoonWarrior/Resources/arial-14.png
--------------------------------------------------------------------------------
/MyMoonWarrior/Resources/bullet.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/longlovewen/MyMoonWarrior/HEAD/MyMoonWarrior/Resources/bullet.png
--------------------------------------------------------------------------------
/MyMoonWarrior/Resources/explode1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/longlovewen/MyMoonWarrior/HEAD/MyMoonWarrior/Resources/explode1.jpg
--------------------------------------------------------------------------------
/MyMoonWarrior/Resources/explode2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/longlovewen/MyMoonWarrior/HEAD/MyMoonWarrior/Resources/explode2.jpg
--------------------------------------------------------------------------------
/MyMoonWarrior/Resources/explode3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/longlovewen/MyMoonWarrior/HEAD/MyMoonWarrior/Resources/explode3.jpg
--------------------------------------------------------------------------------
/MyMoonWarrior/Resources/gameOver.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/longlovewen/MyMoonWarrior/HEAD/MyMoonWarrior/Resources/gameOver.png
--------------------------------------------------------------------------------
/MyMoonWarrior/Resources/loading.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/longlovewen/MyMoonWarrior/HEAD/MyMoonWarrior/Resources/loading.png
--------------------------------------------------------------------------------
/MyMoonWarrior/Resources/ship01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/longlovewen/MyMoonWarrior/HEAD/MyMoonWarrior/Resources/ship01.png
--------------------------------------------------------------------------------
/MyMoonWarrior/Resources/HelloWorld.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/longlovewen/MyMoonWarrior/HEAD/MyMoonWarrior/Resources/HelloWorld.png
--------------------------------------------------------------------------------
/MyMoonWarrior/Resources/Icon-Small.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/longlovewen/MyMoonWarrior/HEAD/MyMoonWarrior/Resources/Icon-Small.png
--------------------------------------------------------------------------------
/MyMoonWarrior/Resources/explosion.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/longlovewen/MyMoonWarrior/HEAD/MyMoonWarrior/Resources/explosion.png
--------------------------------------------------------------------------------
/MyMoonWarrior/Resources/iTunesArtwork:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/longlovewen/MyMoonWarrior/HEAD/MyMoonWarrior/Resources/iTunesArtwork
--------------------------------------------------------------------------------
/MyMoonWarrior/Resources/menuTitle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/longlovewen/MyMoonWarrior/HEAD/MyMoonWarrior/Resources/menuTitle.png
--------------------------------------------------------------------------------
/MyMoonWarrior/Resources/CloseNormal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/longlovewen/MyMoonWarrior/HEAD/MyMoonWarrior/Resources/CloseNormal.png
--------------------------------------------------------------------------------
/MyMoonWarrior/Resources/CloseSelected.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/longlovewen/MyMoonWarrior/HEAD/MyMoonWarrior/Resources/CloseSelected.png
--------------------------------------------------------------------------------
/MyMoonWarrior/Resources/Icon-Small-50.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/longlovewen/MyMoonWarrior/HEAD/MyMoonWarrior/Resources/Icon-Small-50.png
--------------------------------------------------------------------------------
/MyMoonWarrior/Resources/Icon-Small@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/longlovewen/MyMoonWarrior/HEAD/MyMoonWarrior/Resources/Icon-Small@2x.png
--------------------------------------------------------------------------------
/MyMoonWarrior/Resources/Music/bgMusic.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/longlovewen/MyMoonWarrior/HEAD/MyMoonWarrior/Resources/Music/bgMusic.mp3
--------------------------------------------------------------------------------
/MyMoonWarrior/Resources/Music/buttonEffet.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/longlovewen/MyMoonWarrior/HEAD/MyMoonWarrior/Resources/Music/buttonEffet.mp3
--------------------------------------------------------------------------------
/MyMoonWarrior/Resources/Music/fireEffect.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/longlovewen/MyMoonWarrior/HEAD/MyMoonWarrior/Resources/Music/fireEffect.mp3
--------------------------------------------------------------------------------
/MyMoonWarrior/Resources/arial-14.GlyphProject:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/longlovewen/MyMoonWarrior/HEAD/MyMoonWarrior/Resources/arial-14.GlyphProject
--------------------------------------------------------------------------------
/MyMoonWarrior/Resources/Font/bitmapFontTest.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/longlovewen/MyMoonWarrior/HEAD/MyMoonWarrior/Resources/Font/bitmapFontTest.png
--------------------------------------------------------------------------------
/MyMoonWarrior/Resources/Music/explodeEffect.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/longlovewen/MyMoonWarrior/HEAD/MyMoonWarrior/Resources/Music/explodeEffect.mp3
--------------------------------------------------------------------------------
/MyMoonWarrior/Resources/Music/mainMainMusic.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/longlovewen/MyMoonWarrior/HEAD/MyMoonWarrior/Resources/Music/mainMainMusic.mp3
--------------------------------------------------------------------------------
/MyMoonWarrior/Resources/Music/shipDestroyEffect.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/longlovewen/MyMoonWarrior/HEAD/MyMoonWarrior/Resources/Music/shipDestroyEffect.mp3
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/cocos2dx/actions/CCActionInterval.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/longlovewen/MyMoonWarrior/HEAD/MyMoonWarrior/libs/cocos2dx/actions/CCActionInterval.cpp
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/cocos2dx/actions/CCActionTiledGrid.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/longlovewen/MyMoonWarrior/HEAD/MyMoonWarrior/libs/cocos2dx/actions/CCActionTiledGrid.cpp
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/extensions/GUI/CCControlExtension/CCControl.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/longlovewen/MyMoonWarrior/HEAD/MyMoonWarrior/libs/extensions/GUI/CCControlExtension/CCControl.h
--------------------------------------------------------------------------------
/MyMoonWarrior.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/extensions/GUI/CCControlExtension/CCControlSlider.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/longlovewen/MyMoonWarrior/HEAD/MyMoonWarrior/libs/extensions/GUI/CCControlExtension/CCControlSlider.h
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/cocos2dx/platform/third_party/ios/libraries/libcurl.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/longlovewen/MyMoonWarrior/HEAD/MyMoonWarrior/libs/cocos2dx/platform/third_party/ios/libraries/libcurl.a
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/extensions/GUI/CCControlExtension/CCControlSaturationBrightnessPicker.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/longlovewen/MyMoonWarrior/HEAD/MyMoonWarrior/libs/extensions/GUI/CCControlExtension/CCControlSaturationBrightnessPicker.h
--------------------------------------------------------------------------------
/MyMoonWarrior/Prefix.pch:
--------------------------------------------------------------------------------
1 | //
2 | // Prefix header for all source files of the 'MyMoonWarrior' target in the 'MyMoonWarrior' project
3 | //
4 |
5 | #ifdef __OBJC__
6 | #import
7 | #import
8 | #endif
9 |
--------------------------------------------------------------------------------
/MyMoonWarrior.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/MyMoonWarrior.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/longlovewen/MyMoonWarrior/HEAD/MyMoonWarrior.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/MyMoonWarrior/ios/RootViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // MyMoonWarriorAppController.h
3 | // MyMoonWarrior
4 | //
5 | // Created by cesc on 13-3-2.
6 | // Copyright __MyCompanyName__ 2013年. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 |
12 | @interface RootViewController : UIViewController {
13 |
14 | }
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/extensions/CCBReader/CCNodeLoaderListener.h:
--------------------------------------------------------------------------------
1 | #ifndef _CCB_CCNODELOADERLISTENER_H_
2 | #define _CCB_CCNODELOADERLISTENER_H_
3 |
4 | #include "cocos2d.h"
5 |
6 | NS_CC_EXT_BEGIN
7 |
8 | class CCNodeLoaderListener {
9 | public:
10 | virtual ~CCNodeLoaderListener() {};
11 |
12 | virtual void onNodeLoaded(CCNode * pNode, CCNodeLoader * pNodeLoader) = 0;
13 | };
14 |
15 | NS_CC_EXT_END
16 |
17 | #endif
18 |
--------------------------------------------------------------------------------
/MyMoonWarrior/Classes/header/EnumAndStruct.h:
--------------------------------------------------------------------------------
1 | //
2 | // EnumAndStruct.h
3 | // MyMoonWarrior
4 | //
5 | // Created by cesc on 13-3-17.
6 | //
7 | //
8 |
9 | #ifndef MyMoonWarrior_EnumAndStruct_h
10 | #define MyMoonWarrior_EnumAndStruct_h
11 |
12 | // 敌机的枚举
13 |
14 | enum Monster {
15 | monster1 = 0,
16 | monster2 = 1,
17 | monster3 = 2,
18 | monster4 = 3 ,
19 | monster5 = 4,
20 | monster6 = 5
21 | };
22 |
23 | #endif
24 |
--------------------------------------------------------------------------------
/MyMoonWarrior/ios/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // MyMoonWarrior
4 | //
5 | // Created by cesc on 13-3-2.
6 | // Copyright __MyCompanyName__ 2013年. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | int main(int argc, char *argv[]) {
12 |
13 | NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
14 | int retVal = UIApplicationMain(argc, argv, nil, @"AppController");
15 | [pool release];
16 | return retVal;
17 | }
18 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/cocos2dx/platform/ios/CCPlatformDefine.h:
--------------------------------------------------------------------------------
1 | #ifndef __CCPLATFORMDEFINE_H__
2 | #define __CCPLATFORMDEFINE_H__
3 |
4 | #include
5 |
6 | #define CC_DLL
7 |
8 | #define CC_ASSERT(cond) assert(cond)
9 |
10 |
11 | #define CC_UNUSED_PARAM(unusedparam) (void)unusedparam
12 |
13 | /* Define NULL pointer value */
14 | #ifndef NULL
15 | #ifdef __cplusplus
16 | #define NULL 0
17 | #else
18 | #define NULL ((void *)0)
19 | #endif
20 | #endif
21 |
22 |
23 |
24 | #endif /* __CCPLATFORMDEFINE_H__*/
25 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/extensions/CCBReader/CCMenuLoader.h:
--------------------------------------------------------------------------------
1 | #ifndef _CCB_CCMENULOADER_H_
2 | #define _CCB_CCMENULOADER_H_
3 |
4 | #include "CCLayerLoader.h"
5 |
6 | NS_CC_EXT_BEGIN
7 |
8 | /* Forward declaration. */
9 | class CCBReader;
10 |
11 | class CCMenuLoader : public CCLayerLoader {
12 | public:
13 | virtual ~CCMenuLoader() {};
14 | CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(CCMenuLoader, loader);
15 |
16 | protected:
17 | CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(CCMenu);
18 | };
19 |
20 | NS_CC_EXT_END
21 |
22 | #endif
23 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/extensions/CCBReader/CCData.h:
--------------------------------------------------------------------------------
1 |
2 | #ifndef __CCB_CCDATA_H__
3 | #define __CCB_CCDATA_H__
4 |
5 | #include "cocos2d.h"
6 | #include "ExtensionMacros.h"
7 |
8 | NS_CC_EXT_BEGIN
9 |
10 | class CCData : public CCObject
11 | {
12 | public:
13 | CCData(unsigned char *pBytes, const unsigned long nSize);
14 | CCData(CCData *pData);
15 | ~CCData();
16 |
17 | unsigned char* getBytes();
18 |
19 | private:
20 | unsigned char* m_pBytes;
21 | unsigned long m_nSize;
22 | };
23 |
24 | NS_CC_EXT_END
25 |
26 | #endif // __CCB_CCDATA_H__
27 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/extensions/CCBReader/CCNode+CCBRelativePositioning.h:
--------------------------------------------------------------------------------
1 | #ifndef __CCB_CCNODE_RELATIVEPOSITIONING_H__
2 | #define __CCB_CCNODE_RELATIVEPOSITIONING_H__
3 |
4 | #include "cocos2d.h"
5 | #include "ExtensionMacros.h"
6 |
7 | NS_CC_EXT_BEGIN
8 |
9 | extern CCPoint getAbsolutePosition(const CCPoint &pt, int nType, const CCSize &containerSize, const char *pPropName);
10 |
11 | extern void setRelativeScale(CCNode *pNode, float fScaleX, float fScaleY, int nType, const char* pPropName);
12 |
13 | NS_CC_EXT_END
14 |
15 | #endif // __CCB_CCNODE_RELATIVEPOSITIONING_H__
16 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/cocos2dx/kazmath/src/CMakeLists.txt:
--------------------------------------------------------------------------------
1 |
2 | #ADD_LIBRARY(Kazmath STATIC ${KAZMATH_SRCS})
3 | #INSTALL(TARGETS Kazmath ARCHIVE DESTINATION lib)
4 |
5 | INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/include )
6 |
7 | ADD_LIBRARY(kazmath STATIC ${KAZMATH_SOURCES})
8 | INSTALL(TARGETS kazmath ARCHIVE DESTINATION lib)
9 |
10 | #ADD_LIBRARY(KazmathGL STATIC ${GL_UTILS_SRCS})
11 | #INSTALL(TARGETS KazmathGL ARCHIVE DESTINATION lib)
12 |
13 | INSTALL(FILES ${KAZMATH_HEADERS} DESTINATION include/kazmath)
14 | INSTALL(FILES ${GL_UTILS_HEADERS} DESTINATION include/kazmath/GL)
15 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/extensions/CCBReader/CCData.cpp:
--------------------------------------------------------------------------------
1 | #include "CCData.h"
2 |
3 | NS_CC_EXT_BEGIN
4 |
5 | CCData::CCData(unsigned char *pBytes, const unsigned long nSize)
6 | : m_pBytes(pBytes)
7 | , m_nSize(nSize)
8 | {}
9 |
10 | CCData::CCData(CCData *pData)
11 | {
12 | m_nSize = pData->m_nSize;
13 | m_pBytes = new unsigned char[m_nSize];
14 | memcpy(m_pBytes, pData->m_pBytes, m_nSize);
15 | }
16 |
17 | CCData::~CCData()
18 | {
19 | CC_SAFE_DELETE_ARRAY(m_pBytes);
20 | }
21 |
22 | unsigned char* CCData::getBytes()
23 | {
24 | return m_pBytes;
25 | }
26 |
27 | NS_CC_EXT_END
28 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/cocos2dx/shaders/ccShader_Position_uColor_frag.h:
--------------------------------------------------------------------------------
1 | " \n\
2 | #ifdef GL_ES \n\
3 | precision lowp float; \n\
4 | #endif \n\
5 | \n\
6 | varying vec4 v_fragmentColor; \n\
7 | \n\
8 | void main() \n\
9 | { \n\
10 | gl_FragColor = v_fragmentColor; \n\
11 | } \n\
12 | ";
13 |
--------------------------------------------------------------------------------
/MyMoonWarrior/ios/AppController.h:
--------------------------------------------------------------------------------
1 | //
2 | // MyMoonWarriorAppController.h
3 | // MyMoonWarrior
4 | //
5 | // Created by cesc on 13-3-2.
6 | // Copyright __MyCompanyName__ 2013年. All rights reserved.
7 | //
8 |
9 | @class RootViewController;
10 |
11 | @interface AppController : NSObject {
12 | UIWindow *window;
13 | RootViewController *viewController;
14 | }
15 |
16 | @property (nonatomic, retain) UIWindow *window;
17 | @property (nonatomic, retain) RootViewController *viewController;
18 |
19 | @end
20 |
21 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/extensions/CCBReader/CCBFileLoader.cpp:
--------------------------------------------------------------------------------
1 | #include "CCBFileLoader.h"
2 |
3 |
4 |
5 | NS_CC_EXT_BEGIN
6 |
7 | #define PROPERTY_CCBFILE "ccbFile"
8 |
9 | void CCBFileLoader::onHandlePropTypeCCBFile(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, CCNode * pCCBFileNode, CCBReader * pCCBReader) {
10 | if(pPropertyName->compare(PROPERTY_CCBFILE) == 0) {
11 | ((CCBFile*)pNode)->setCCBFileNode(pCCBFileNode);
12 | } else {
13 | CCNodeLoader::onHandlePropTypeCCBFile(pNode, pParent, pPropertyName, pCCBFileNode, pCCBReader);
14 | }
15 | }
16 |
17 | NS_CC_EXT_END
18 |
--------------------------------------------------------------------------------
/MyMoonWarrior/Classes/layer/ScoreLayer.h:
--------------------------------------------------------------------------------
1 | //
2 | // ScoreLayer.h
3 | // MyMoonWarrior
4 | //
5 | // Created by cesc on 13-3-10.
6 | //
7 | //
8 |
9 | #ifndef __MyMoonWarrior__ScoreLayer__
10 | #define __MyMoonWarrior__ScoreLayer__
11 |
12 |
13 | #include "BasicLayer.h"
14 |
15 | class ScoreLayer: public BasicLayer {
16 |
17 |
18 | public:
19 | ScoreLayer();
20 | ~ScoreLayer();
21 |
22 | virtual bool init();
23 |
24 | void setupViews();
25 |
26 | CREATE_FUNC( ScoreLayer );
27 |
28 |
29 |
30 | };
31 |
32 | #endif /* defined(__MyMoonWarrior__ScoreLayer__) */
33 |
--------------------------------------------------------------------------------
/MyMoonWarrior.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | MyMoonWarrior.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | CEFC4FFB16E108010030FAE9
16 |
17 | primary
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/MyMoonWarrior/Classes/utils/Effects.h:
--------------------------------------------------------------------------------
1 | //
2 | // Effects.h
3 | // MyMoonWarrior
4 | //
5 | // Created by cesc on 13-4-14.
6 | //
7 | //
8 |
9 | #ifndef __MyMoonWarrior__Effects__
10 | #define __MyMoonWarrior__Effects__
11 |
12 | #include
13 | #include "cocos2d.h"
14 |
15 | USING_NS_CC;
16 |
17 | class Effects {
18 |
19 |
20 | public:
21 |
22 | static Effects* sharedEffects();
23 |
24 | // 预加载动画到CCAnimationCache中
25 | void preLoad();
26 |
27 | void boom( CCNode* target, CCPoint point );
28 |
29 | void boom_callback( CCNode* pNode );
30 |
31 |
32 | };
33 | #endif /* defined(__MyMoonWarrior__Effects__) */
34 |
--------------------------------------------------------------------------------
/MyMoonWarrior/Classes/CescMenu.h:
--------------------------------------------------------------------------------
1 | //
2 | // CescMenu.h
3 | // MyMoonWarrior
4 | //
5 | // Created by cesc on 13-7-14.
6 | //
7 | //
8 |
9 | #ifndef __MyMoonWarrior__CescMenu__
10 | #define __MyMoonWarrior__CescMenu__
11 |
12 | #include "cocos2d.h"
13 | USING_NS_CC;
14 |
15 | class CescMenu : public CCMenu {
16 |
17 |
18 | public:
19 |
20 |
21 | /** creates a CCMenu with it's items */
22 | static CescMenu* create(CCMenuItem* item, ...);
23 |
24 | /** initializes a CCMenu with it's items */
25 | bool initWithItems(CCMenuItem* item, va_list args);
26 | void registerWithTouchDispatcher();
27 | };
28 |
29 | #endif /* defined(__MyMoonWarrior__CescMenu__) */
30 |
--------------------------------------------------------------------------------
/MyMoonWarrior/Classes/utils/DLog.h:
--------------------------------------------------------------------------------
1 | //
2 | // DLog.h
3 | // MyMoonWarrior
4 | //
5 | // Created by cesc on 13-3-10.
6 | //
7 | //
8 |
9 | #ifndef __MyMoonWarrior__DLog__
10 | #define __MyMoonWarrior__DLog__
11 |
12 | #include
13 |
14 | #include "cocos2d.h"
15 | USING_NS_CC;
16 |
17 | // Log 工具类
18 | class DLog {
19 | public:
20 | const static bool flag = true;
21 |
22 | public:
23 |
24 | DLog();
25 | ~DLog();
26 | void d( const char * pszFormat, ... );
27 |
28 |
29 | static DLog* sharedDLog();
30 |
31 |
32 | void purge();
33 |
34 |
35 |
36 |
37 |
38 | };
39 | #endif /* defined(__MyMoonWarrior__DLog__) */
40 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/extensions/CCBReader/CCLayerLoader.h:
--------------------------------------------------------------------------------
1 | #ifndef _CCB_CCLAYERLOADER_H_
2 | #define _CCB_CCLAYERLOADER_H_
3 |
4 | #include "CCNodeLoader.h"
5 |
6 | NS_CC_EXT_BEGIN
7 |
8 | /* Forward declaration. */
9 | class CCBReader;
10 |
11 | class CCLayerLoader : public CCNodeLoader {
12 | public:
13 | virtual ~CCLayerLoader() {};
14 | CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(CCLayerLoader, loader);
15 |
16 | protected:
17 | CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(CCLayer);
18 |
19 | virtual void onHandlePropTypeCheck(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, bool pCheck, CCBReader * pCCBReader);
20 | };
21 |
22 | NS_CC_EXT_END
23 |
24 | #endif
25 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/cocos2dx/shaders/ccShader_PositionColor_frag.h:
--------------------------------------------------------------------------------
1 | " \n\
2 | #ifdef GL_ES \n\
3 | precision lowp float; \n\
4 | #endif \n\
5 | \n\
6 | varying vec4 v_fragmentColor; \n\
7 | \n\
8 | void main() \n\
9 | { \n\
10 | gl_FragColor = v_fragmentColor; \n\
11 | } \n\
12 | ";
13 |
--------------------------------------------------------------------------------
/MyMoonWarrior/Classes/HelloWorldScene.h:
--------------------------------------------------------------------------------
1 | #ifndef __HELLOWORLD_SCENE_H__
2 | #define __HELLOWORLD_SCENE_H__
3 |
4 | #include "cocos2d.h"
5 |
6 | class HelloWorld : public cocos2d::CCLayer
7 | {
8 | public:
9 | // Method 'init' in cocos2d-x returns bool, instead of 'id' in cocos2d-iphone (an object pointer)
10 | virtual bool init();
11 |
12 | // there's no 'id' in cpp, so we recommend to return the class instance pointer
13 | static cocos2d::CCScene* scene();
14 |
15 | // a selector callback
16 | void menuCloseCallback(CCObject* pSender);
17 |
18 | // preprocessor macro for "static create()" constructor ( node() deprecated )
19 | CREATE_FUNC(HelloWorld);
20 | };
21 |
22 | #endif // __HELLOWORLD_SCENE_H__
23 |
--------------------------------------------------------------------------------
/MyMoonWarrior/Classes/layer/TimerLayer.h:
--------------------------------------------------------------------------------
1 | //
2 | // TimerLayer.h
3 | // MyMoonWarrior
4 | //
5 | // Created by cesc on 13-3-10.
6 | //
7 | //
8 |
9 | #ifndef __MyMoonWarrior__TimerLayer__
10 | #define __MyMoonWarrior__TimerLayer__
11 |
12 | #include
13 | #include "BasicLayer.h"
14 |
15 |
16 |
17 | class TimerLayer: public BasicLayer {
18 |
19 |
20 | public:
21 | TimerLayer();
22 | ~TimerLayer();
23 |
24 | virtual bool init();
25 |
26 | void setupViews();
27 |
28 | CREATE_FUNC( TimerLayer );
29 |
30 |
31 | void time_counting_down( float t );
32 |
33 | private:
34 | int counter;
35 |
36 | };
37 |
38 | #endif /* defined(__MyMoonWarrior__TimerLayer__) */
39 |
--------------------------------------------------------------------------------
/MyMoonWarrior/Classes/NewBullet.h:
--------------------------------------------------------------------------------
1 | //
2 | // NewBullet.h
3 | // MyMoonWarrior
4 | //
5 | // Created by cesc on 13-7-14.
6 | //
7 | //
8 |
9 | #ifndef __MyMoonWarrior__NewBullet__
10 | #define __MyMoonWarrior__NewBullet__
11 |
12 | #include "cocos2d.h"
13 | USING_NS_CC;
14 |
15 |
16 | class NewBullet : public CCSprite {
17 |
18 |
19 | public:
20 |
21 | static NewBullet* createWithSpriteFrame(CCSpriteFrame *pSpriteFrame);
22 |
23 |
24 | bool initWithSpriteFrame(CCSpriteFrame *pSpriteFrame);
25 |
26 | static NewBullet* createWithSpriteFrameName(const char *pszSpriteFrameName);
27 |
28 | CC_SYNTHESIZE(int, bullettag,BulletTag );
29 | };
30 |
31 | #endif /* defined(__MyMoonWarrior__NewBullet__) */
32 |
--------------------------------------------------------------------------------
/MyMoonWarrior/Classes/layer/ AboutLayer.h:
--------------------------------------------------------------------------------
1 | //
2 | // AboutLayer.h
3 | // MyMoonWarrior
4 | //
5 | // Created by cesc on 13-3-2.
6 | //
7 | //
8 |
9 | #ifndef __MyMoonWarrior___AboutLayer__
10 | #define __MyMoonWarrior___AboutLayer__
11 |
12 | #include "BasicLayer.h"
13 |
14 | class AboutLayer : public BasicLayer
15 | {
16 |
17 | public:
18 |
19 | public:
20 | AboutLayer();
21 | ~AboutLayer();
22 |
23 | virtual bool init();
24 |
25 |
26 | static CCScene* scene();
27 |
28 | CREATE_FUNC( AboutLayer );
29 |
30 |
31 | void setupViews();
32 |
33 | void back_callback( CCObject* pSender );
34 |
35 |
36 | };
37 |
38 | #endif /* defined(__MyMoonWarrior___AboutLayer__) */
39 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/extensions/CCBReader/CCBFileLoader.h:
--------------------------------------------------------------------------------
1 | #ifndef _CCB_CCBFILELOADER_H_
2 | #define _CCB_CCBFILELOADER_H_
3 |
4 | #include "CCNodeLoader.h"
5 | #include "CCBReader.h"
6 |
7 | NS_CC_EXT_BEGIN
8 |
9 | /* Forward declaration. */
10 | class CCBReader;
11 |
12 | class CCBFileLoader : public CCNodeLoader {
13 | public:
14 | virtual ~CCBFileLoader() {};
15 | CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(CCBFileLoader, loader);
16 |
17 | protected:
18 | CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(CCBFile);
19 |
20 | virtual void onHandlePropTypeCCBFile(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, CCNode * pCCBFileNode, CCBReader * pCCBReader);
21 | };
22 |
23 | NS_CC_EXT_END
24 |
25 | #endif
26 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/CocosDenshion/include/Export.h:
--------------------------------------------------------------------------------
1 | #ifndef __EXPORT_COMMON__
2 | #define __EXPORT_COMMON__
3 |
4 | #if defined(SHP)
5 | #include
6 | #define EXPORT_DLL _EXPORT_
7 | #elif defined(_WIN32)
8 | #if defined(_EXPORT_DLL_)
9 | #define EXPORT_DLL __declspec(dllexport)
10 | #elif defined(IGNORE_EXPORT)
11 | #define EXPORT_DLL
12 | #else /* use a DLL library */
13 | #define EXPORT_DLL __declspec(dllimport)
14 | #endif
15 | #else
16 | #if defined(_SHARED_)
17 | #define EXPORT_DLL __attribute__((visibility("default")))
18 | #elif defined(IGNORE_EXPORT)
19 | #define EXPORT_DLL
20 | #else
21 | #define EXPORT_DLL
22 | #endif
23 | #endif
24 |
25 | #endif // end of __EXPORT_COMMON__
26 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/cocos2dx/shaders/ccShader_PositionTextureColor_frag.h:
--------------------------------------------------------------------------------
1 | " \n\
2 | #ifdef GL_ES \n\
3 | precision lowp float; \n\
4 | #endif \n\
5 | \n\
6 | varying vec4 v_fragmentColor; \n\
7 | varying vec2 v_texCoord; \n\
8 | uniform sampler2D u_texture; \n\
9 | \n\
10 | void main() \n\
11 | { \n\
12 | gl_FragColor = v_fragmentColor * texture2D(u_texture, v_texCoord); \n\
13 | } \n\
14 | ";
15 |
--------------------------------------------------------------------------------
/MyMoonWarrior/Classes/layer/BasicLayer.h:
--------------------------------------------------------------------------------
1 | //
2 | // BasicLayer.h
3 | // MyMoonWarrior
4 | //
5 | // Created by cesc on 13-3-2.
6 | //
7 | //
8 |
9 | #ifndef __MyMoonWarrior__BasicLayer__
10 | #define __MyMoonWarrior__BasicLayer__
11 |
12 | #include
13 | #include "cocos2d.h"
14 | #include "SimpleAudioEngine.h"
15 |
16 |
17 | USING_NS_CC;
18 |
19 | using namespace CocosDenshion;
20 |
21 | class BasicLayer : public CCLayer{
22 |
23 | public:
24 | BasicLayer();
25 | ~BasicLayer();
26 |
27 | virtual bool init();
28 |
29 |
30 | CCSize getWinSize();
31 |
32 | CREATE_FUNC( BasicLayer );
33 |
34 | void setBackgroundImage( const char* back_image_name );
35 |
36 |
37 |
38 | };
39 |
40 | #endif /* defined(__MyMoonWarrior__BasicLayer__) */
41 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/extensions/CCBReader/CCBSequenceProperty.h:
--------------------------------------------------------------------------------
1 | #ifndef __CCB_SEQUENCE_PROPERTY_H__
2 | #define __CCB_SEQUENCE_PROPERTY_H__
3 |
4 | #include "cocos2d.h"
5 | #include "ExtensionMacros.h"
6 | #include "CCBKeyframe.h"
7 |
8 | NS_CC_EXT_BEGIN
9 |
10 | class CCBSequenceProperty : public CCObject
11 | {
12 | private:
13 | std::string mName;
14 | int mType;
15 | CCArray *mKeyframes;
16 |
17 | public:
18 | CCBSequenceProperty();
19 | ~CCBSequenceProperty();
20 |
21 | virtual bool init();
22 |
23 | const char* getName();
24 | void setName(const char* pName);
25 |
26 | int getType();
27 | void setType(int nType);
28 |
29 | CCArray* getKeyframes();
30 | };
31 |
32 | NS_CC_EXT_END
33 |
34 | #endif // __CCB_SEQUENCE_PROPERTY_H__
35 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/extensions/CCBReader/CCMenuItemImageLoader.h:
--------------------------------------------------------------------------------
1 | #ifndef _CCB_CCMENUITEMIMAGELOADER_H_
2 | #define _CCB_CCMENUITEMIMAGELOADER_H_
3 |
4 | #include "CCMenuItemLoader.h"
5 |
6 | NS_CC_EXT_BEGIN
7 |
8 | /* Forward declaration. */
9 | class CCBReader;
10 |
11 | class CCMenuItemImageLoader : public CCMenuItemLoader {
12 | public:
13 | virtual ~CCMenuItemImageLoader() {};
14 | CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(CCMenuItemImageLoader, loader);
15 |
16 | protected:
17 | CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(CCMenuItemImage);
18 |
19 | virtual void onHandlePropTypeSpriteFrame(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, CCSpriteFrame * pCCSpriteFrame, CCBReader * pCCBReader);
20 | };
21 |
22 | NS_CC_EXT_END
23 |
24 | #endif
25 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/cocos2dx/include/CCEventType.h:
--------------------------------------------------------------------------------
1 |
2 | #ifndef __CCEVENT_TYPE_H__
3 | #define __CCEVENT_TYPE_H__
4 |
5 | /**
6 | * This header is used for defining event types using in CCNotificationCenter
7 | */
8 |
9 | // The application will come to foreground.
10 | // This message is used for reloading resources before come to foreground on Android.
11 | // This message is posted in main.cpp.
12 | #define EVNET_COME_TO_FOREGROUND "event_come_to_foreground"
13 |
14 | // The application will come to background.
15 | // This message is used for doing something before coming to background, such as save CCRenderTexture.
16 | // This message is posted in cocos2dx/platform/android/jni/MessageJni.cpp.
17 | #define EVENT_COME_TO_BACKGROUND "event_come_to_background"
18 |
19 | #endif // __CCEVENT_TYPE_H__
20 |
--------------------------------------------------------------------------------
/MyMoonWarrior/Classes/layer/OptionLayer.h:
--------------------------------------------------------------------------------
1 | //
2 | // OptionLayer.h
3 | // MyMoonWarrior
4 | //
5 | // Created by cesc on 13-3-4.
6 | //
7 | //
8 |
9 | #ifndef __MyMoonWarrior__OptionLayer__
10 | #define __MyMoonWarrior__OptionLayer__
11 |
12 | #include "BasicLayer.h"
13 |
14 | class OptionLayer : public BasicLayer
15 | {
16 |
17 | public:
18 |
19 | public:
20 | OptionLayer();
21 | ~OptionLayer();
22 |
23 | virtual bool init();
24 |
25 |
26 | static CCScene* scene();
27 |
28 | CREATE_FUNC( OptionLayer );
29 |
30 |
31 | void setupViews();
32 |
33 | void back_callback( CCObject* pSender );
34 |
35 |
36 | void music_trigger_callback( CCObject* pSender );
37 |
38 | };
39 |
40 | #endif /* defined(__MyMoonWarrior__OptionLayer__) */
41 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/extensions/CCBReader/CCMenuItemLoader.h:
--------------------------------------------------------------------------------
1 | #ifndef _CCB_CCMENUITEMLOADER_H_
2 | #define _CCB_CCMENUITEMLOADER_H_
3 |
4 | #include "CCLayerLoader.h"
5 |
6 | NS_CC_EXT_BEGIN
7 |
8 | /* Forward declaration. */
9 | class CCBReader;
10 |
11 | class CCMenuItemLoader : public CCNodeLoader {
12 | public:
13 | virtual ~CCMenuItemLoader() {};
14 |
15 | protected:
16 | CCB_PURE_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(CCMenuItem);
17 |
18 | virtual void onHandlePropTypeBlock(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, BlockData * pBlockData, CCBReader * pCCBReader);
19 | virtual void onHandlePropTypeCheck(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, bool pCheck, CCBReader * pCCBReader);
20 | };
21 |
22 | NS_CC_EXT_END
23 |
24 | #endif
25 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/cocos2dx/shaders/ccShader_PositionTexture_uColor_frag.h:
--------------------------------------------------------------------------------
1 | " \n\
2 | #ifdef GL_ES \n\
3 | precision lowp float; \n\
4 | #endif \n\
5 | \n\
6 | uniform vec4 u_color; \n\
7 | \n\
8 | varying vec2 v_texCoord; \n\
9 | \n\
10 | uniform sampler2D u_texture; \n\
11 | \n\
12 | void main() \n\
13 | { \n\
14 | gl_FragColor = texture2D(u_texture, v_texCoord) * u_color; \n\
15 | } \n\
16 | ";
17 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/extensions/CCBReader/CCBKeyframe.h:
--------------------------------------------------------------------------------
1 | #ifndef __CCB_KEYFRAME_H__
2 | #define __CCB_KEYFRAME_H__
3 |
4 | #include "cocos2d.h"
5 | #include "ExtensionMacros.h"
6 |
7 | NS_CC_EXT_BEGIN
8 |
9 | class CCBKeyframe : public CCObject
10 | {
11 | private:
12 | CCObject *mValue;
13 | float mTime;
14 | int mEasingType;
15 | float mEasingOpt;
16 |
17 | public:
18 | CCBKeyframe();
19 | ~CCBKeyframe();
20 |
21 | CCObject* getValue();
22 | void setValue(CCObject *pValue); // retain
23 |
24 | float getTime();
25 | void setTime(float fTime);
26 |
27 | int getEasingType();
28 | void setEasingType(int nEasingType);
29 |
30 | float getEasingOpt();
31 | void setEasingOpt(float fEasingOpt);
32 | };
33 |
34 | NS_CC_EXT_END
35 |
36 | #endif // __CCB_KEYFRAME_H__
37 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/cocos2dx/shaders/ccShader_PositionTexture_uColor_vert.h:
--------------------------------------------------------------------------------
1 | " \n\
2 | attribute vec4 a_position; \n\
3 | attribute vec2 a_texCoord; \n\
4 | \n\
5 | uniform mat4 u_MVPMatrix; \n\
6 | \n\
7 | #ifdef GL_ES \n\
8 | varying mediump vec2 v_texCoord; \n\
9 | #else \n\
10 | varying vec2 v_texCoord; \n\
11 | #endif \n\
12 | \n\
13 | void main() \n\
14 | { \n\
15 | gl_Position = u_MVPMatrix * a_position; \n\
16 | v_texCoord = a_texCoord; \n\
17 | } \n\
18 | ";
19 |
--------------------------------------------------------------------------------
/MyMoonWarrior/Classes/layer/ScoreLayer.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // ScoreLayer.cpp
3 | // MyMoonWarrior
4 | //
5 | // Created by cesc on 13-3-10.
6 | //
7 | //
8 |
9 | #include "ScoreLayer.h"
10 |
11 |
12 | ScoreLayer::ScoreLayer(){}
13 | ScoreLayer::~ScoreLayer(){}
14 |
15 | bool ScoreLayer::init(){
16 |
17 | if( !BasicLayer::init() ){
18 |
19 | return false;
20 | }
21 | setupViews();
22 |
23 | return true;
24 | }
25 |
26 |
27 | // 初始化控件
28 | void ScoreLayer::setupViews(){
29 |
30 | do {
31 | CCLabelBMFont* scoreFont = CCLabelBMFont::create("Score:20", "arial-14.fnt");
32 | scoreFont->setAnchorPoint( CCPointZero );
33 | scoreFont->setPosition( CCPointZero );
34 | scoreFont->setScale( 1.5f);
35 | this->addChild( scoreFont );
36 |
37 | } while (0);
38 |
39 |
40 | }
41 |
42 |
43 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/extensions/CCBReader/CCBSequence.h:
--------------------------------------------------------------------------------
1 | #ifndef __CCB_CCSEQUENCE_H__
2 | #define __CCB_CCSEQUENCE_H__
3 |
4 | #include
5 | #include "cocos2d.h"
6 | #include "ExtensionMacros.h"
7 |
8 | NS_CC_EXT_BEGIN
9 |
10 | class CCBSequence : public CCObject
11 | {
12 | private:
13 | float mDuration;
14 | std::string mName;
15 | int mSequenceId;
16 | int mChainedSequenceId;
17 |
18 | public:
19 | CCBSequence();
20 |
21 | float getDuration();
22 | void setDuration(float fDuration);
23 |
24 | const char* getName();
25 | void setName(const char *pName);
26 |
27 | int getSequenceId();
28 | void setSequenceId(int nSequenceId);
29 |
30 | int getChainedSequenceId();
31 | void setChainedSequenceId(int nChainedSequenceId);
32 | };
33 |
34 |
35 | NS_CC_EXT_END
36 |
37 |
38 | #endif // __CCB_CCSEQUENCE_H__
39 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/extensions/CCBReader/CCControlLoader.h:
--------------------------------------------------------------------------------
1 | #ifndef _CCB_CCCONTROLLOADER_H_
2 | #define _CCB_CCCONTROLLOADER_H_
3 |
4 | #include "CCNodeLoader.h"
5 | #include "../GUI/CCControlExtension/CCControl.h"
6 |
7 | NS_CC_EXT_BEGIN
8 |
9 | /* Forward declaration. */
10 | class CCBReader;
11 |
12 | class CCControlLoader : public CCNodeLoader {
13 | public:
14 | virtual ~CCControlLoader() {};
15 |
16 | protected:
17 | CCB_PURE_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(CCControl);
18 |
19 | virtual void onHandlePropTypeBlockCCControl(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, BlockCCControlData * pBlockCCControlData, CCBReader * pCCBReader);
20 | virtual void onHandlePropTypeCheck(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, bool pCheck, CCBReader * pCCBReader);
21 | };
22 |
23 | NS_CC_EXT_END
24 |
25 | #endif
26 |
--------------------------------------------------------------------------------
/MyMoonWarrior/Classes/enemy/EnemyManager.h:
--------------------------------------------------------------------------------
1 | //
2 | // EnemyManager.h
3 | // MyMoonWarrior
4 | //
5 | // Created by cesc on 13-3-27.
6 | //
7 | //
8 |
9 | #ifndef __MyMoonWarrior__EnemyManager__
10 | #define __MyMoonWarrior__EnemyManager__
11 |
12 | #include
13 |
14 |
15 | #include "BasicLayer.h"
16 | #include "EnumAndStruct.h"
17 |
18 | class EnemyManager : public BasicLayer {
19 |
20 |
21 | public:
22 |
23 |
24 | // 敌机的管理的数组
25 | CCArray* enemyArray;
26 |
27 | public:
28 |
29 | EnemyManager();
30 | ~EnemyManager();
31 |
32 | virtual bool init();
33 |
34 | void setupViews();
35 |
36 | CREATE_FUNC( EnemyManager );
37 |
38 |
39 | void addEnemy( float t );
40 |
41 |
42 | CCArray* getEnemyArray( );
43 |
44 |
45 | };
46 |
47 |
48 | #endif /* defined(__MyMoonWarrior__EnemyManager__) */
49 |
--------------------------------------------------------------------------------
/MyMoonWarrior/Classes/layer/PauseLayer.h:
--------------------------------------------------------------------------------
1 | //
2 | // PauseLayer.h
3 | // MyMoonWarrior
4 | //
5 | // Created by cesc on 13-3-10.
6 | //
7 | //
8 |
9 | #ifndef __MyMoonWarrior__PauseLayer__
10 | #define __MyMoonWarrior__PauseLayer__
11 |
12 | #include "BasicLayer.h"
13 |
14 |
15 | // 暂停布景
16 | class PauseLayer: public CCLayerColor {
17 |
18 |
19 | public:
20 | PauseLayer();
21 | ~PauseLayer();
22 |
23 | virtual bool init();
24 |
25 | void setupViews();
26 |
27 | CREATE_FUNC( PauseLayer );
28 |
29 | virtual void registerWithTouchDispatcher(void);
30 |
31 |
32 |
33 | virtual bool ccTouchBegan(CCTouch *pTouch, CCEvent *pEvent);
34 |
35 |
36 |
37 | void play_logic( CCObject* pSender);
38 |
39 | void to_cover_logic( CCObject* psender );
40 |
41 |
42 | };
43 |
44 |
45 | #endif /* defined(__MyMoonWarrior__PauseLayer__) */
46 |
--------------------------------------------------------------------------------
/MyMoonWarrior/Classes/utils/DLog.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // DLog.cpp
3 | // MyMoonWarrior
4 | //
5 | // Created by cesc on 13-3-10.
6 | //
7 | //
8 |
9 | #include "DLog.h"
10 |
11 | DLog::DLog(){}
12 | DLog::~DLog(){}
13 |
14 |
15 | // 显示字符串log
16 | void DLog::d( const char * pszFormat, ...){
17 |
18 | if( flag ){
19 | printf("龙灵修的Log: ");
20 | char szBuf[kMaxLogLen];
21 |
22 | va_list ap;
23 | va_start(ap, pszFormat);
24 | vsnprintf(szBuf, kMaxLogLen, pszFormat, ap);
25 | va_end(ap);
26 | printf("%s", szBuf);
27 | printf("\n");
28 | }
29 |
30 |
31 | }
32 |
33 | static DLog* instance = NULL;
34 | DLog* DLog::sharedDLog(){
35 |
36 | if (!instance ) {
37 |
38 | instance = new DLog();
39 | }
40 |
41 | return instance;
42 |
43 | }
44 |
45 |
46 | void DLog::purge(){
47 |
48 | CC_SAFE_DELETE( instance );
49 | }
50 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/cocos2dx/cocoa/CCInteger.h:
--------------------------------------------------------------------------------
1 | #ifndef __CCINTEGER_H__
2 | #define __CCINTEGER_H__
3 |
4 | #include "CCObject.h"
5 |
6 | NS_CC_BEGIN
7 |
8 | /**
9 | * @addtogroup data_structures
10 | * @{
11 | */
12 |
13 | class CC_DLL CCInteger : public CCObject
14 | {
15 | public:
16 | CCInteger(int v)
17 | : m_nValue(v) {}
18 | int getValue() const {return m_nValue;}
19 |
20 | // @deprecated: This interface will be deprecated sooner or later.
21 | CC_DEPRECATED_ATTRIBUTE static CCInteger* integerWithInt(int v)
22 | {
23 | return CCInteger::create(v);
24 | }
25 |
26 | static CCInteger* create(int v)
27 | {
28 | CCInteger* pRet = new CCInteger(v);
29 | pRet->autorelease();
30 | return pRet;
31 | }
32 | private:
33 | int m_nValue;
34 | };
35 |
36 | // end of data_structure group
37 | /// @}
38 |
39 | NS_CC_END
40 |
41 | #endif /* __CCINTEGER_H__ */
42 |
--------------------------------------------------------------------------------
/MyMoonWarrior/Classes/layer/WarriorLayer.h:
--------------------------------------------------------------------------------
1 | //
2 | // WarriorLayer.h
3 | // MyMoonWarrior
4 | //
5 | // Created by cesc on 13-3-14.
6 | //
7 | //
8 |
9 | #ifndef __MyMoonWarrior__WarriorLayer__
10 | #define __MyMoonWarrior__WarriorLayer__
11 |
12 | #include
13 | #include "BasicLayer.h"
14 |
15 | class WarriorLayer: public BasicLayer {
16 |
17 |
18 | public:
19 | WarriorLayer();
20 | ~WarriorLayer();
21 |
22 | virtual bool init();
23 |
24 | void setupViews();
25 |
26 | CREATE_FUNC( WarriorLayer );
27 |
28 | virtual bool ccTouchBegan(CCTouch *pTouch, CCEvent *pEvent);
29 |
30 | virtual void registerWithTouchDispatcher(void);
31 |
32 |
33 | CCPoint getHeroPosition();
34 |
35 | CCSize getHeroSize();
36 |
37 | void setEnabledTouch( bool flag );
38 |
39 |
40 | public:
41 | CCSprite* m_warrior;
42 |
43 |
44 | };
45 |
46 | #endif /* defined(__MyMoonWarrior__WarriorLayer__) */
47 |
--------------------------------------------------------------------------------
/MyMoonWarrior/Classes/layer/BasicLayer.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // BasicLayer.cpp
3 | // MyMoonWarrior
4 | //
5 | // Created by cesc on 13-3-2.
6 | //
7 | //
8 |
9 | #include "BasicLayer.h"
10 |
11 |
12 |
13 | BasicLayer::BasicLayer(){}
14 | BasicLayer::~BasicLayer(){}
15 |
16 |
17 | // 初始化方法
18 | bool BasicLayer::init(){
19 |
20 | bool sRect = false;
21 |
22 | do {
23 | CC_BREAK_IF( !CCLayer::init() );
24 |
25 | sRect = true;
26 | } while ( 0 );
27 |
28 | return sRect;
29 | }
30 |
31 |
32 | // 获取屏幕大小的方法
33 | CCSize BasicLayer::getWinSize(){
34 |
35 |
36 | return CCDirector::sharedDirector()->getWinSize();
37 | }
38 |
39 |
40 |
41 | // 设置背景图片的方法
42 | void BasicLayer::setBackgroundImage( const char* back_image_name ){
43 |
44 | CCSprite* sp = CCSprite::create( back_image_name );
45 | sp->setPosition( ccp( getWinSize().width / 2 , getWinSize().height / 2 ) );
46 | this->addChild( sp );
47 |
48 | }
--------------------------------------------------------------------------------
/MyMoonWarrior/Classes/layer/WelcomeLayer.h:
--------------------------------------------------------------------------------
1 | //
2 | // WelcomeLayer.h
3 | // MyMoonWarrior
4 | //
5 | // Created by cesc on 13-3-2.
6 | //
7 | //
8 |
9 | #ifndef __MyMoonWarrior__WelcomeLayer__
10 | #define __MyMoonWarrior__WelcomeLayer__
11 |
12 | #include
13 | #include "BasicLayer.h"
14 |
15 | class WelcomeLayer : public BasicLayer
16 | {
17 |
18 | public:
19 | WelcomeLayer();
20 | ~WelcomeLayer();
21 |
22 | virtual bool init();
23 |
24 |
25 | static CCScene* scene();
26 |
27 | CREATE_FUNC( WelcomeLayer );
28 |
29 |
30 |
31 | void setupViews();
32 |
33 | void startgame_callback( CCObject* pSender );
34 | void option_callback( CCObject* pSender );
35 | void about_callback( CCObject* pSender );
36 |
37 | virtual void onEnter();
38 |
39 |
40 | void action_callback( CCNode* node );
41 |
42 |
43 |
44 | };
45 | #endif /* defined(__MyMoonWarrior__WelcomeLayer__) */
46 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/extensions/CCBReader/CCBSequenceProperty.cpp:
--------------------------------------------------------------------------------
1 | #include "CCBSequenceProperty.h"
2 |
3 | using namespace cocos2d;
4 | using namespace std;
5 |
6 | NS_CC_EXT_BEGIN
7 |
8 | CCBSequenceProperty::CCBSequenceProperty()
9 | : mName("")
10 | , mType(0)
11 | {
12 | init();
13 | }
14 |
15 | bool CCBSequenceProperty::init()
16 | {
17 | mKeyframes = new CCArray();
18 |
19 | return true;
20 | }
21 |
22 | CCBSequenceProperty::~CCBSequenceProperty()
23 | {
24 | CC_SAFE_RELEASE_NULL(mKeyframes);
25 | }
26 |
27 | const char* CCBSequenceProperty::getName()
28 | {
29 | return mName.c_str();
30 | }
31 |
32 | void CCBSequenceProperty::setName(const char *pName)
33 | {
34 | mName = pName;
35 | }
36 |
37 | int CCBSequenceProperty::getType()
38 | {
39 | return mType;
40 | }
41 |
42 | void CCBSequenceProperty::setType(int nType)
43 | {
44 | mType = nType;
45 | }
46 |
47 | CCArray* CCBSequenceProperty::getKeyframes()
48 | {
49 | return mKeyframes;
50 | }
51 |
52 | NS_CC_EXT_END
53 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/cocos2dx/shaders/ccShader_PositionTexture_frag.h:
--------------------------------------------------------------------------------
1 | " \n\
2 | #ifdef GL_ES \n\
3 | precision lowp float; \n\
4 | #endif \n\
5 | \n\
6 | varying vec2 v_texCoord; \n\
7 | uniform sampler2D u_texture; \n\
8 | \n\
9 | void main() \n\
10 | { \n\
11 | gl_FragColor = texture2D(u_texture, v_texCoord); \n\
12 | } \n\
13 | ";
14 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/extensions/CCBReader/CCBMemberVariableAssigner.h:
--------------------------------------------------------------------------------
1 | #ifndef _CCB_CCBMEMBERVARIABLEASSIGNER_H_
2 | #define _CCB_CCBMEMBERVARIABLEASSIGNER_H_
3 |
4 | #include "cocos2d.h"
5 |
6 | NS_CC_EXT_BEGIN
7 |
8 | #define CCB_MEMBERVARIABLEASSIGNER_GLUE(TARGET, MEMBERVARIABLENAME, MEMBERVARIABLETYPE, MEMBERVARIABLE) \
9 | if (pTarget == TARGET && pMemberVariableName->compare(MEMBERVARIABLENAME) == 0) { \
10 | MEMBERVARIABLETYPE pOldVar = MEMBERVARIABLE; \
11 | MEMBERVARIABLE = dynamic_cast(pNode); \
12 | CC_ASSERT(MEMBERVARIABLE); \
13 | if (pOldVar != MEMBERVARIABLE) { \
14 | CC_SAFE_RELEASE(pOldVar); \
15 | MEMBERVARIABLE->retain(); \
16 | } \
17 | return true; \
18 | }
19 |
20 | class CCBMemberVariableAssigner {
21 | public:
22 | virtual ~CCBMemberVariableAssigner() {};
23 |
24 | virtual bool onAssignCCBMemberVariable(CCObject * pTarget, CCString * pMemberVariableName, CCNode * pNode) = 0;
25 | };
26 |
27 | NS_CC_EXT_END
28 |
29 | #endif
30 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/extensions/CCBReader/CCLayerColorLoader.h:
--------------------------------------------------------------------------------
1 | #ifndef _CCB_CCLAYERCOLORLOADER_H_
2 | #define _CCB_CCLAYERCOLORLOADER_H_
3 |
4 | #include "CCLayerLoader.h"
5 |
6 | NS_CC_EXT_BEGIN
7 |
8 | /* Forward declaration. */
9 | class CCBReader;
10 |
11 | class CCLayerColorLoader : public CCLayerLoader {
12 | public:
13 | virtual ~CCLayerColorLoader() {};
14 | CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(CCLayerColorLoader, loader);
15 |
16 | protected:
17 | CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(CCLayerColor);
18 |
19 | virtual void onHandlePropTypeColor3(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, ccColor3B pCCColor3B, CCBReader * pCCBReader);
20 | virtual void onHandlePropTypeByte(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, unsigned char pByte, CCBReader * pCCBReader);
21 | virtual void onHandlePropTypeBlendFunc(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, ccBlendFunc pCCBlendFunc, CCBReader * pCCBReader);
22 | };
23 |
24 | NS_CC_EXT_END
25 |
26 | #endif
27 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/cocos2dx/shaders/ccShader_PositionTexture_vert.h:
--------------------------------------------------------------------------------
1 | " \n\
2 | attribute vec4 a_position; \n\
3 | attribute vec2 a_texCoord; \n\
4 | uniform mat4 u_MVPMatrix; \n\
5 | \n\
6 | #ifdef GL_ES \n\
7 | varying mediump vec2 v_texCoord; \n\
8 | #else \n\
9 | varying vec2 v_texCoord; \n\
10 | #endif \n\
11 | \n\
12 | void main() \n\
13 | { \n\
14 | gl_Position = u_MVPMatrix * a_position; \n\
15 | v_texCoord = a_texCoord; \n\
16 | } \n\
17 | ";
18 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/cocos2dx/shaders/ccShader_PositionColor_vert.h:
--------------------------------------------------------------------------------
1 | " \n\
2 | attribute vec4 a_position; \n\
3 | attribute vec4 a_color; \n\
4 | uniform mat4 u_MVPMatrix; \n\
5 | \n\
6 | #ifdef GL_ES \n\
7 | varying lowp vec4 v_fragmentColor; \n\
8 | #else \n\
9 | varying vec4 v_fragmentColor; \n\
10 | #endif \n\
11 | \n\
12 | void main() \n\
13 | { \n\
14 | gl_Position = u_MVPMatrix * a_position; \n\
15 | v_fragmentColor = a_color; \n\
16 | } \n\
17 | ";
18 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/cocos2dx/shaders/ccShader_PositionTextureA8Color_frag.h:
--------------------------------------------------------------------------------
1 | " \n\
2 | #ifdef GL_ES \n\
3 | precision lowp float; \n\
4 | #endif \n\
5 | \n\
6 | varying vec4 v_fragmentColor; \n\
7 | varying vec2 v_texCoord; \n\
8 | uniform sampler2D u_texture; \n\
9 | \n\
10 | void main() \n\
11 | { \n\
12 | gl_FragColor = vec4( v_fragmentColor.rgb, // RGB from uniform \n\
13 | v_fragmentColor.a * texture2D(u_texture, v_texCoord).a // A from texture & uniform \n\
14 | ); \n\
15 | } \n\
16 | ";
17 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/extensions/CCBReader/CCBSequence.cpp:
--------------------------------------------------------------------------------
1 | #include "CCBSequence.h"
2 |
3 | using namespace cocos2d;
4 | using namespace std;
5 |
6 |
7 | NS_CC_EXT_BEGIN
8 |
9 | CCBSequence::CCBSequence()
10 | : mDuration(0.0f)
11 | , mName("")
12 | , mSequenceId(0)
13 | , mChainedSequenceId(0)
14 | {}
15 |
16 | float CCBSequence::getDuration()
17 | {
18 | return mDuration;
19 | }
20 |
21 | void CCBSequence::setDuration(float fDuration)
22 | {
23 | mDuration = fDuration;
24 | }
25 |
26 | const char* CCBSequence::getName()
27 | {
28 | return mName.c_str();
29 | }
30 |
31 | void CCBSequence::setName(const char *pName)
32 | {
33 | mName = pName;
34 | }
35 |
36 | int CCBSequence::getSequenceId()
37 | {
38 | return mSequenceId;
39 | }
40 |
41 | void CCBSequence::setSequenceId(int nSequenceId)
42 | {
43 | mSequenceId = nSequenceId;
44 | }
45 |
46 | int CCBSequence::getChainedSequenceId()
47 | {
48 | return mChainedSequenceId;
49 | }
50 |
51 | void CCBSequence::setChainedSequenceId(int nChainedSequenceId)
52 | {
53 | mChainedSequenceId = nChainedSequenceId;
54 | }
55 |
56 | NS_CC_EXT_END
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/extensions/CCBReader/CCBKeyframe.cpp:
--------------------------------------------------------------------------------
1 | #include "CCBKeyframe.h"
2 |
3 | using namespace cocos2d;
4 |
5 | NS_CC_EXT_BEGIN
6 |
7 | CCBKeyframe::CCBKeyframe()
8 | : mValue(NULL)
9 | , mTime(0.0f)
10 | , mEasingType(0)
11 | , mEasingOpt(0.0f)
12 | {}
13 |
14 | CCBKeyframe::~CCBKeyframe()
15 | {
16 | CC_SAFE_RELEASE_NULL(mValue);
17 | }
18 |
19 | CCObject* CCBKeyframe::getValue()
20 | {
21 | return mValue;
22 | }
23 |
24 | void CCBKeyframe::setValue(CCObject *pValue)
25 | {
26 | CC_SAFE_RELEASE(mValue);
27 | mValue = pValue;
28 | CC_SAFE_RETAIN(mValue);
29 | }
30 |
31 | float CCBKeyframe::getTime()
32 | {
33 | return mTime;
34 | }
35 |
36 | void CCBKeyframe::setTime(float fTime)
37 | {
38 | mTime = fTime;
39 | }
40 |
41 | int CCBKeyframe::getEasingType()
42 | {
43 | return mEasingType;
44 | }
45 |
46 | void CCBKeyframe::setEasingType(int nEasingType)
47 | {
48 | mEasingType = nEasingType;
49 | }
50 |
51 | float CCBKeyframe::getEasingOpt()
52 | {
53 | return mEasingOpt;
54 | }
55 |
56 | void CCBKeyframe::setEasingOpt(float fEasingOpt)
57 | {
58 | mEasingOpt = fEasingOpt;
59 | }
60 |
61 | NS_CC_EXT_END
62 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/cocos2dx/shaders/ccShader_Position_uColor_vert.h:
--------------------------------------------------------------------------------
1 | " \n\
2 | attribute vec4 a_position; \n\
3 | uniform mat4 u_MVPMatrix; \n\
4 | uniform vec4 u_color; \n\
5 | uniform float u_pointSize; \n\
6 | \n\
7 | #ifdef GL_ES \n\
8 | varying lowp vec4 v_fragmentColor; \n\
9 | #else \n\
10 | varying vec4 v_fragmentColor; \n\
11 | #endif \n\
12 | \n\
13 | void main() \n\
14 | { \n\
15 | gl_Position = u_MVPMatrix * a_position; \n\
16 | gl_PointSize = u_pointSize; \n\
17 | v_fragmentColor = u_color; \n\
18 | } \n\
19 | ";
20 |
--------------------------------------------------------------------------------
/MyMoonWarrior/Classes/layer/HeroBulletManager.h:
--------------------------------------------------------------------------------
1 | //
2 | // HeroBulletManager.h
3 | // MyMoonWarrior
4 | //
5 | // Created by cesc on 13-3-14.
6 | //
7 | //
8 |
9 | #ifndef __MyMoonWarrior__HeroBulletManager__
10 | #define __MyMoonWarrior__HeroBulletManager__
11 |
12 | #include
13 |
14 | #include "BasicLayer.h"
15 |
16 | #include "Effects.h"
17 | class HeroBulletMananger: public BasicLayer {
18 |
19 |
20 | public:
21 |
22 |
23 |
24 | HeroBulletMananger();
25 | ~HeroBulletMananger();
26 |
27 | virtual bool init();
28 |
29 | void setupViews();
30 |
31 | CREATE_FUNC( HeroBulletMananger );
32 |
33 | void addNewBullet( const CCPoint point,const CCRect planeBox );
34 |
35 | void moveAllBullets( float t );
36 |
37 | // 利用系统自带的宏 创建一个protected的变量bulletsArray 和 一个返回bulletsArray的const 函数
38 | CC_SYNTHESIZE_READONLY(CCArray*, bulletsArray, BulletsArray );
39 |
40 | private:
41 | CCSpriteBatchNode* mBulletsBatchNode;
42 |
43 |
44 |
45 |
46 |
47 | private:
48 | CCSprite* m_warrior;
49 |
50 |
51 | };
52 | #endif /* defined(__MyMoonWarrior__HeroBulletManager__) */
53 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/extensions/CCBReader/CCMenuItemLoader.cpp:
--------------------------------------------------------------------------------
1 | #include "CCMenuItemLoader.h"
2 |
3 |
4 |
5 | #define PROPERTY_BLOCK "block"
6 | #define PROPERTY_ISENABLED "isEnabled"
7 |
8 | NS_CC_EXT_BEGIN
9 |
10 | void CCMenuItemLoader::onHandlePropTypeBlock(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, BlockData * pBlockData, CCBReader * pCCBReader) {
11 | if(pPropertyName->compare(PROPERTY_BLOCK) == 0) {
12 | if (NULL != pBlockData) // Add this condition to allow CCMenuItemImage without target/selector predefined
13 | {
14 | ((CCMenuItem *)pNode)->setTarget(pBlockData->mTarget, pBlockData->mSELMenuHandler);
15 | }
16 | } else {
17 | CCNodeLoader::onHandlePropTypeBlock(pNode, pParent, pPropertyName, pBlockData, pCCBReader);
18 | }
19 | }
20 |
21 | void CCMenuItemLoader::onHandlePropTypeCheck(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, bool pCheck, CCBReader * pCCBReader) {
22 | if(pPropertyName->compare(PROPERTY_ISENABLED) == 0) {
23 | ((CCMenuItem *)pNode)->setEnabled(pCheck);
24 | } else {
25 | CCNodeLoader::onHandlePropTypeCheck(pNode, pParent, pPropertyName, pCheck, pCCBReader);
26 | }
27 | }
28 |
29 | NS_CC_EXT_END
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/extensions/CCBReader/CCLayerGradientLoader.h:
--------------------------------------------------------------------------------
1 | #ifndef _CCB_CCLAYERGRADIENTLOADER_H_
2 | #define _CCB_CCLAYERGRADIENTLOADER_H_
3 |
4 | #include "CCLayerLoader.h"
5 |
6 | NS_CC_EXT_BEGIN
7 |
8 | /* Forward declaration. */
9 | class CCBReader;
10 |
11 | class CCLayerGradientLoader : public CCLayerLoader {
12 | public:
13 | virtual ~CCLayerGradientLoader() {};
14 | CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(CCLayerGradientLoader, loader);
15 |
16 | protected:
17 | CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(CCLayerGradient);
18 |
19 | virtual void onHandlePropTypeColor3(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, ccColor3B pCCColor3B, CCBReader * pCCBReader);
20 | virtual void onHandlePropTypeByte(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, unsigned char pByte, CCBReader * pCCBReader);
21 | virtual void onHandlePropTypePoint(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, CCPoint pPoint, CCBReader * pCCBReader);
22 | virtual void onHandlePropTypeBlendFunc(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, ccBlendFunc pCCBlendFunc, CCBReader * pCCBReader);
23 | };
24 |
25 | NS_CC_EXT_END
26 |
27 | #endif
28 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/cocos2dx/shaders/ccShaderEx_SwitchMask_frag.h:
--------------------------------------------------------------------------------
1 | " \n\
2 | #ifdef GL_ES \n\
3 | precision lowp float; \n\
4 | #endif \n\
5 | \n\
6 | varying vec4 v_fragmentColor; \n\
7 | varying vec2 v_texCoord; \n\
8 | uniform sampler2D u_texture; \n\
9 | uniform sampler2D u_mask; \n\
10 | \n\
11 | void main() \n\
12 | { \n\
13 | vec4 texColor = texture2D(u_texture, v_texCoord); \n\
14 | vec4 maskColor = texture2D(u_mask, v_texCoord); \n\
15 | vec4 finalColor = vec4(texColor.r, texColor.g, texColor.b, maskColor.a * texColor.a); \n\
16 | gl_FragColor = v_fragmentColor * finalColor; \n\
17 | } \n\
18 | ";
19 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/extensions/CCBReader/CCBSelectorResolver.h:
--------------------------------------------------------------------------------
1 | #ifndef _CCB_CCBSELECTORRESOLVER_H_
2 | #define _CCB_CCBSELECTORRESOLVER_H_
3 |
4 | #include "cocos2d.h"
5 | #include "ExtensionMacros.h"
6 | #include "../GUI/CCControlExtension/CCInvocation.h"
7 |
8 |
9 | NS_CC_EXT_BEGIN
10 |
11 | #define CCB_SELECTORRESOLVER_CCMENUITEM_GLUE(TARGET, SELECTORNAME, METHOD) if(pTarget == TARGET && pSelectorName->compare(SELECTORNAME) == 0) { \
12 | return menu_selector(METHOD); \
13 | }
14 |
15 | #define CCB_SELECTORRESOLVER_CCCONTROL_GLUE(TARGET, SELECTORNAME, METHOD) if(pTarget == TARGET && pSelectorName->compare(SELECTORNAME) == 0) { \
16 | return cccontrol_selector(METHOD); \
17 | }
18 |
19 | class CCBSelectorResolver {
20 | public:
21 | virtual ~CCBSelectorResolver() {};
22 | virtual SEL_MenuHandler onResolveCCBCCMenuItemSelector(CCObject * pTarget, CCString * pSelectorName) = 0;
23 |
24 | virtual extension::SEL_CCControlHandler onResolveCCBCCControlSelector(CCObject * pTarget, CCString * pSelectorName) = 0;
25 | };
26 |
27 |
28 | class CCBScriptOwnerProtocol {
29 | public:
30 | virtual ~CCBScriptOwnerProtocol() {};
31 | virtual CCBSelectorResolver * createNew() = 0;
32 | };
33 |
34 | NS_CC_EXT_END
35 |
36 | #endif
37 |
--------------------------------------------------------------------------------
/MyMoonWarrior/Classes/CescMenu.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // CescMenu.cpp
3 | // MyMoonWarrior
4 | //
5 | // Created by cesc on 13-7-14.
6 | //
7 | //
8 |
9 | #include "CescMenu.h"
10 |
11 |
12 | void CescMenu::registerWithTouchDispatcher()
13 | {
14 | CCDirector* pDirector = CCDirector::sharedDirector();
15 | pDirector->getTouchDispatcher()->addTargetedDelegate(this, -129, true);
16 |
17 | }
18 |
19 |
20 | CescMenu* CescMenu::create(CCMenuItem* item, ...){
21 |
22 | va_list args;
23 | va_start(args,item);
24 | CescMenu *pRet = new CescMenu();
25 | if (pRet && pRet->initWithItems(item, args))
26 | {
27 | pRet->autorelease();
28 | va_end(args);
29 | return pRet;
30 | }
31 | va_end(args);
32 | CC_SAFE_DELETE(pRet);
33 | return NULL;
34 |
35 | }
36 |
37 | bool CescMenu::initWithItems(CCMenuItem* item, va_list args){
38 |
39 | CCArray* pArray = NULL;
40 | if( item )
41 | {
42 | pArray = CCArray::create(item, NULL);
43 | CCMenuItem *i = va_arg(args, CCMenuItem*);
44 | while(i)
45 | {
46 | pArray->addObject(i);
47 | i = va_arg(args, CCMenuItem*);
48 | }
49 | }
50 |
51 | return initWithArray(pArray);
52 |
53 |
54 | }
55 |
--------------------------------------------------------------------------------
/MyMoonWarrior/Classes/layer/GamingLayer.h:
--------------------------------------------------------------------------------
1 | //
2 | // GamingLayer.h
3 | // MyMoonWarrior
4 | //
5 | // Created by cesc on 13-3-10.
6 | //
7 | //
8 |
9 | #ifndef __MyMoonWarrior__GamingLayer__
10 | #define __MyMoonWarrior__GamingLayer__
11 |
12 | #include
13 | #include "BasicLayer.h"
14 | #include "WarriorLayer.h"
15 | #include "HeroBulletManager.h"
16 | #include "EnemyManager.h"
17 | #include "EnemyModel.h"
18 | #include "Effects.h"
19 | #include "PauseLayer.h"
20 | class GamingLayer: public BasicLayer {
21 |
22 |
23 | public:
24 | GamingLayer();
25 | ~GamingLayer();
26 |
27 | virtual bool init();
28 |
29 |
30 | static CCScene* scene();
31 |
32 | CREATE_FUNC( GamingLayer );
33 |
34 | void setupViews();
35 |
36 | void background_scroll_logic( float t );
37 |
38 | void pause_logic( CCObject* pSender );
39 |
40 | void warrior_add_new_bullet( float t );
41 |
42 |
43 | void to_cover_logic(); // 返回主菜单的逻辑
44 |
45 | WarriorLayer* mWarrior;
46 |
47 | EnemyManager* mEnemyManager;
48 |
49 |
50 | HeroBulletMananger* mHeroBulletManager;
51 |
52 | private:
53 | PauseLayer* m_pauseLayer;
54 | };
55 |
56 | #endif /* defined(__MyMoonWarrior__GamingLayer__) */
57 |
--------------------------------------------------------------------------------
/MyMoonWarrior/Classes/enemy/EnemyModel.h:
--------------------------------------------------------------------------------
1 | //
2 | // EnemyModel.h
3 | // MyMoonWarrior
4 | //
5 | // Created by cesc on 13-3-27.
6 | //
7 | //
8 |
9 | #ifndef __MyMoonWarrior__EnemyModel__
10 | #define __MyMoonWarrior__EnemyModel__
11 |
12 | #include
13 | #include "cocos2d.h"
14 | #include "EnumAndStruct.h"
15 | USING_NS_CC;
16 |
17 | class EnemyModel : public CCNode {
18 |
19 |
20 | public:
21 |
22 | // 构造函数
23 | EnemyModel( Monster mMonster,CCPoint targetPoint );
24 | ~EnemyModel();
25 |
26 | bool init();
27 |
28 |
29 | // 静态的获取敌机指针的函数
30 | static EnemyModel* getEnemey( Monster mMonster,CCPoint targetPoint );
31 |
32 |
33 | // 添加子弹的函数
34 | void addNewBullet( float t );
35 |
36 | // 移动子弹的函数
37 | void moveBullet( float t );
38 |
39 | CC_SYNTHESIZE_READONLY(CCSprite*, m_sprite, PlaneSprite );
40 |
41 |
42 |
43 | public:
44 |
45 | CCSpriteBatchNode* enemyBulletBatchNode; // 敌机子弹的batchNode
46 |
47 | CCArray* bulletArray; // 敌机子弹的数组
48 |
49 | private:
50 |
51 | CCAction* m_action;
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 | };
62 |
63 | #endif /* defined(__MyMoonWarrior__EnemyModel__) */
64 |
--------------------------------------------------------------------------------
/MyMoonWarrior/Classes/enemy/EnemyManager.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // EnemyManager.cpp
3 | // MyMoonWarrior
4 | //
5 | // Created by cesc on 13-3-27.
6 | //
7 | //
8 |
9 | #include "EnemyManager.h"
10 | #include "EnemyModel.h"
11 |
12 | EnemyManager::EnemyManager(){
13 |
14 | enemyArray = CCArray::create();
15 | enemyArray->retain();
16 |
17 | }
18 | EnemyManager::~EnemyManager(){
19 |
20 | CC_SAFE_DELETE( enemyArray );
21 |
22 |
23 |
24 | }
25 |
26 | bool EnemyManager::init(){
27 |
28 | if( !BasicLayer::init() ){
29 |
30 | return false;
31 | }
32 |
33 | setupViews();
34 |
35 | return true;
36 |
37 | }
38 |
39 | void EnemyManager::setupViews(){
40 |
41 | // 初始化一个敌机
42 | Monster monster = { monster1 };
43 |
44 | EnemyModel* enemyModel = EnemyModel::getEnemey( monster, ccp( getWinSize().width /2 , getWinSize().height * .75) );
45 |
46 | enemyArray->addObject( enemyModel );
47 |
48 | this->addChild(enemyModel,1);
49 | enemyModel->setPosition( ccp( getWinSize().width /2 , getWinSize().height * .75) );
50 |
51 | }
52 |
53 |
54 |
55 | void EnemyManager::addEnemy( float t ){}
56 |
57 |
58 |
59 | CCArray* EnemyManager::getEnemyArray(){
60 |
61 |
62 | return enemyArray;
63 | }
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/cocos2dx/shaders/ccShader_PositionTextureA8Color_vert.h:
--------------------------------------------------------------------------------
1 | " \n\
2 | attribute vec4 a_position; \n\
3 | attribute vec2 a_texCoord; \n\
4 | attribute vec4 a_color; \n\
5 | uniform mat4 u_MVPMatrix; \n\
6 | \n\
7 | #ifdef GL_ES \n\
8 | varying lowp vec4 v_fragmentColor; \n\
9 | varying mediump vec2 v_texCoord; \n\
10 | #else \n\
11 | varying vec4 v_fragmentColor; \n\
12 | varying vec2 v_texCoord; \n\
13 | #endif \n\
14 | \n\
15 | void main() \n\
16 | { \n\
17 | gl_Position = u_MVPMatrix * a_position; \n\
18 | v_fragmentColor = a_color; \n\
19 | v_texCoord = a_texCoord; \n\
20 | } \n\
21 | ";
22 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/extensions/CCBReader/CCMenuItemImageLoader.cpp:
--------------------------------------------------------------------------------
1 | #include "CCMenuItemImageLoader.h"
2 |
3 |
4 |
5 | #define PROPERTY_NORMALDISPLAYFRAME "normalSpriteFrame"
6 | #define PROPERTY_SELECTEDDISPLAYFRAME "selectedSpriteFrame"
7 | #define PROPERTY_DISABLEDDISPLAYFRAME "disabledSpriteFrame"
8 |
9 | NS_CC_EXT_BEGIN
10 |
11 | void CCMenuItemImageLoader::onHandlePropTypeSpriteFrame(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, CCSpriteFrame * pCCSpriteFrame, CCBReader * pCCBReader) {
12 | if(pPropertyName->compare(PROPERTY_NORMALDISPLAYFRAME) == 0) {
13 | if(pCCSpriteFrame != NULL) {
14 | ((CCMenuItemImage *)pNode)->setNormalSpriteFrame(pCCSpriteFrame);
15 | }
16 | } else if(pPropertyName->compare(PROPERTY_SELECTEDDISPLAYFRAME) == 0) {
17 | if(pCCSpriteFrame != NULL) {
18 | ((CCMenuItemImage *)pNode)->setSelectedSpriteFrame(pCCSpriteFrame);
19 | }
20 | } else if(pPropertyName->compare(PROPERTY_DISABLEDDISPLAYFRAME) == 0) {
21 | if(pCCSpriteFrame != NULL) {
22 | ((CCMenuItemImage *)pNode)->setDisabledSpriteFrame(pCCSpriteFrame);
23 | }
24 | } else {
25 | CCMenuItemLoader::onHandlePropTypeSpriteFrame(pNode, pParent, pPropertyName, pCCSpriteFrame, pCCBReader);
26 | }
27 | }
28 |
29 | NS_CC_EXT_END
30 |
--------------------------------------------------------------------------------
/MyMoonWarrior/Classes/NewBullet.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // NewBullet.cpp
3 | // MyMoonWarrior
4 | //
5 | // Created by cesc on 13-7-14.
6 | //
7 | //
8 |
9 | #include "NewBullet.h"
10 |
11 |
12 | NewBullet* NewBullet::createWithSpriteFrameName(const char *pszSpriteFrameName)
13 | {
14 | CCSpriteFrame *pFrame = CCSpriteFrameCache::sharedSpriteFrameCache()->spriteFrameByName(pszSpriteFrameName);
15 |
16 | #if COCOS2D_DEBUG > 0
17 | char msg[256] = {0};
18 | sprintf(msg, "Invalid spriteFrameName: %s", pszSpriteFrameName);
19 | CCAssert(pFrame != NULL, msg);
20 | #endif
21 |
22 | return createWithSpriteFrame(pFrame);
23 | }
24 |
25 |
26 | NewBullet* NewBullet::createWithSpriteFrame(CCSpriteFrame *pSpriteFrame)
27 | {
28 | NewBullet *pobSprite = new NewBullet();
29 | if (pSpriteFrame && pobSprite && pobSprite->initWithSpriteFrame(pSpriteFrame))
30 | {
31 | pobSprite->autorelease();
32 | return pobSprite;
33 | }
34 | CC_SAFE_DELETE(pobSprite);
35 | return NULL;
36 | }
37 |
38 |
39 |
40 | bool NewBullet::initWithSpriteFrame(CCSpriteFrame *pSpriteFrame)
41 | {
42 | CCAssert(pSpriteFrame != NULL, "");
43 |
44 | bool bRet = initWithTexture(pSpriteFrame->getTexture(), pSpriteFrame->getRect());
45 | setDisplayFrame(pSpriteFrame);
46 |
47 | return bRet;
48 | }
49 |
50 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/cocos2dx/shaders/ccShader_PositionTextureColor_vert.h:
--------------------------------------------------------------------------------
1 | " \n\
2 | attribute vec4 a_position; \n\
3 | attribute vec2 a_texCoord; \n\
4 | attribute vec4 a_color; \n\
5 | \n\
6 | uniform mat4 u_MVPMatrix; \n\
7 | \n\
8 | #ifdef GL_ES \n\
9 | varying lowp vec4 v_fragmentColor; \n\
10 | varying mediump vec2 v_texCoord; \n\
11 | #else \n\
12 | varying vec4 v_fragmentColor; \n\
13 | varying vec2 v_texCoord; \n\
14 | #endif \n\
15 | \n\
16 | void main() \n\
17 | { \n\
18 | gl_Position = u_MVPMatrix * a_position; \n\
19 | v_fragmentColor = a_color; \n\
20 | v_texCoord = a_texCoord; \n\
21 | } \n\
22 | ";
23 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/extensions/CCBReader/CCSpriteLoader.h:
--------------------------------------------------------------------------------
1 | #ifndef _CCB_CCSPRITELOADER_H_
2 | #define _CCB_CCSPRITELOADER_H_
3 |
4 | #include "CCNodeLoader.h"
5 |
6 | NS_CC_EXT_BEGIN
7 |
8 | /* Forward declaration. */
9 | class CCBReader;
10 |
11 | class CCSpriteLoader : public CCNodeLoader {
12 | public:
13 | virtual ~CCSpriteLoader() {};
14 | CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(CCSpriteLoader, loader);
15 |
16 | protected:
17 | CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(CCSprite);
18 |
19 | virtual void onHandlePropTypeColor3(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, ccColor3B pCCColor3B, CCBReader * pCCBReader);
20 | virtual void onHandlePropTypeByte(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, unsigned char pByte, CCBReader * pCCBReader);
21 | virtual void onHandlePropTypeBlendFunc(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, ccBlendFunc pCCBBlendFunc, CCBReader * pCCBReader);
22 | virtual void onHandlePropTypeSpriteFrame(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, CCSpriteFrame * pCCSpriteFrame, CCBReader * pCCBReader);
23 | virtual void onHandlePropTypeFlip(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, bool * pFlip, CCBReader * pCCBReader);
24 | };
25 |
26 | NS_CC_EXT_END
27 |
28 | #endif
29 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/extensions/CCBReader/CCControlLoader.cpp:
--------------------------------------------------------------------------------
1 | #include "CCControlLoader.h"
2 |
3 |
4 | NS_CC_EXT_BEGIN
5 |
6 | #define PROPERTY_ENABLED "enabled"
7 | #define PROPERTY_SELECTED "selected"
8 | #define PROPERTY_CCCONTROL "ccControl"
9 |
10 | void CCControlLoader::onHandlePropTypeCheck(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, bool pCheck, CCBReader * pCCBReader) {
11 | if(pPropertyName->compare(PROPERTY_ENABLED) == 0) {
12 | ((CCControl *)pNode)->setEnabled(pCheck);
13 | } else if(pPropertyName->compare(PROPERTY_SELECTED) == 0) {
14 | ((CCControl *)pNode)->setSelected(pCheck);
15 | } else {
16 | CCNodeLoader::onHandlePropTypeCheck(pNode, pParent, pPropertyName, pCheck, pCCBReader);
17 | }
18 | }
19 |
20 | void CCControlLoader::onHandlePropTypeBlockCCControl(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, BlockCCControlData * pBlockCCControlData, CCBReader * pCCBReader) {
21 | if(pPropertyName->compare(PROPERTY_CCCONTROL) == 0) {
22 | ((CCControl *)pNode)->addTargetWithActionForControlEvents(pBlockCCControlData->mTarget, pBlockCCControlData->mSELCCControlHandler, pBlockCCControlData->mControlEvents);
23 | } else {
24 | CCNodeLoader::onHandlePropTypeBlockCCControl(pNode, pParent, pPropertyName, pBlockCCControlData, pCCBReader);
25 | }
26 | }
27 |
28 | NS_CC_EXT_END
--------------------------------------------------------------------------------
/MyMoonWarrior/Classes/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // MyMoonWarriorAppDelegate.h
3 | // MyMoonWarrior
4 | //
5 | // Created by cesc on 13-3-2.
6 | // Copyright __MyCompanyName__ 2013年. All rights reserved.
7 | //
8 |
9 | #ifndef _APP_DELEGATE_H_
10 | #define _APP_DELEGATE_H_
11 |
12 | #include "CCApplication.h"
13 |
14 | /**
15 | @brief The cocos2d Application.
16 |
17 | The reason to implement with private inheritance is to hide some interface details of CCDirector.
18 | */
19 | class AppDelegate : private cocos2d::CCApplication
20 | {
21 | public:
22 | AppDelegate();
23 | virtual ~AppDelegate();
24 |
25 | /**
26 | @brief Implement CCDirector and CCScene init code here.
27 | @return true Initialize success, app continue.
28 | @return false Initialize failed, app terminate.
29 | */
30 | virtual bool applicationDidFinishLaunching();
31 |
32 | /**
33 | @brief The function is called when the application enters the background
34 | @param the pointer of the application instance
35 | */
36 | virtual void applicationDidEnterBackground();
37 |
38 | /**
39 | @brief The function is called when the application enters the foreground
40 | @param the pointer of the application instance
41 | */
42 | virtual void applicationWillEnterForeground();
43 | };
44 |
45 | #endif // _APP_DELEGATE_H_
46 |
47 |
--------------------------------------------------------------------------------
/MyMoonWarrior/Classes/layer/TimerLayer.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // TimerLayer.cpp
3 | // MyMoonWarrior
4 | //
5 | // Created by cesc on 13-3-10.
6 | //
7 | //
8 |
9 | #include "TimerLayer.h"
10 |
11 |
12 |
13 | TimerLayer::TimerLayer(){
14 |
15 | counter = 0;
16 |
17 | }
18 | TimerLayer::~TimerLayer(){}
19 |
20 | bool TimerLayer::init(){
21 |
22 | if( !BasicLayer::init() ){
23 | return false;
24 | }
25 |
26 | setupViews();
27 |
28 | return true;
29 | }
30 |
31 | void TimerLayer::setupViews(){
32 |
33 | do {
34 |
35 | CCLabelBMFont* timer_font = CCLabelBMFont::create("Time:0", "arial-14.fnt");
36 |
37 | timer_font->setAnchorPoint( CCPointZero );
38 | timer_font->setPosition( CCPointZero );
39 | timer_font->setScale( 1.5f);
40 | this->addChild( timer_font,0,15);
41 |
42 |
43 |
44 | // 加入计时的定时任务
45 | this->schedule( schedule_selector(TimerLayer::time_counting_down),1.0f );
46 |
47 |
48 | } while (0);
49 | }
50 |
51 |
52 | // 计时的逻辑
53 | void TimerLayer::time_counting_down( float t ){
54 |
55 | CCLabelBMFont* timer_font = ( CCLabelBMFont*)getChildByTag( 15 );
56 |
57 | char str[20] = {0};
58 | ++counter;
59 | sprintf(str, "Time:%d",counter );
60 | timer_font->setString( str );
61 |
62 | }
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/extensions/CCBReader/CCLabelBMFontLoader.h:
--------------------------------------------------------------------------------
1 | #ifndef _CCB_CCLABELBMFONTLOADER_H_
2 | #define _CCB_CCLABELBMFONTLOADER_H_
3 |
4 | #include "CCNodeLoader.h"
5 |
6 | NS_CC_EXT_BEGIN
7 |
8 | /* Forward declaration. */
9 | class CCBReader;
10 |
11 | class CCLabelBMFontLoader : public CCNodeLoader {
12 | public:
13 | virtual ~CCLabelBMFontLoader() {};
14 | CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(CCLabelBMFontLoader, loader);
15 |
16 | protected:
17 | CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(CCLabelBMFont);
18 |
19 | virtual void onHandlePropTypeColor3(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, ccColor3B pCCColor3B, CCBReader * pCCBReader);
20 | virtual void onHandlePropTypeByte(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, unsigned char pByte, CCBReader * pCCBReader);
21 | virtual void onHandlePropTypeBlendFunc(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, ccBlendFunc pCCBlendFunc, CCBReader * pCCBReader);
22 | virtual void onHandlePropTypeFntFile(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, CCString * pFntFile, CCBReader * pCCBReader);
23 | virtual void onHandlePropTypeText(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, CCString * pText, CCBReader * pCCBReader);
24 | };
25 |
26 | NS_CC_EXT_END
27 |
28 | #endif
29 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/extensions/CCBReader/CCLayerLoader.cpp:
--------------------------------------------------------------------------------
1 | #include "CCLayerLoader.h"
2 |
3 |
4 |
5 |
6 | #define PROPERTY_TOUCH_ENABLED "isTouchEnabled"
7 | #define PROPERTY_ACCELEROMETER_ENABLED "isAccelerometerEnabled"
8 | #define PROPERTY_MOUSE_ENABLED "isMouseEnabled"
9 | #define PROPERTY_KEYBOARD_ENABLED "isKeyboardEnabled"
10 |
11 | NS_CC_EXT_BEGIN
12 |
13 | void CCLayerLoader::onHandlePropTypeCheck(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, bool pCheck, CCBReader * pCCBReader) {
14 | if(pPropertyName->compare(PROPERTY_TOUCH_ENABLED) == 0) {
15 | ((CCLayer *)pNode)->setTouchEnabled(pCheck);
16 | } else if(pPropertyName->compare(PROPERTY_ACCELEROMETER_ENABLED) == 0) {
17 | ((CCLayer *)pNode)->setAccelerometerEnabled(pCheck);
18 | } else if(pPropertyName->compare(PROPERTY_MOUSE_ENABLED) == 0) {
19 | // TODO XXX
20 | CCLOG("The property '%s' is not supported!", PROPERTY_MOUSE_ENABLED);
21 | } else if(pPropertyName->compare(PROPERTY_KEYBOARD_ENABLED) == 0) {
22 | // TODO XXX
23 | CCLOG("The property '%s' is not supported!", PROPERTY_KEYBOARD_ENABLED);
24 | // This comes closest: ((CCLayer *)pNode)->setKeypadEnabled(pCheck);
25 | } else {
26 | CCNodeLoader::onHandlePropTypeCheck(pNode, pParent, pPropertyName, pCheck, pCCBReader);
27 | }
28 | }
29 |
30 | NS_CC_EXT_END
31 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/extensions/CCBReader/CCBValue.h:
--------------------------------------------------------------------------------
1 | #ifndef __CCB_VALUE_H__
2 | #define __CCB_VALUE_H__
3 |
4 | #include "cocos2d.h"
5 | #include "ExtensionMacros.h"
6 |
7 | /*
8 | These classes are wrapper of basic types, such as ccColor3B
9 | */
10 |
11 | NS_CC_EXT_BEGIN
12 |
13 | class ccColor3BWapper : public CCObject
14 | {
15 | private:
16 | ccColor3B color;
17 |
18 | public:
19 | static ccColor3BWapper* create(const ccColor3B& color);
20 |
21 | const ccColor3B& getColor();
22 | };
23 |
24 | enum
25 | {
26 | kIntValue,
27 | kFloatValue,
28 | kPointerValue,
29 | kBoolValue,
30 | kUnsignedCharValue,
31 | };
32 |
33 | class CCBValue : public CCObject
34 | {
35 | private:
36 | union
37 | {
38 | int nValue;
39 | float fValue;
40 | const void *pointer;
41 | } mValue;
42 |
43 | int mType;
44 |
45 | public:
46 | static CCBValue* create(int nValue);
47 | static CCBValue* create(bool bValue);
48 | static CCBValue* create(float fValue);
49 | static CCBValue* create(unsigned char byte);
50 | static CCBValue* create(const void *pPointer);
51 |
52 | int getIntValue();
53 | float getFloatValue();
54 | bool getBoolValue();
55 | unsigned char getByteValue();
56 | const void* getPointer();
57 | };
58 |
59 | NS_CC_EXT_END
60 |
61 | #endif // __CCB_VALUE_H__
62 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/extensions/CCBReader/CCScrollViewLoader.h:
--------------------------------------------------------------------------------
1 | #ifndef _CCB_CCSCROLLVIEWLOADER_H_
2 | #define _CCB_CCSCROLLVIEWLOADER_H_
3 |
4 | #include "CCNodeLoader.h"
5 | #include "../GUI/CCScrollView/CCScrollView.h"
6 |
7 | NS_CC_EXT_BEGIN
8 |
9 | /* Forward declaration. */
10 | class CCBReader;
11 |
12 | class CCScrollViewLoader : public CCNodeLoader {
13 | public:
14 | virtual ~CCScrollViewLoader() {};
15 | CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(CCScrollViewLoader, loader);
16 |
17 | protected:
18 | CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(CCScrollView);
19 | virtual void onHandlePropTypeSize(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, CCSize pSize, CCBReader * pCCBReader);
20 | virtual void onHandlePropTypeCCBFile(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, CCNode * pCCBFileNode, CCBReader * pCCBReader);
21 | virtual void onHandlePropTypeCheck(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, bool pCheck, CCBReader * pCCBReader);
22 | virtual void onHandlePropTypeFloat(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, float pFloat, CCBReader * pCCBReader);
23 | virtual void onHandlePropTypeIntegerLabeled(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, int pIntegerLabeled, CCBReader * pCCBReader);
24 | };
25 |
26 | NS_CC_EXT_END
27 |
28 | #endif
29 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/cocos2dx/platform/third_party/ios/curl/stdcheaders.h:
--------------------------------------------------------------------------------
1 | #ifndef __STDC_HEADERS_H
2 | #define __STDC_HEADERS_H
3 | /***************************************************************************
4 | * _ _ ____ _
5 | * Project ___| | | | _ \| |
6 | * / __| | | | |_) | |
7 | * | (__| |_| | _ <| |___
8 | * \___|\___/|_| \_\_____|
9 | *
10 | * Copyright (C) 1998 - 2010, Daniel Stenberg, , et al.
11 | *
12 | * This software is licensed as described in the file COPYING, which
13 | * you should have received as part of this distribution. The terms
14 | * are also available at http://curl.haxx.se/docs/copyright.html.
15 | *
16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell
17 | * copies of the Software, and permit persons to whom the Software is
18 | * furnished to do so, under the terms of the COPYING file.
19 | *
20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21 | * KIND, either express or implied.
22 | *
23 | ***************************************************************************/
24 |
25 | #include
26 |
27 | size_t fread (void *, size_t, size_t, FILE *);
28 | size_t fwrite (const void *, size_t, size_t, FILE *);
29 |
30 | int strcasecmp(const char *, const char *);
31 | int strncasecmp(const char *, const char *, size_t);
32 |
33 | #endif /* __STDC_HEADERS_H */
34 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/extensions/CCBReader/CCNodeLoaderLibrary.h:
--------------------------------------------------------------------------------
1 | #ifndef _CCB_CCNODELOADERLIBRARY_H_
2 | #define _CCB_CCNODELOADERLIBRARY_H_
3 |
4 | #include "cocos2d.h"
5 | #include "CCBReader.h"
6 |
7 | NS_CC_EXT_BEGIN
8 |
9 | class CCNodeLoader;
10 |
11 | typedef std::map CCNodeLoaderMap;
12 | typedef std::pair CCNodeLoaderMapEntry;
13 |
14 | class CCNodeLoaderLibrary : public CCObject {
15 | private:
16 | CCNodeLoaderMap mCCNodeLoaders;
17 |
18 | public:
19 | CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(CCNodeLoaderLibrary, library);
20 |
21 | CCNodeLoaderLibrary();
22 | virtual ~CCNodeLoaderLibrary();
23 |
24 | void registerDefaultCCNodeLoaders();
25 | void registerCCNodeLoader(const char * pClassName, CCNodeLoader * pCCNodeLoader);
26 | void registerCCNodeLoader(CCString * pClassName, CCNodeLoader * pCCNodeLoader);
27 | void unregisterCCNodeLoader(const char * pClassName);
28 | void unregisterCCNodeLoader(CCString * pClassName);
29 | CCNodeLoader * getCCNodeLoader(const char * pClassName);
30 | CCNodeLoader * getCCNodeLoader(CCString * pClassName);
31 | void purge(bool pDelete);
32 |
33 | public:
34 | static CCNodeLoaderLibrary * sharedCCNodeLoaderLibrary();
35 | static void purgeSharedCCNodeLoaderLibrary();
36 |
37 | static CCNodeLoaderLibrary * newDefaultCCNodeLoaderLibrary();
38 | };
39 |
40 | NS_CC_EXT_END
41 |
42 | #endif
43 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/extensions/CCBReader/CCLayerColorLoader.cpp:
--------------------------------------------------------------------------------
1 | #include "CCLayerColorLoader.h"
2 |
3 |
4 |
5 | NS_CC_EXT_BEGIN
6 |
7 | #define PROPERTY_COLOR "color"
8 | #define PROPERTY_OPACITY "opacity"
9 | #define PROPERTY_BLENDFUNC "blendFunc"
10 |
11 | void CCLayerColorLoader::onHandlePropTypeColor3(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, ccColor3B pCCColor3B, CCBReader * pCCBReader) {
12 | if(pPropertyName->compare(PROPERTY_COLOR) == 0) {
13 | ((CCLayerColor *)pNode)->setColor(pCCColor3B);
14 | } else {
15 | CCLayerLoader::onHandlePropTypeColor3(pNode, pParent, pPropertyName, pCCColor3B, pCCBReader);
16 | }
17 | }
18 |
19 | void CCLayerColorLoader::onHandlePropTypeByte(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, unsigned char pByte, CCBReader * pCCBReader) {
20 | if(pPropertyName->compare(PROPERTY_OPACITY) == 0) {
21 | ((CCLayerColor *)pNode)->setOpacity(pByte);
22 | } else {
23 | CCLayerLoader::onHandlePropTypeByte(pNode, pParent, pPropertyName, pByte, pCCBReader);
24 | }
25 | }
26 |
27 | void CCLayerColorLoader::onHandlePropTypeBlendFunc(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, ccBlendFunc pCCBlendFunc, CCBReader * pCCBReader) {
28 | if(pPropertyName->compare(PROPERTY_BLENDFUNC) == 0) {
29 | ((CCLayerColor *)pNode)->setBlendFunc(pCCBlendFunc);
30 | } else {
31 | CCLayerLoader::onHandlePropTypeBlendFunc(pNode, pParent, pPropertyName, pCCBlendFunc, pCCBReader);
32 | }
33 | }
34 |
35 | NS_CC_EXT_END
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/cocos2dx/cocoa/CCZone.cpp:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | Copyright (c) 2010 cocos2d-x.org
3 |
4 | http://www.cocos2d-x.org
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in
14 | all copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | THE SOFTWARE.
23 | ****************************************************************************/
24 | #include "CCZone.h"
25 | #include "CCObject.h"
26 |
27 | NS_CC_BEGIN
28 |
29 | CCZone::CCZone(CCObject *pObject)
30 | {
31 | m_pCopyObject = pObject;
32 | }
33 |
34 | NS_CC_END
35 |
--------------------------------------------------------------------------------
/MyMoonWarrior/Resources/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | English
7 | CFBundleDisplayName
8 | ${PRODUCT_NAME}
9 | CFBundleExecutable
10 | ${EXECUTABLE_NAME}
11 | CFBundleIconFile
12 |
13 | CFBundleIconFiles
14 |
15 | Icon.png
16 | Icon@2x.png
17 | Icon-72.png
18 | Icon-Small-50.png
19 | Icon-Small.png
20 | Icon-Small@2x.png
21 |
22 | CFBundleIdentifier
23 | com.yourcompany.${PRODUCT_NAME:rfc1034identifier}
24 | CFBundleInfoDictionaryVersion
25 | 6.0
26 | CFBundleName
27 | ${PRODUCT_NAME}
28 | CFBundlePackageType
29 | APPL
30 | CFBundleSignature
31 | ????
32 | CFBundleVersion
33 | 1.0
34 | LSRequiresIPhoneOS
35 |
36 | UIPrerenderedIcon
37 |
38 | UIRequiredDeviceCapabilities
39 |
40 | accelerometer
41 |
42 | opengles-1
43 |
44 |
45 | UIStatusBarHidden
46 |
47 | UISupportedInterfaceOrientations
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/cocos2dx/cocos2d.cpp:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | Copyright (c) 2010-2012 cocos2d-x.org
3 | Copyright (c) 2008-2010 Ricardo Quesada
4 | Copyright (c) 2011 Zynga Inc.
5 |
6 | http://www.cocos2d-x.org
7 |
8 | Permission is hereby granted, free of charge, to any person obtaining a copy
9 | of this software and associated documentation files (the "Software"), to deal
10 | in the Software without restriction, including without limitation the rights
11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 | copies of the Software, and to permit persons to whom the Software is
13 | furnished to do so, subject to the following conditions:
14 |
15 | The above copyright notice and this permission notice shall be included in
16 | all copies or substantial portions of the Software.
17 |
18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24 | THE SOFTWARE.
25 | ****************************************************************************/
26 |
27 | #include "cocos2d.h"
28 |
29 | NS_CC_BEGIN
30 |
31 | const char* cocos2dVersion()
32 | {
33 | return "cocos2d-2.0-x-2.0.4";
34 | }
35 |
36 | NS_CC_END
37 |
38 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/cocos2dx/shaders/ccShader_PositionTextureColorAlphaTest_frag.h:
--------------------------------------------------------------------------------
1 | " \n\
2 | #ifdef GL_ES \n\
3 | precision lowp float; \n\
4 | #endif \n\
5 | \n\
6 | varying vec4 v_fragmentColor; \n\
7 | varying vec2 v_texCoord; \n\
8 | uniform sampler2D u_texture; \n\
9 | uniform float u_alpha_value; \n\
10 | \n\
11 | void main() \n\
12 | { \n\
13 | vec4 texColor = texture2D(u_texture, v_texCoord); \n\
14 | \n\
15 | // mimic: glAlphaFunc(GL_GREATER) \n\
16 | // pass if ( incoming_pixel >= u_alpha_value ) => fail if incoming_pixel < u_alpha_value \n\
17 | \n\
18 | if ( texColor.a <= u_alpha_value ) \n\
19 | discard; \n\
20 | \n\
21 | gl_FragColor = texColor * v_fragmentColor; \n\
22 | } \n\
23 | ";
24 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/extensions/CCBReader/CCScale9SpriteLoader.h:
--------------------------------------------------------------------------------
1 | #ifndef _CCB_CCSCALE9SPRITELOADER_H_
2 | #define _CCB_CCSCALE9SPRITELOADER_H_
3 |
4 | #include "CCNodeLoader.h"
5 | #include "CCScale9SpriteLoader.h"
6 | #include "../GUI/CCControlExtension/CCScale9Sprite.h"
7 |
8 | NS_CC_EXT_BEGIN
9 |
10 | /* Forward declaration. */
11 | class CCBReader;
12 |
13 | class CCScale9SpriteLoader : public CCNodeLoader {
14 | public:
15 | virtual ~CCScale9SpriteLoader() {};
16 | CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(CCScale9SpriteLoader, loader);
17 |
18 | protected:
19 | CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(CCScale9Sprite);
20 |
21 | virtual void onHandlePropTypeColor3(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, ccColor3B pCCColor3B, CCBReader * pCCBReader);
22 | virtual void onHandlePropTypeByte(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, unsigned char pByte, CCBReader * pCCBReader);
23 | virtual void onHandlePropTypeBlendFunc(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, ccBlendFunc pCCBlendFunc, CCBReader * pCCBReader);
24 | virtual void onHandlePropTypeSpriteFrame(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, CCSpriteFrame * pCCSpriteFrame, CCBReader * pCCBReader);
25 | virtual void onHandlePropTypeSize(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, CCSize pSize, CCBReader * pCCBReader);
26 | virtual void onHandlePropTypeFloat(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, float pFloat, CCBReader * pCCBReader);
27 | };
28 |
29 | NS_CC_EXT_END
30 |
31 | #endif
32 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/cocos2dx/platform/ios/CCLock.cpp:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | Copyright (c) 2010 cocos2d-x.org
3 |
4 | http://www.cocos2d-x.org
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in
14 | all copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | THE SOFTWARE.
23 | ****************************************************************************/
24 | #include "CCLock.h"
25 |
26 | NS_CC_BEGIN
27 |
28 | CCLock::CCLock(void)
29 | {
30 | }
31 |
32 | CCLock::~CCLock(void)
33 | {
34 |
35 | }
36 |
37 | void CCLock::lock(void)
38 | {
39 |
40 | }
41 |
42 | void CCLock::unlock(void)
43 | {
44 |
45 | }
46 |
47 | NS_CC_END
48 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/cocos2dx/support/ccUtils.cpp:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | Copyright (c) 2010 cocos2d-x.org
3 |
4 | http://www.cocos2d-x.org
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in
14 | all copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | THE SOFTWARE.
23 | ****************************************************************************/
24 | #include "ccUtils.h"
25 |
26 | namespace cocos2d {
27 |
28 | unsigned long ccNextPOT(unsigned long x)
29 | {
30 | x = x - 1;
31 | x = x | (x >> 1);
32 | x = x | (x >> 2);
33 | x = x | (x >> 4);
34 | x = x | (x >> 8);
35 | x = x | (x >>16);
36 | return x + 1;
37 | }
38 |
39 | }
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/cocos2dx/platform/ios/CCThread.mm:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | Copyright (c) 2010 cocos2d-x.org
3 |
4 | http://www.cocos2d-x.org
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in
14 | all copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | THE SOFTWARE.
23 | ****************************************************************************/
24 | #import
25 | #include "CCThread.h"
26 |
27 | NS_CC_BEGIN
28 |
29 | CCThread::~CCThread()
30 | {
31 | [(id)m_pAutoreasePool release];
32 | }
33 |
34 | void CCThread::createAutoreleasePool()
35 | {
36 | m_pAutoreasePool = [[NSAutoreleasePool alloc] init];
37 | }
38 |
39 | NS_CC_END
40 |
--------------------------------------------------------------------------------
/MyMoonWarrior.xcodeproj/project.xcworkspace/xcshareddata/MyMoonWarrior.xccheckout:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDESourceControlProjectIdentifier
6 | 07574AC9-706B-4842-9A91-754A5F32762B
7 | IDESourceControlProjectName
8 | MyMoonWarrior
9 | IDESourceControlProjectOriginsDictionary
10 |
11 | F856097D-1DF2-43F6-ACDB-EEA8747BD126
12 | https://github.com/longlovewen/MyMoonWarrior.git
13 |
14 | IDESourceControlProjectPath
15 | MyMoonWarrior.xcodeproj/project.xcworkspace
16 | IDESourceControlProjectRelativeInstallPathDictionary
17 |
18 | F856097D-1DF2-43F6-ACDB-EEA8747BD126
19 | ../..
20 |
21 | IDESourceControlProjectURL
22 | https://github.com/longlovewen/MyMoonWarrior.git
23 | IDESourceControlProjectVersion
24 | 110
25 | IDESourceControlProjectWCCIdentifier
26 | F856097D-1DF2-43F6-ACDB-EEA8747BD126
27 | IDESourceControlProjectWCConfigurations
28 |
29 |
30 | IDESourceControlRepositoryExtensionIdentifierKey
31 | public.vcs.git
32 | IDESourceControlWCCIdentifierKey
33 | F856097D-1DF2-43F6-ACDB-EEA8747BD126
34 | IDESourceControlWCCName
35 | MyMoonWarrior
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/MyMoonWarrior/Resources/game.tmx:
--------------------------------------------------------------------------------
1 |
2 |
12 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/extensions/ExtensionMacros.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | Copyright (c) 2012 cocos2d-x.org
3 |
4 | http://www.cocos2d-x.org
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in
14 | all copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | THE SOFTWARE.
23 | ****************************************************************************/
24 |
25 | #ifndef __EXTENSIONMARCROS_H__
26 | #define __EXTENSIONMARCROS_H__
27 |
28 | #define NS_CC_EXT_BEGIN namespace cocos2d { namespace extension {
29 | #define NS_CC_EXT_END }}
30 | #define USING_NS_CC_EXT using namespace cocos2d::extension
31 |
32 |
33 | #endif /* __EXTENSIONMARCROS_H__ */
34 |
35 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/cocos2dx/platform/ios/CCDirectorCaller.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | Copyright (c) 2010 cocos2d-x.org
3 |
4 | http://www.cocos2d-x.org
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in
14 | all copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | THE SOFTWARE.
23 | ****************************************************************************/
24 | #import
25 |
26 | @interface CCDirectorCaller : NSObject {
27 | id displayLink;
28 | int interval;
29 | }
30 | @property (readwrite) int interval;
31 | -(void) startMainLoop;
32 | -(void) doCaller: (id) sender;
33 | -(void) setAnimationInterval:(double)interval;
34 | +(id) sharedDirectorCaller;
35 | +(void) destroy;
36 | @end
37 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/cocos2dx/platform/ios/CCLock.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | Copyright (c) 2010 cocos2d-x.org
3 |
4 | http://www.cocos2d-x.org
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in
14 | all copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | THE SOFTWARE.
23 | ****************************************************************************/
24 |
25 | #ifndef __PLATFORM_IPHONE_PLATFORM_CCLOCK_H__
26 | #define __PLATFORM_IPHONE_PLATFORM_CCLOCK_H__
27 |
28 | #include "CCPlatformMacros.h"
29 |
30 | NS_CC_BEGIN
31 |
32 | class CCLock
33 | {
34 | public:
35 | CCLock(void);
36 | ~CCLock(void);
37 |
38 | void lock(void);
39 | void unlock(void);
40 | };
41 |
42 | NS_CC_END
43 |
44 | #endif // __PLATFORM_IPHONE_PLATFORM_CCLOCK_H__
45 |
--------------------------------------------------------------------------------
/MyMoonWarrior/Classes/AppDelegate.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // MyMoonWarriorAppDelegate.cpp
3 | // MyMoonWarrior
4 | //
5 | // Created by cesc on 13-3-2.
6 | // Copyright __MyCompanyName__ 2013年. All rights reserved.
7 | //
8 |
9 | #include "AppDelegate.h"
10 |
11 | #include "cocos2d.h"
12 | #include "HelloWorldScene.h"
13 | #include "WelcomeLayer.h"
14 | USING_NS_CC;
15 |
16 | AppDelegate::AppDelegate()
17 | {
18 |
19 | }
20 |
21 | AppDelegate::~AppDelegate()
22 | {
23 | }
24 |
25 | bool AppDelegate::applicationDidFinishLaunching()
26 | {
27 | // initialize director
28 | CCDirector *pDirector = CCDirector::sharedDirector();
29 | pDirector->setOpenGLView(CCEGLView::sharedOpenGLView());
30 |
31 | // turn on display FPS
32 | pDirector->setDisplayStats(true);
33 |
34 | // set FPS. the default value is 1.0/60 if you don't call this
35 | pDirector->setAnimationInterval(1.0 / 60);
36 |
37 | // create a scene. it's an autorelease object
38 | CCScene *pScene = WelcomeLayer::scene();
39 |
40 | // run
41 | pDirector->runWithScene(pScene);
42 |
43 | return true;
44 | }
45 |
46 | // This function will be called when the app is inactive. When comes a phone call,it's be invoked too
47 | void AppDelegate::applicationDidEnterBackground()
48 | {
49 | CCDirector::sharedDirector()->pause();
50 |
51 | // if you use SimpleAudioEngine, it must be paused
52 | // SimpleAudioEngine::sharedEngine()->pauseBackgroundMusic();
53 | }
54 |
55 | // this function will be called when the app is active again
56 | void AppDelegate::applicationWillEnterForeground()
57 | {
58 | CCDirector::sharedDirector()->resume();
59 |
60 | // if you use SimpleAudioEngine, it must resume here
61 | // SimpleAudioEngine::sharedEngine()->resumeBackgroundMusic();
62 | }
63 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/cocos2dx/kazmath/include/kazmath/kazmath.h:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2008, Luke Benstead.
3 | All rights reserved.
4 |
5 | Redistribution and use in source and binary forms, with or without modification,
6 | are permitted provided that the following conditions are met:
7 |
8 | * Redistributions of source code must retain the above copyright notice,
9 | this list of conditions and the following disclaimer.
10 | * Redistributions in binary form must reproduce the above copyright notice,
11 | this list of conditions and the following disclaimer in the documentation
12 | and/or other materials provided with the distribution.
13 |
14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
18 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
21 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 | */
25 |
26 | #ifndef KAZMATH_H_INCLUDED
27 | #define KAZMATH_H_INCLUDED
28 |
29 | #include "vec2.h"
30 | #include "vec3.h"
31 | #include "mat3.h"
32 | #include "mat4.h"
33 | #include "utility.h"
34 | #include "quaternion.h"
35 | #include "plane.h"
36 | #include "aabb.h"
37 | #include "ray2.h"
38 |
39 | #endif // KAZMATH_H_INCLUDED
40 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/extensions/GUI/CCControlExtension/CCControlExtensions.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | Copyright (c) 2012 cocos2d-x.org
3 |
4 | http://www.cocos2d-x.org
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in
14 | all copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | THE SOFTWARE.
23 | ****************************************************************************/
24 |
25 | #ifndef __CCCONTROL_EXTENSIONS_H__
26 | #define __CCCONTROL_EXTENSIONS_H__
27 |
28 | #include "CCScale9Sprite.h"
29 | #include "CCControl.h"
30 | #include "CCControlButton.h"
31 | #include "CCControlColourPicker.h"
32 | #include "CCControlPotentiometer.h"
33 | #include "CCControlSlider.h"
34 | #include "CCControlStepper.h"
35 | #include "CCControlSwitch.h"
36 |
37 | #endif
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/extensions/cocos-ext.h:
--------------------------------------------------------------------------------
1 | #ifndef __COCOS2D_EXT_H__
2 | #define __COCOS2D_EXT_H__
3 |
4 | #include "ExtensionMacros.h"
5 |
6 | #include "CCBReader/CCBFileLoader.h"
7 | #include "CCBReader/CCBMemberVariableAssigner.h"
8 | #include "CCBReader/CCBReader.h"
9 | #include "CCBReader/CCBSelectorResolver.h"
10 | #include "CCBReader/CCControlButtonLoader.h"
11 | #include "CCBReader/CCControlLoader.h"
12 | #include "CCBReader/CCLabelBMFontLoader.h"
13 | #include "CCBReader/CCLabelTTFLoader.h"
14 | #include "CCBReader/CCLayerColorLoader.h"
15 | #include "CCBReader/CCLayerGradientLoader.h"
16 | #include "CCBReader/CCLayerLoader.h"
17 | #include "CCBReader/CCMenuItemImageLoader.h"
18 | #include "CCBReader/CCMenuItemLoader.h"
19 | #include "CCBReader/CCMenuLoader.h"
20 | #include "CCBReader/CCNodeLoader.h"
21 | #include "CCBReader/CCNodeLoaderLibrary.h"
22 | #include "CCBReader/CCNodeLoaderListener.h"
23 | #include "CCBReader/CCParticleSystemQuadLoader.h"
24 | #include "CCBReader/CCScale9SpriteLoader.h"
25 | #include "CCBReader/CCScrollViewLoader.h"
26 | #include "CCBReader/CCSpriteLoader.h"
27 | #include "CCBReader/CCBAnimationManager.h"
28 | #include "CCBReader/CCBKeyframe.h"
29 | #include "CCBReader/CCBSequence.h"
30 | #include "CCBReader/CCBSequenceProperty.h"
31 | #include "CCBReader/CCBValue.h"
32 | #include "CCBReader/CCData.h"
33 | #include "CCBReader/CCNode+CCBRelativePositioning.h"
34 |
35 | #include "GUI/CCControlExtension/CCControlExtensions.h"
36 | #include "GUI/CCScrollView/CCScrollView.h"
37 | #include "GUI/CCScrollView/CCTableView.h"
38 | #include "GUI/CCEditBox/CCEditBox.h"
39 |
40 | #include "network/HttpRequest.h"
41 | #include "network/HttpResponse.h"
42 | #include "network/HttpClient.h"
43 |
44 | #endif /* __COCOS2D_EXT_H__ */
45 |
46 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/extensions/CCBReader/CCLabelTTFLoader.h:
--------------------------------------------------------------------------------
1 | #ifndef _CCB_CCLABELTTFLOADER_H_
2 | #define _CCB_CCLABELTTFLOADER_H_
3 |
4 | #include "CCNodeLoader.h"
5 |
6 | NS_CC_EXT_BEGIN
7 |
8 | /* Forward declaration. */
9 | class CCBReader;
10 |
11 | class CCLabelTTFLoader : public CCNodeLoader {
12 | public:
13 | virtual ~CCLabelTTFLoader() {};
14 | CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(CCLabelTTFLoader, loader);
15 |
16 | protected:
17 | CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(CCLabelTTF);
18 |
19 | virtual void onHandlePropTypeColor3(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, ccColor3B pCCColor3B, CCBReader * pCCBReader);
20 | virtual void onHandlePropTypeByte(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, unsigned char pByte, CCBReader * pCCBReader);
21 | virtual void onHandlePropTypeBlendFunc(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, ccBlendFunc pCCBlendFunc, CCBReader * pCCBReader);
22 | virtual void onHandlePropTypeFontTTF(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, CCString * pFontTTF, CCBReader * pCCBReader);
23 | virtual void onHandlePropTypeText(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, CCString * pText, CCBReader * pCCBReader);
24 | virtual void onHandlePropTypeFloatScale(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, float pFloatScale, CCBReader * pCCBReader);
25 | virtual void onHandlePropTypeIntegerLabeled(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, int pIntegerLabeled, CCBReader * pCCBReader);
26 | virtual void onHandlePropTypeSize(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, CCSize pSize, CCBReader * pCCBReader);
27 | };
28 |
29 | NS_CC_EXT_END
30 |
31 | #endif
32 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/cocos2dx/kazmath/include/kazmath/neon_matrix_impl.h:
--------------------------------------------------------------------------------
1 | /*
2 | NEON math library for the iPhone / iPod touch
3 |
4 | Copyright (c) 2009 Justin Saunders
5 |
6 | This software is provided 'as-is', without any express or implied warranty.
7 | In no event will the authors be held liable for any damages arising
8 | from the use of this software.
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it freely,
11 | subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must
14 | not claim that you wrote the original software. If you use this
15 | software in a product, an acknowledgment in the product documentation
16 | would be appreciated but is not required.
17 |
18 | 2. Altered source versions must be plainly marked as such, and must
19 | not be misrepresented as being the original software.
20 |
21 | 3. This notice may not be removed or altered from any source distribution.
22 | */
23 |
24 | #ifndef __NEON_MATRIX_IMPL_H__
25 | #define __NEON_MATRIX_IMPL_H__
26 |
27 | #ifdef __arm__
28 | #if defined(__QNX__) || defined(ANDROID)
29 | // blackberry and android don't have arm/arch.h but it defines __arm__
30 | #else
31 | #include "arm/arch.h"
32 | #endif
33 | #endif // __arm__
34 |
35 | // Matrices are assumed to be stored in column major format according to OpenGL
36 | // specification.
37 |
38 | // Multiplies two 4x4 matrices (a,b) outputting a 4x4 matrix (output)
39 | void NEON_Matrix4Mul(const float* a, const float* b, float* output );
40 |
41 | // Multiplies a 4x4 matrix (m) with a vector 4 (v), outputting a vector 4
42 | void NEON_Matrix4Vector4Mul(const float* m, const float* v, float* output);
43 |
44 |
45 | #endif // __NEON_MATRIX_IMPL_H__
46 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/cocos2dx/platform/ios/CCGL.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | Copyright (c) 2010 cocos2d-x.org
3 |
4 | http://www.cocos2d-x.org
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in
14 | all copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | THE SOFTWARE.
23 | ****************************************************************************/
24 |
25 | #ifndef __CCGL_H__
26 | #define __CCGL_H__
27 |
28 | #define glClearDepth glClearDepthf
29 | #define glDeleteVertexArrays glDeleteVertexArraysOES
30 | #define glGenVertexArrays glGenVertexArraysOES
31 | #define glBindVertexArray glBindVertexArrayOES
32 | #define CC_GL_DEPTH24_STENCIL8 GL_DEPTH24_STENCIL8_OES
33 |
34 | #include
35 | #include
36 |
37 |
38 | #endif // __CCGL_H__
39 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/cocos2dx/platform/ios/CCAccelerometer.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | Copyright (c) 2010 cocos2d-x.org
3 |
4 | http://www.cocos2d-x.org
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in
14 | all copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | THE SOFTWARE.
23 | ****************************************************************************/
24 |
25 | #ifndef __PLATFORM_IPHONE_CCACCELEROMETER_H__
26 | #define __PLATFORM_IPHONE_CCACCELEROMETER_H__
27 |
28 | #include "platform/CCAccelerometerDelegate.h"
29 |
30 | NS_CC_BEGIN
31 |
32 | class CC_DLL CCAccelerometer
33 | {
34 | public:
35 | CCAccelerometer();
36 | ~CCAccelerometer();
37 |
38 | void setDelegate(CCAccelerometerDelegate* pDelegate);
39 | void setAccelerometerInterval(float interval);
40 | };
41 |
42 | NS_CC_END
43 |
44 | #endif
45 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/cocos2dx/cocoa/CCZone.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | Copyright (c) 2010 cocos2d-x.org
3 |
4 | http://www.cocos2d-x.org
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in
14 | all copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | THE SOFTWARE.
23 | ****************************************************************************/
24 |
25 | #ifndef __CC_ZONE_H__
26 | #define __CC_ZONE_H__
27 |
28 | #include "platform/CCPlatformMacros.h"
29 | #include
30 |
31 | NS_CC_BEGIN
32 |
33 | /**
34 | * @addtogroup data_structures
35 | * @{
36 | */
37 |
38 | class CCObject;
39 |
40 | class CC_DLL CCZone
41 | {
42 | public:
43 | CCZone(CCObject *pObject = NULL);
44 |
45 | public:
46 | CCObject *m_pCopyObject;
47 | };
48 |
49 | // end of data_structure group
50 | /// @}
51 |
52 | NS_CC_END
53 |
54 | #endif // __CC_ZONE_H__
55 |
56 |
--------------------------------------------------------------------------------
/MyMoonWarrior/Resources/bullet.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | frames
6 |
7 | W1.png
8 |
9 | frame
10 | {{2,29},{14,62}}
11 | offset
12 | {0,0}
13 | rotated
14 |
15 | sourceColorRect
16 | {{0,0},{14,62}}
17 | sourceSize
18 | {14,62}
19 |
20 | W2.png
21 |
22 | frame
23 | {{2,2},{25,25}}
24 | offset
25 | {0,0}
26 | rotated
27 |
28 | sourceColorRect
29 | {{0,0},{25,25}}
30 | sourceSize
31 | {25,25}
32 |
33 |
34 | metadata
35 |
36 | format
37 | 2
38 | realTextureFileName
39 | bullet.png
40 | size
41 | {32,128}
42 | smartupdate
43 | $TexturePacker:SmartUpdate:62c336b840c0c8c734ff060ea6f239c1$
44 | textureFileName
45 | bullet.png
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/cocos2dx/support/TransformUtils.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | Copyright (c) 2010-2012 cocos2d-x.org
3 | Copyright (c) 2009 Valentin Milea
4 |
5 | http://www.cocos2d-x.org
6 |
7 | Permission is hereby granted, free of charge, to any person obtaining a copy
8 | of this software and associated documentation files (the "Software"), to deal
9 | in the Software without restriction, including without limitation the rights
10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 | copies of the Software, and to permit persons to whom the Software is
12 | furnished to do so, subject to the following conditions:
13 |
14 | The above copyright notice and this permission notice shall be included in
15 | all copies or substantial portions of the Software.
16 |
17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 | THE SOFTWARE.
24 | ****************************************************************************/
25 |
26 | #ifndef __SUPPORT_TRANSFORM_UTILS_H__
27 | #define __SUPPORT_TRANSFORM_UTILS_H__
28 |
29 | // todo:
30 | // when in MAC or windows, it includes
31 | #include "CCGL.h"
32 |
33 | namespace cocos2d {
34 |
35 | struct CCAffineTransform;
36 |
37 | void CGAffineToGL(const CCAffineTransform *t, GLfloat *m);
38 | void GLToCGAffine(const GLfloat *m, CCAffineTransform *t);
39 | }//namespace cocos2d
40 |
41 | #endif // __SUPPORT_TRANSFORM_UTILS_H__
42 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/extensions/CCBReader/CCParticleSystemQuadLoader.h:
--------------------------------------------------------------------------------
1 | #ifndef _CCB_CCPARTICLESYSTEMQUADLOADER_H_
2 | #define _CCB_CCPARTICLESYSTEMQUADLOADER_H_
3 |
4 | #include "CCNodeLoader.h"
5 |
6 | NS_CC_EXT_BEGIN
7 |
8 | /* Forward declaration. */
9 | class CCBReader;
10 |
11 | class CCParticleSystemQuadLoader : public CCNodeLoader {
12 | public:
13 | virtual ~CCParticleSystemQuadLoader() {};
14 | CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(CCParticleSystemQuadLoader, loader);
15 |
16 | protected:
17 | CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(CCParticleSystemQuad);
18 |
19 | virtual void onHandlePropTypeIntegerLabeled(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, int pIntegerLabeled, CCBReader * pCCBReader);
20 | virtual void onHandlePropTypePoint(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, CCPoint pPoint, CCBReader * pCCBReader);
21 | virtual void onHandlePropTypeFloat(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, float pFloat, CCBReader * pCCBReader);
22 | virtual void onHandlePropTypeInteger(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, int pInteger, CCBReader * pCCBReader);
23 | virtual void onHandlePropTypeFloatVar(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, float * pFloatVar, CCBReader * pCCBReader);
24 | virtual void onHandlePropTypeColor4FVar(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, ccColor4F * pCCColor4FVar, CCBReader * pCCBReader);
25 | virtual void onHandlePropTypeBlendFunc(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, ccBlendFunc pCCBlendFunc, CCBReader * pCCBReader);
26 | virtual void onHandlePropTypeTexture(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, CCTexture2D * pCCTexture2D, CCBReader * pCCBReader);
27 | };
28 |
29 | NS_CC_EXT_END
30 |
31 | #endif
32 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/extensions/CCBReader/CCControlButtonLoader.h:
--------------------------------------------------------------------------------
1 | #ifndef _CCB_CCCONTROLBUTTONLOADER_H_
2 | #define _CCB_CCCONTROLBUTTONLOADER_H_
3 |
4 | #include "CCControlLoader.h"
5 | #include "../GUI/CCControlExtension/CCControlButton.h"
6 |
7 | NS_CC_EXT_BEGIN
8 |
9 | /* Forward declaration. */
10 | class CCBReader;
11 |
12 | class CCControlButtonLoader : public CCControlLoader {
13 | public:
14 | virtual ~CCControlButtonLoader() {};
15 | CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(CCControlButtonLoader, loader);
16 |
17 | protected:
18 | CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(CCControlButton);
19 |
20 | virtual void onHandlePropTypeCheck(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, bool pCheck, CCBReader * pCCBReader);
21 | virtual void onHandlePropTypeString(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, CCString * pString, CCBReader * pCCBReader);
22 | virtual void onHandlePropTypeFontTTF(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, CCString * pFontTTF, CCBReader * pCCBReader);
23 | virtual void onHandlePropTypeFloatScale(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, float pFloatScale, CCBReader * pCCBReader);
24 | virtual void onHandlePropTypePoint(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, CCPoint pPoint, CCBReader * pCCBReader);
25 | virtual void onHandlePropTypeSize(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, CCSize pSize, CCBReader * pCCBReader);
26 | virtual void onHandlePropTypeSpriteFrame(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, CCSpriteFrame * pCCSpriteFrame, CCBReader * pCCBReader);
27 | virtual void onHandlePropTypeColor3(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, ccColor3B pCCColor3B, CCBReader * pCCBReader);
28 | };
29 |
30 | NS_CC_EXT_END
31 |
32 | #endif
33 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/cocos2dx/platform/CCApplicationProtocol.h:
--------------------------------------------------------------------------------
1 | #ifndef __CC_APPLICATION_PROTOCOL_H__
2 | #define __CC_APPLICATION_PROTOCOL_H__
3 |
4 | NS_CC_BEGIN
5 |
6 | enum TargetPlatform
7 | {
8 | kTargetWindows,
9 | kTargetLinux,
10 | kTargetMacOS,
11 | kTargetAndroid,
12 | kTargetIphone,
13 | kTargetIpad,
14 | kTargetBlackBerry,
15 | };
16 |
17 | /**
18 | * @addtogroup platform
19 | * @{
20 | */
21 |
22 | class CC_DLL CCApplicationProtocol
23 | {
24 | public:
25 |
26 | virtual ~CCApplicationProtocol() {}
27 |
28 | /**
29 | @brief Implement CCDirector and CCScene init code here.
30 | @return true Initialize success, app continue.
31 | @return false Initialize failed, app terminate.
32 | */
33 | virtual bool applicationDidFinishLaunching() = 0;
34 |
35 | /**
36 | @brief The function be called when the application enter background
37 | @param the pointer of the application
38 | */
39 | virtual void applicationDidEnterBackground() = 0;
40 |
41 | /**
42 | @brief The function be called when the application enter foreground
43 | @param the pointer of the application
44 | */
45 | virtual void applicationWillEnterForeground() = 0;
46 |
47 | /**
48 | @brief Callback by CCDirector for limit FPS.
49 | @interval The time, expressed in seconds, between current frame and next.
50 | */
51 | virtual void setAnimationInterval(double interval) = 0;
52 |
53 | /**
54 | @brief Get current language config
55 | @return Current language config
56 | */
57 | virtual ccLanguageType getCurrentLanguage() = 0;
58 |
59 | /**
60 | @brief Get target platform
61 | */
62 | virtual TargetPlatform getTargetPlatform() = 0;
63 | };
64 |
65 | // end of platform group
66 | /// @}
67 |
68 | NS_CC_END
69 |
70 | #endif // __CC_APPLICATION_PROTOCOL_H__
71 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/cocos2dx/platform/ios/CCStdC.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | Copyright (c) 2010 cocos2d-x.org
3 |
4 | http://www.cocos2d-x.org
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in
14 | all copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | THE SOFTWARE.
23 | ****************************************************************************/
24 |
25 | #ifndef __CC_STD_C_H__
26 | #define __CC_STD_C_H__
27 |
28 | #include "platform/CCPlatformMacros.h"
29 | #include
30 | #include
31 | #include
32 | #include
33 | #include
34 | #include
35 | #include
36 | #include
37 | #include
38 |
39 | #ifndef MIN
40 | #define MIN(x,y) (((x) > (y)) ? (y) : (x))
41 | #endif // MIN
42 |
43 | #ifndef MAX
44 | #define MAX(x,y) (((x) < (y)) ? (y) : (x))
45 | #endif // MAX
46 |
47 | #endif // __CC_STD_C_H__
48 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/cocos2dx/platform/ios/Simulation/AccelerometerSimulation.h:
--------------------------------------------------------------------------------
1 | /*
2 | * AccelerometerSimulation.h
3 | * AccelerometerGraph
4 | *
5 | * Created by Otto Chrons on 9/26/08.
6 | * Copyright 2008 Seastringo Oy. All rights reserved.
7 | *
8 | */
9 | #import
10 |
11 | // when compiling to ARM (iPhone device), hide everything and use system defaults
12 | // if you wish to use simulation mode even on the device, remove the #if/#endif
13 | #if !TARGET_CPU_ARM
14 | #import
15 |
16 | // this is exactly the same as UIAcceleration, but we can modify the member variables
17 | @interface UIAccelerationSimulation: NSObject
18 | {
19 | NSTimeInterval timestamp;
20 | UIAccelerationValue x, y, z;
21 | }
22 | @property(nonatomic, readonly) NSTimeInterval timestamp;
23 | @property(nonatomic, readonly) UIAccelerationValue x, y, z;
24 |
25 | @end
26 |
27 | // override UIAccelerometer behavior
28 | @interface UIAccelerometer (Simulation)
29 | + (UIAccelerometer *)sharedAccelerometer;
30 | @end
31 |
32 | // our own version of the Accelerometer
33 | @interface AccelerometerSimulation : UIAccelerometer
34 | {
35 |
36 | //CFSocketRef udpSocket;
37 | int udpSocket;
38 | NSThread *thread;
39 | BOOL isExiting;
40 | id accelDelegate;
41 | UIAccelerationSimulation *accObject;
42 | // Threaded notification support
43 | NSMutableArray *notifications;
44 | NSThread *notificationThread;
45 | NSLock *notificationLock;
46 | NSMachPort *notificationPort;
47 | }
48 |
49 | @property(nonatomic, assign) id delegate;
50 |
51 | - (void) setUpThreadingSupport;
52 | - (void) handleMachMessage:(void *) msg;
53 | - (void) processNotification:(NSNotification *) notification;
54 | + (AccelerometerSimulation *)getAccelerometer;
55 | - (AccelerometerSimulation *)initialize;
56 |
57 | @end
58 |
59 | #endif
60 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/cocos2dx/support/ccUtils.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | Copyright (c) 2010 cocos2d-x.org
3 |
4 | http://www.cocos2d-x.org
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in
14 | all copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | THE SOFTWARE.
23 | ****************************************************************************/
24 | #ifndef __SUPPORT_CC_UTILS_H__
25 | #define __SUPPORT_CC_UTILS_H__
26 |
27 | /** @file ccUtils.h
28 | Misc free functions
29 | */
30 |
31 | namespace cocos2d {
32 | /*
33 | ccNextPOT function is licensed under the same license that is used in CCTexture2D.m.
34 | */
35 |
36 | /** returns the Next Power of Two value.
37 |
38 | Examples:
39 | - If "value" is 15, it will return 16.
40 | - If "value" is 16, it will return 16.
41 | - If "value" is 17, it will return 32.
42 |
43 | @since v0.99.5
44 | */
45 |
46 | unsigned long ccNextPOT( unsigned long value );
47 |
48 | }
49 |
50 | #endif // __SUPPORT_CC_UTILS_H__
51 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/extensions/GUI/CCScrollView/CCTableViewCell.cpp:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | Copyright (c) 2012 cocos2d-x.org
3 | Copyright (c) 2010 Sangwoo Im
4 |
5 | http://www.cocos2d-x.org
6 |
7 | Permission is hereby granted, free of charge, to any person obtaining a copy
8 | of this software and associated documentation files (the "Software"), to deal
9 | in the Software without restriction, including without limitation the rights
10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 | copies of the Software, and to permit persons to whom the Software is
12 | furnished to do so, subject to the following conditions:
13 |
14 | The above copyright notice and this permission notice shall be included in
15 | all copies or substantial portions of the Software.
16 |
17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 | THE SOFTWARE.
24 | ****************************************************************************/
25 |
26 | #include "CCTableViewCell.h"
27 |
28 | NS_CC_EXT_BEGIN
29 |
30 | void CCTableViewCell::reset()
31 | {
32 | m_uIdx = CC_INVALID_INDEX;
33 | }
34 |
35 | void CCTableViewCell::setObjectID(unsigned int uIdx)
36 | {
37 | m_uIdx = uIdx;
38 | }
39 |
40 | unsigned int CCTableViewCell::getObjectID()
41 | {
42 | return m_uIdx;
43 | }
44 |
45 | unsigned int CCTableViewCell::getIdx()
46 | {
47 | return m_uIdx;
48 | }
49 |
50 | void CCTableViewCell::setIdx(unsigned int uIdx)
51 | {
52 | m_uIdx = uIdx;
53 | }
54 |
55 | NS_CC_EXT_END
56 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/cocos2dx/platform/platform.cpp:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | Copyright (c) 2010 cocos2d-x.org
3 |
4 | http://www.cocos2d-x.org
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in
14 | all copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | THE SOFTWARE.
23 | ****************************************************************************/
24 |
25 | #include "platform.h"
26 |
27 | #include "CCStdC.h"
28 |
29 | NS_CC_BEGIN
30 |
31 | int CCTime::gettimeofdayCocos2d(struct cc_timeval *tp, void *tzp)
32 | {
33 | CC_UNUSED_PARAM(tzp);
34 | if (tp)
35 | {
36 | gettimeofday((struct timeval *)tp, 0);
37 | }
38 | return 0;
39 | }
40 |
41 | double CCTime::timersubCocos2d(struct cc_timeval *start, struct cc_timeval *end)
42 | {
43 | if (! start || ! end)
44 | {
45 | return 0;
46 | }
47 |
48 | return ((end->tv_sec*1000.0+end->tv_usec/1000.0) - (start->tv_sec*1000.0+start->tv_usec/1000.0));
49 | }
50 |
51 | NS_CC_END
52 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/extensions/CCBReader/CCNode+CCBRelativePositioning.cpp:
--------------------------------------------------------------------------------
1 | #include "CCNode+CCBRelativePositioning.h"
2 | #include "CCBReader.h"
3 |
4 | using namespace cocos2d;
5 |
6 | NS_CC_EXT_BEGIN
7 |
8 | CCPoint getAbsolutePosition(const CCPoint &pt, int nType, const CCSize &containerSize, const char *pPropName)
9 | {
10 | CCPoint absPt = ccp(0,0);
11 | if (nType == kCCBPositionTypeRelativeBottomLeft)
12 | {
13 | absPt = pt;
14 | }
15 | else if (nType == kCCBPositionTypeRelativeTopLeft)
16 | {
17 | absPt.x = pt.x;
18 | absPt.y = containerSize.height - pt.y;
19 | }
20 | else if (nType == kCCBPositionTypeRelativeTopRight)
21 | {
22 | absPt.x = containerSize.width - pt.x;
23 | absPt.y = containerSize.height - pt.y;
24 | }
25 | else if (nType == kCCBPositionTypeRelativeBottomRight)
26 | {
27 | absPt.x = containerSize.width - pt.x;
28 | absPt.y = pt.y;
29 | }
30 | else if (nType == kCCBPositionTypePercent)
31 | {
32 | absPt.x = (int)(containerSize.width * pt.x / 100.0f);
33 | absPt.y = (int)(containerSize.height * pt.y / 100.0f);
34 | }
35 | else if (nType == kCCBPositionTypeMultiplyResolution)
36 | {
37 | float resolutionScale = CCBReader::getResolutionScale();
38 |
39 | absPt.x = pt.x * resolutionScale;
40 | absPt.y = pt.y * resolutionScale;
41 | }
42 |
43 | return absPt;
44 | }
45 |
46 | void setRelativeScale(CCNode *pNode, float fScaleX, float fScaleY, int nType, const char* pPropName)
47 | {
48 | CCAssert(pNode, "pNode should not be null");
49 |
50 | if (nType == kCCBScaleTypeMultiplyResolution)
51 | {
52 | float resolutionScale = CCBReader::getResolutionScale();
53 |
54 | fScaleX *= resolutionScale;
55 | fScaleY *= resolutionScale;
56 | }
57 |
58 | pNode->setScaleX(fScaleX);
59 | pNode->setScaleY(fScaleY);
60 | }
61 |
62 | NS_CC_EXT_END
63 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/cocos2dx/support/base64.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | Copyright (c) 2010 cocos2d-x.org
3 |
4 | http://www.cocos2d-x.org
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in
14 | all copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | THE SOFTWARE.
23 | ****************************************************************************/
24 |
25 | #ifndef __SUPPORT_BASE64_H__
26 | #define __SUPPORT_BASE64_H__
27 |
28 | #ifdef __cplusplus
29 | extern "C" {
30 | #endif
31 |
32 | namespace cocos2d {
33 |
34 | /** @file
35 | base64 helper functions
36 | */
37 |
38 | /**
39 | * Decodes a 64base encoded memory. The decoded memory is
40 | * expected to be freed by the caller.
41 | *
42 | * @returns the length of the out buffer
43 | *
44 | @since v0.8.1
45 | */
46 | int base64Decode(unsigned char *in, unsigned int inLength, unsigned char **out);
47 |
48 | }//namespace cocos2d
49 |
50 | #ifdef __cplusplus
51 | }
52 | #endif
53 |
54 | #endif // __SUPPORT_BASE64_H__
55 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/cocos2dx/platform/ios/CCAccelerometer.mm:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | Copyright (c) 2010 cocos2d-x.org
3 |
4 | http://www.cocos2d-x.org
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in
14 | all copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | THE SOFTWARE.
23 | ****************************************************************************/
24 |
25 | #include "CCAccelerometer.h"
26 | #include "AccelerometerDelegateWrapper.h"
27 |
28 | NS_CC_BEGIN
29 |
30 | CCAccelerometer::CCAccelerometer()
31 | {
32 | }
33 |
34 | CCAccelerometer::~CCAccelerometer()
35 | {
36 | }
37 |
38 | void CCAccelerometer::setDelegate(CCAccelerometerDelegate* pDelegate)
39 | {
40 | [[AccelerometerDispatcher sharedAccelerometerDispather] addDelegate:pDelegate];
41 | }
42 |
43 | void CCAccelerometer::setAccelerometerInterval(float interval)
44 | {
45 | [[AccelerometerDispatcher sharedAccelerometerDispather] setAccelerometerInterval:interval];
46 | }
47 |
48 | NS_CC_END
49 |
50 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/cocos2dx/platform/platform.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | Copyright (c) 2010 cocos2d-x.org
3 |
4 | http://www.cocos2d-x.org
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in
14 | all copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | THE SOFTWARE.
23 | ****************************************************************************/
24 |
25 | #ifndef __PLATFORM_H__
26 | #define __PLATFORM_H__
27 |
28 | #include "CCThread.h"
29 | #include "CCPlatformMacros.h"
30 |
31 | NS_CC_BEGIN
32 |
33 | /**
34 | * @addtogroup platform
35 | * @{
36 | */
37 |
38 | struct CC_DLL cc_timeval
39 | {
40 | long tv_sec; // seconds
41 | long tv_usec; // microSeconds
42 | };
43 |
44 | class CC_DLL CCTime
45 | {
46 | public:
47 | static int gettimeofdayCocos2d(struct cc_timeval *tp, void *tzp);
48 | static double timersubCocos2d(struct cc_timeval *start, struct cc_timeval *end);
49 | };
50 |
51 | // end of platform group
52 | /// @}
53 |
54 | NS_CC_END
55 |
56 | #endif // __PLATFORM_H__
57 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/cocos2dx/platform/CCThread.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | Copyright (c) 2010 cocos2d-x.org
3 |
4 | http://www.cocos2d-x.org
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in
14 | all copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | THE SOFTWARE.
23 | ****************************************************************************/
24 |
25 | #ifndef __CC_PLATFORM_THREAD_H__
26 | #define __CC_PLATFORM_THREAD_H__
27 |
28 | #include "CCCommon.h"
29 | #include "CCPlatformMacros.h"
30 |
31 | NS_CC_BEGIN
32 |
33 | /**
34 | * @addtogroup platform
35 | * @{
36 | */
37 |
38 | /* On iOS, should create autorelease pool when create a new thread
39 | * and release it when the thread end.
40 | */
41 | class CC_DLL CCThread
42 | {
43 | public:
44 | CCThread() : m_pAutoreasePool(0) {}
45 | ~CCThread();
46 |
47 | void createAutoreleasePool();
48 |
49 | private:
50 | void *m_pAutoreasePool;
51 | };
52 |
53 | // end of platform group
54 | /// @}
55 |
56 | NS_CC_END
57 |
58 | #endif // __CC_PLATFORM_THREAD_H__
59 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/cocos2dx/include/ccTypeInfo.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | Copyright (c) 2012 cocos2d-x.org
3 |
4 | http://www.cocos2d-x.org
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in
14 | all copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | THE SOFTWARE.
23 | ****************************************************************************/
24 |
25 | #ifndef cocos2dx_ccTypeInfo_h
26 | #define cocos2dx_ccTypeInfo_h
27 |
28 | #include "platform/CCPlatformMacros.h"
29 |
30 | #include
31 | #include
32 | #include
33 |
34 | NS_CC_BEGIN
35 |
36 | class TypeInfo
37 | {
38 | public:
39 | virtual long getClassTypeInfo() = 0;
40 | };
41 |
42 | static inline unsigned int getHashCodeByString(const char *key)
43 | {
44 | unsigned int len = strlen(key);
45 | const char *end=key+len;
46 | unsigned int hash;
47 |
48 | for (hash = 0; key < end; key++)
49 | {
50 | hash *= 16777619;
51 | hash ^= (unsigned int) (unsigned char) toupper(*key);
52 | }
53 | return (hash);
54 | }
55 | NS_CC_END
56 |
57 | #endif
58 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/cocos2dx/platform/ios/AccelerometerDelegateWrapper.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | Copyright (c) 2010 cocos2d-x.org
3 |
4 | http://www.cocos2d-x.org
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in
14 | all copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | THE SOFTWARE.
23 | ****************************************************************************/
24 |
25 | #import
26 | #import "CCAccelerometerDelegate.h"
27 | #import
28 |
29 | @interface AccelerometerDispatcher : NSObject
30 | {
31 | cocos2d::CCAccelerometerDelegate *delegate_;
32 | cocos2d::CCAcceleration *acceleration_;
33 | }
34 |
35 | @property(readwrite) cocos2d::CCAccelerometerDelegate *delegate_;
36 | @property(readwrite) cocos2d::CCAcceleration *acceleration_;
37 |
38 | + (id) sharedAccelerometerDispather;
39 | - (id) init;
40 | - (void) addDelegate: (cocos2d::CCAccelerometerDelegate *) delegate;
41 | - (void) setAccelerometerInterval:(float)interval;
42 |
43 | @end
44 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/cocos2dx/platform/ios/CCEGLView.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | Copyright (c) 2010 cocos2d-x.org
3 |
4 | http://www.cocos2d-x.org
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in
14 | all copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | THE SOFTWARE.
23 | ****************************************************************************/
24 |
25 | #ifndef __CC_EGLVIEW_IPHONE_H__
26 | #define __CC_EGLVIEW_IPHONE_H__
27 |
28 | #include "platform/CCCommon.h"
29 | #include "platform/CCEGLViewProtocol.h"
30 |
31 | NS_CC_BEGIN
32 |
33 |
34 |
35 | class CC_DLL CCEGLView : public CCEGLViewProtocol
36 | {
37 | public:
38 | CCEGLView();
39 | ~CCEGLView();
40 |
41 | virtual bool isOpenGLReady();
42 | virtual bool setContentScaleFactor(float contentScaleFactor);
43 |
44 | // keep compatible
45 | virtual void end();
46 | virtual void swapBuffers();
47 |
48 | virtual void setIMEKeyboardState(bool bOpen);
49 |
50 | static CCEGLView* sharedOpenGLView();
51 |
52 | };
53 |
54 | NS_CC_END
55 |
56 | #endif // end of __CC_EGLVIEW_IPHONE_H__
57 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/cocos2dx/platform/CCAccelerometerDelegate.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | Copyright (c) 2010 cocos2d-x.org
3 |
4 | http://www.cocos2d-x.org
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in
14 | all copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | THE SOFTWARE.
23 | ****************************************************************************/
24 |
25 | #ifndef __CCACCELEROMETER_DELEGATE_H__
26 | #define __CCACCELEROMETER_DELEGATE_H__
27 |
28 | #include "CCCommon.h"
29 |
30 | NS_CC_BEGIN
31 | /**
32 | @brief The device accelerometer reports values for each axis in units of g-force
33 | */
34 | typedef struct
35 | {
36 | double x;
37 | double y;
38 | double z;
39 |
40 | double timestamp;
41 | } CCAcceleration;
42 |
43 | /**
44 | @brief
45 | The CCAccelerometerDelegate defines a single method for
46 | receiving acceleration-related data from the system.
47 | */
48 | class CC_DLL CCAccelerometerDelegate
49 | {
50 | public:
51 | virtual void didAccelerate(CCAcceleration* pAccelerationValue) {CC_UNUSED_PARAM(pAccelerationValue);}
52 | };
53 |
54 | NS_CC_END
55 |
56 | #endif
57 |
--------------------------------------------------------------------------------
/MyMoonWarrior/ios/RootViewController.mm:
--------------------------------------------------------------------------------
1 | //
2 | // MyMoonWarriorAppController.h
3 | // MyMoonWarrior
4 | //
5 | // Created by cesc on 13-3-2.
6 | // Copyright __MyCompanyName__ 2013年. All rights reserved.
7 | //
8 |
9 | #import "RootViewController.h"
10 |
11 |
12 | @implementation RootViewController
13 |
14 | /*
15 | // The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad.
16 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
17 | if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) {
18 | // Custom initialization
19 | }
20 | return self;
21 | }
22 | */
23 |
24 | /*
25 | // Implement loadView to create a view hierarchy programmatically, without using a nib.
26 | - (void)loadView {
27 | }
28 | */
29 |
30 | /*
31 | // Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
32 | - (void)viewDidLoad {
33 | [super viewDidLoad];
34 | }
35 |
36 | */
37 | // Override to allow orientations other than the default portrait orientation.
38 | // This method is deprecated on ios6
39 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
40 | return UIInterfaceOrientationIsLandscape( interfaceOrientation );
41 | }
42 |
43 | // For ios6, use supportedInterfaceOrientations & shouldAutorotate instead
44 | - (NSUInteger) supportedInterfaceOrientations{
45 | #ifdef __IPHONE_6_0
46 | return UIInterfaceOrientationMaskLandscape;
47 | #endif
48 | }
49 |
50 | - (BOOL) shouldAutorotate {
51 | return NO;
52 | }
53 |
54 | - (void)didReceiveMemoryWarning {
55 | // Releases the view if it doesn't have a superview.
56 | [super didReceiveMemoryWarning];
57 |
58 | // Release any cached data, images, etc that aren't in use.
59 | }
60 |
61 | - (void)viewDidUnload {
62 | [super viewDidUnload];
63 | // Release any retained subviews of the main view.
64 | // e.g. self.myOutlet = nil;
65 | }
66 |
67 |
68 | - (void)dealloc {
69 | [super dealloc];
70 | }
71 |
72 |
73 | @end
74 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/cocos2dx/kazmath/include/kazmath/GL/mat4stack.h:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2008, Luke Benstead.
3 | All rights reserved.
4 |
5 | Redistribution and use in source and binary forms, with or without modification,
6 | are permitted provided that the following conditions are met:
7 |
8 | * Redistributions of source code must retain the above copyright notice,
9 | this list of conditions and the following disclaimer.
10 | * Redistributions in binary form must reproduce the above copyright notice,
11 | this list of conditions and the following disclaimer in the documentation
12 | and/or other materials provided with the distribution.
13 |
14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
18 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
21 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 | */
25 |
26 | #ifndef C_STACK_H_INCLUDED
27 | #define C_STACK_H_INCLUDED
28 |
29 | #include "../mat4.h"
30 |
31 | typedef struct km_mat4_stack {
32 | int capacity; //The total item capacity
33 | int item_count; //The number of items
34 | kmMat4* top;
35 | kmMat4* stack;
36 | } km_mat4_stack;
37 |
38 | #ifdef __cplusplus
39 | extern "C" {
40 | #endif
41 |
42 | void km_mat4_stack_initialize(km_mat4_stack* stack);
43 | void km_mat4_stack_push(km_mat4_stack* stack, const kmMat4* item);
44 | void km_mat4_stack_pop(km_mat4_stack* stack, kmMat4* pOut);
45 | void km_mat4_stack_release(km_mat4_stack* stack);
46 |
47 | #ifdef __cplusplus
48 | }
49 | #endif
50 |
51 | #endif // C_STACK_H_INCLUDED
52 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/extensions/GUI/CCControlExtension/CCInvocation.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2012 cocos2d-x.org
3 | * http://www.cocos2d-x.org
4 | *
5 | * Permission is hereby granted, free of charge, to any person obtaining a copy
6 | * of this software and associated documentation files (the "Software"), to deal
7 | * in the Software without restriction, including without limitation the rights
8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | * copies of the Software, and to permit persons to whom the Software is
10 | * furnished to do so, subject to the following conditions:
11 | *
12 | * The above copyright notice and this permission notice shall be included in
13 | * all copies or substantial portions of the Software.
14 | *
15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | * THE SOFTWARE.
22 | *
23 | *
24 | * Converted to c++ / cocos2d-x by Angus C
25 | */
26 |
27 | #include "CCInvocation.h"
28 |
29 | NS_CC_EXT_BEGIN
30 |
31 | CCInvocation* CCInvocation::create(CCObject* target, SEL_CCControlHandler action, CCControlEvent controlEvent)
32 | {
33 | CCInvocation* pRet = new CCInvocation(target, action, controlEvent);
34 | if (pRet != NULL)
35 | {
36 | pRet->autorelease();
37 | }
38 | return pRet;
39 | }
40 |
41 | CCInvocation::CCInvocation(CCObject* target, SEL_CCControlHandler action, CCControlEvent controlEvent)
42 | {
43 | m_target=target;
44 | m_action=action;
45 | m_controlEvent=controlEvent;
46 | }
47 |
48 | void CCInvocation::invoke(CCObject* sender)
49 | {
50 | if (m_target && m_action)
51 | {
52 | (m_target->*m_action)(sender, m_controlEvent);
53 | }
54 | }
55 |
56 | NS_CC_EXT_END
57 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/cocos2dx/support/CCVertex.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | Copyright (c) 2010-2012 cocos2d-x.org
3 | Copyright (c) 2011 ForzeField Studios S.L
4 |
5 | http://www.cocos2d-x.org
6 |
7 | Permission is hereby granted, free of charge, to any person obtaining a copy
8 | of this software and associated documentation files (the "Software"), to deal
9 | in the Software without restriction, including without limitation the rights
10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 | copies of the Software, and to permit persons to whom the Software is
12 | furnished to do so, subject to the following conditions:
13 |
14 | The above copyright notice and this permission notice shall be included in
15 | all copies or substantial portions of the Software.
16 |
17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 | THE SOFTWARE.
24 | ****************************************************************************/
25 | #ifndef __CCVERTEX_H__
26 | #define __CCVERTEX_H__
27 |
28 | #include "ccTypes.h"
29 |
30 | NS_CC_BEGIN
31 |
32 | /**
33 | * @addtogroup data_structures
34 | * @{
35 | */
36 |
37 | /** @file CCVertex.h */
38 |
39 | /** converts a line to a polygon */
40 | void CC_DLL ccVertexLineToPolygon(CCPoint *points, float stroke, ccVertex2F *vertices, unsigned int offset, unsigned int nuPoints);
41 |
42 | /** returns whether or not the line intersects */
43 | bool CC_DLL ccVertexLineIntersect(float Ax, float Ay,
44 | float Bx, float By,
45 | float Cx, float Cy,
46 | float Dx, float Dy, float *T);
47 |
48 | // end of data_structures group
49 | /// @}
50 |
51 | NS_CC_END
52 |
53 | #endif /* __CCVERTEX_H__ */
54 |
55 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/cocos2dx/effects/CCGrabber.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | Copyright (c) 2010-2012 cocos2d-x.org
3 | Copyright (c) 2009 On-Core
4 |
5 | http://www.cocos2d-x.org
6 |
7 | Permission is hereby granted, free of charge, to any person obtaining a copy
8 | of this software and associated documentation files (the "Software"), to deal
9 | in the Software without restriction, including without limitation the rights
10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 | copies of the Software, and to permit persons to whom the Software is
12 | furnished to do so, subject to the following conditions:
13 |
14 | The above copyright notice and this permission notice shall be included in
15 | all copies or substantial portions of the Software.
16 |
17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 | THE SOFTWARE.
24 | ****************************************************************************/
25 | #ifndef __EFFECTS_CCGRABBER_H__
26 | #define __EFFECTS_CCGRABBER_H__
27 |
28 | #include "CCConfiguration.h"
29 | #include "cocoa/CCObject.h"
30 | #include "CCGL.h"
31 |
32 | NS_CC_BEGIN
33 |
34 | class CCTexture2D;
35 |
36 | /**
37 | * @addtogroup effects
38 | * @{
39 | */
40 |
41 | /** FBO class that grabs the the contents of the screen */
42 | class CCGrabber : public CCObject
43 | {
44 | public:
45 | CCGrabber(void);
46 | ~CCGrabber(void);
47 |
48 | void grab(CCTexture2D *pTexture);
49 | void beforeRender(CCTexture2D *pTexture);
50 | void afterRender(CCTexture2D *pTexture);
51 |
52 | protected:
53 | GLuint m_fbo;
54 | GLint m_oldFBO;
55 | GLfloat m_oldClearColor[4];
56 | };
57 |
58 | // end of effects group
59 | /// @}
60 |
61 | NS_CC_END
62 |
63 | #endif // __EFFECTS_CCGRABBER_H__
64 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/cocos2dx/kazmath/include/kazmath/aabb.h:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2008, Luke Benstead.
3 | All rights reserved.
4 |
5 | Redistribution and use in source and binary forms, with or without modification,
6 | are permitted provided that the following conditions are met:
7 |
8 | * Redistributions of source code must retain the above copyright notice,
9 | this list of conditions and the following disclaimer.
10 | * Redistributions in binary form must reproduce the above copyright notice,
11 | this list of conditions and the following disclaimer in the documentation
12 | and/or other materials provided with the distribution.
13 |
14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
18 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
21 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 | */
25 |
26 | #ifndef KAZMATH_AABB_H_INCLUDED
27 | #define KAZMATH_AABB_H_INCLUDED
28 |
29 | #include "platform/CCPlatformMacros.h"
30 | #include "vec3.h"
31 | #include "utility.h"
32 |
33 | #ifdef __cplusplus
34 | extern "C" {
35 | #endif
36 |
37 | /**
38 | * A structure that represents an axis-aligned
39 | * bounding box.
40 | */
41 | typedef struct kmAABB {
42 | kmVec3 min; /** The max corner of the box */
43 | kmVec3 max; /** The min corner of the box */
44 | } kmAABB;
45 |
46 | CC_DLL const int kmAABBContainsPoint(const kmVec3* pPoint, const kmAABB* pBox);
47 | CC_DLL kmAABB* const kmAABBAssign(kmAABB* pOut, const kmAABB* pIn);
48 | CC_DLL kmAABB* const kmAABBScale(kmAABB* pOut, const kmAABB* pIn, kmScalar s);
49 |
50 | #ifdef __cplusplus
51 | }
52 | #endif
53 |
54 | #endif
55 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/extensions/GUI/CCEditBox/EditBoxImplIOS.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | Copyright (c) 2010-2012 cocos2d-x.org
3 | Copyright (c) 2012 James Chen
4 |
5 | http://www.cocos2d-x.org
6 |
7 | Permission is hereby granted, free of charge, to any person obtaining a copy
8 | of this software and associated documentation files (the "Software"), to deal
9 | in the Software without restriction, including without limitation the rights
10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 | copies of the Software, and to permit persons to whom the Software is
12 | furnished to do so, subject to the following conditions:
13 |
14 | The above copyright notice and this permission notice shall be included in
15 | all copies or substantial portions of the Software.
16 |
17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 | THE SOFTWARE.
24 | ****************************************************************************/
25 |
26 | #import
27 |
28 | @interface CustomUITextField : UITextField
29 | {
30 | }
31 |
32 | @end
33 |
34 |
35 | @interface EditBoxImplIOS : NSObject
36 | {
37 | CustomUITextField* textField_;
38 | void* editBox_;
39 | BOOL editState_;
40 | }
41 |
42 | @property(nonatomic, retain) UITextField* textField;
43 | @property(nonatomic, readonly, getter = isEditState) BOOL editState;
44 | @property(nonatomic, assign) void* editBox;
45 |
46 | -(id) initWithFrame: (CGRect) frameRect editBox: (void*) editBox;
47 | -(void) doAnimationWhenKeyboardMoveWithDuration:(float)duration distance:(float)distance;
48 | -(void) setPosition:(CGPoint) pos;
49 | -(void) setContentSize:(CGSize) size;
50 | -(void) visit;
51 | -(void) openKeyboard;
52 | -(void) closeKeyboard;
53 |
54 | @end
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/cocos2dx/kazmath/src/utility.c:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2008, Luke Benstead.
3 | All rights reserved.
4 |
5 | Redistribution and use in source and binary forms, with or without modification,
6 | are permitted provided that the following conditions are met:
7 |
8 | * Redistributions of source code must retain the above copyright notice,
9 | this list of conditions and the following disclaimer.
10 | * Redistributions in binary form must reproduce the above copyright notice,
11 | this list of conditions and the following disclaimer in the documentation
12 | and/or other materials provided with the distribution.
13 |
14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
18 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
21 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 | */
25 |
26 | #include "kazmath/utility.h"
27 |
28 | /**
29 | * Returns the square of s (e.g. s*s)
30 | */
31 | kmScalar kmSQR(kmScalar s) {
32 | return s*s;
33 | }
34 |
35 | /**
36 | * Returns degrees as radians.
37 | */
38 | kmScalar kmDegreesToRadians(kmScalar degrees) {
39 | return degrees * kmPIOver180;
40 | }
41 |
42 | /**
43 | * Returns radians as degrees
44 | */
45 | kmScalar kmRadiansToDegrees(kmScalar radians) {
46 | return radians * kmPIUnder180;
47 | }
48 |
49 | kmScalar kmMin(kmScalar lhs, kmScalar rhs) {
50 | return (lhs < rhs)? lhs : rhs;
51 | }
52 |
53 | kmScalar kmMax(kmScalar lhs, kmScalar rhs) {
54 | return (lhs > rhs)? lhs : rhs;
55 | }
56 |
57 | kmBool kmAlmostEqual(kmScalar lhs, kmScalar rhs) {
58 | return (lhs + kmEpsilon > rhs && lhs - kmEpsilon < rhs);
59 | }
60 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/extensions/GUI/CCScrollView/CCTableViewCell.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | Copyright (c) 2012 cocos2d-x.org
3 | Copyright (c) 2010 Sangwoo Im
4 |
5 | http://www.cocos2d-x.org
6 |
7 | Permission is hereby granted, free of charge, to any person obtaining a copy
8 | of this software and associated documentation files (the "Software"), to deal
9 | in the Software without restriction, including without limitation the rights
10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 | copies of the Software, and to permit persons to whom the Software is
12 | furnished to do so, subject to the following conditions:
13 |
14 | The above copyright notice and this permission notice shall be included in
15 | all copies or substantial portions of the Software.
16 |
17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 | THE SOFTWARE.
24 | ****************************************************************************/
25 |
26 | #ifndef __CCTABLEVIEWCELL_H__
27 | #define __CCTABLEVIEWCELL_H__
28 |
29 | #include "base_nodes/CCNode.h"
30 | #include "CCSorting.h"
31 |
32 | NS_CC_EXT_BEGIN
33 |
34 | /**
35 | * Abstract class for SWTableView cell node
36 | */
37 | class CCTableViewCell: public CCNode, public CCSortableObject
38 | {
39 | public:
40 | CCTableViewCell() {}
41 | /**
42 | * The index used internally by SWTableView and its subclasses
43 | */
44 | unsigned int getIdx();
45 | void setIdx(unsigned int uIdx);
46 | /**
47 | * Cleans up any resources linked to this cell and resets idx property.
48 | */
49 | void reset();
50 |
51 | void setObjectID(unsigned int uIdx);
52 | unsigned int getObjectID();
53 | private:
54 | unsigned int m_uIdx;
55 | };
56 |
57 | NS_CC_EXT_END
58 |
59 | #endif /* __CCTABLEVIEWCELL_H__ */
60 |
--------------------------------------------------------------------------------
/MyMoonWarrior/Classes/utils/Effects.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Effects.cpp
3 | // MyMoonWarrior
4 | //
5 | // Created by cesc on 13-4-14.
6 | //
7 | //
8 |
9 | #include "Effects.h"
10 |
11 | static Effects* instance = NULL;
12 |
13 | Effects* Effects::sharedEffects(){
14 |
15 | if( !instance ){
16 |
17 | instance = new Effects();
18 | }
19 |
20 |
21 | return instance;
22 | }
23 |
24 | // 预加载动画到CCAnimationCache中
25 | void Effects::preLoad(){
26 |
27 | // 将爆炸的plist 和 图片加入到cache中
28 | CCSpriteFrameCache::sharedSpriteFrameCache()->addSpriteFramesWithFile( "explosion.plist" );
29 |
30 | // 创建一个CCAnimation
31 | CCAnimation* boomAnimation = CCAnimation::create();
32 | boomAnimation->setDelayPerUnit( 0.05f );
33 | boomAnimation->setLoops( 1 );
34 |
35 | // 将plist 中的所有图片加入到CCAnimation中
36 | for (int i = 1; i <= 35; i++ ) {
37 |
38 | char str[20] = {0};
39 |
40 | sprintf(str, "explosion_%02d.png",i );
41 |
42 | CCSpriteFrame* pFrame = CCSpriteFrameCache::sharedSpriteFrameCache()->spriteFrameByName( str );
43 |
44 | boomAnimation->addSpriteFrame( pFrame );
45 |
46 | }
47 |
48 |
49 | // 将这个CCAnimation 指针加入到CCAnimationCache中
50 |
51 | CCAnimationCache::sharedAnimationCache()->addAnimation(boomAnimation, "boom" );
52 |
53 |
54 | }
55 |
56 | // 爆炸的效果
57 | void Effects::boom( CCNode* target, CCPoint point ){
58 |
59 | CCSprite* sp = CCSprite::createWithSpriteFrameName( "explosion_01.png" );
60 |
61 | target->addChild( sp,10 );
62 | sp->setPosition( point );
63 |
64 | // 1.从CCanimationcache 中读取爆炸的animation
65 | CCAnimation* boomAnimation = CCAnimationCache::sharedAnimationCache()->animationByName( "boom" );
66 |
67 | CCAnimate* anim = CCAnimate::create( boomAnimation );
68 |
69 | // 2.写一个CCSequence 包含回调
70 | CCCallFuncN* callback = CCCallFuncN::create(sp, callfuncN_selector( Effects::boom_callback));
71 |
72 | CCAction* actions = CCSequence::create( anim,callback,NULL );
73 |
74 | sp->runAction( actions );
75 |
76 |
77 |
78 | }
79 |
80 | void Effects::boom_callback( CCNode* pNode ){
81 |
82 | pNode->removeFromParentAndCleanup( true );
83 | }
84 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/cocos2dx/kazmath/include/kazmath/ray2.h:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2011, Luke Benstead.
3 | All rights reserved.
4 |
5 | Redistribution and use in source and binary forms, with or without modification,
6 | are permitted provided that the following conditions are met:
7 |
8 | * Redistributions of source code must retain the above copyright notice,
9 | this list of conditions and the following disclaimer.
10 | * Redistributions in binary form must reproduce the above copyright notice,
11 | this list of conditions and the following disclaimer in the documentation
12 | and/or other materials provided with the distribution.
13 |
14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
18 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
21 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 | */
25 |
26 | #ifndef RAY_2_H
27 | #define RAY_2_H
28 |
29 | #include "platform/CCPlatformMacros.h"
30 | #include "utility.h"
31 | #include "vec2.h"
32 |
33 | #ifdef __cplusplus
34 | extern "C" {
35 | #endif
36 |
37 | typedef struct kmRay2 {
38 | kmVec2 start;
39 | kmVec2 dir;
40 | } kmRay2;
41 |
42 | CC_DLL void kmRay2Fill(kmRay2* ray, kmScalar px, kmScalar py, kmScalar vx, kmScalar vy);
43 | CC_DLL kmBool kmRay2IntersectLineSegment(const kmRay2* ray, const kmVec2* p1, const kmVec2* p2, kmVec2* intersection);
44 | CC_DLL kmBool kmRay2IntersectTriangle(const kmRay2* ray, const kmVec2* p1, const kmVec2* p2, const kmVec2* p3, kmVec2* intersection, kmVec2* normal_out);
45 | CC_DLL kmBool kmRay2IntersectCircle(const kmRay2* ray, const kmVec2 centre, const kmScalar radius, kmVec2* intersection);
46 |
47 | #ifdef __cplusplus
48 | }
49 | #endif
50 |
51 | #endif
52 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/cocos2dx/platform/ios/CCESRenderer.h:
--------------------------------------------------------------------------------
1 | /*
2 | * cocos2d for iPhone: http://www.cocos2d-iphone.org
3 | *
4 | * Copyright (c) 2010 Ricardo Quesada
5 | * Copyright (c) 2011 Zynga Inc.
6 | *
7 | * Permission is hereby granted, free of charge, to any person obtaining a copy
8 | * of this software and associated documentation files (the "Software"), to deal
9 | * in the Software without restriction, including without limitation the rights
10 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 | * copies of the Software, and to permit persons to whom the Software is
12 | * furnished to do so, subject to the following conditions:
13 | *
14 | * The above copyright notice and this permission notice shall be included in
15 | * all copies or substantial portions of the Software.
16 | *
17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 | * THE SOFTWARE.
24 | *
25 | *
26 | * File autogenerated with Xcode. Adapted for cocos2d needs.
27 | */
28 |
29 | // Only compile this code on iOS. These files should NOT be included on your Mac project.
30 | // But in case they are included, it won't be compiled.
31 | #import "platform/CCPlatformMacros.h"
32 | #import
33 |
34 | #import
35 | #import
36 |
37 | @protocol CCESRenderer
38 |
39 | - (id) initWithDepthFormat:(unsigned int)depthFormat withPixelFormat:(unsigned int)pixelFormat withSharegroup:(EAGLSharegroup*)sharegroup withMultiSampling:(BOOL) multiSampling withNumberOfSamples:(unsigned int) requestedSamples;
40 |
41 | - (BOOL) resizeFromLayer:(CAEAGLLayer *)layer;
42 |
43 | - (EAGLContext*) context;
44 | - (CGSize) backingSize;
45 |
46 | - (unsigned int) colorRenderBuffer;
47 | - (unsigned int) defaultFrameBuffer;
48 | - (unsigned int) msaaFrameBuffer;
49 | - (unsigned int) msaaColorBuffer;
50 | @end
51 |
52 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/cocos2dx/support/TransformUtils.cpp:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | Copyright (c) 2010-2012 cocos2d-x.org
3 | Copyright (c) 2009 Valentin Milea
4 |
5 | http://www.cocos2d-x.org
6 |
7 | Permission is hereby granted, free of charge, to any person obtaining a copy
8 | of this software and associated documentation files (the "Software"), to deal
9 | in the Software without restriction, including without limitation the rights
10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 | copies of the Software, and to permit persons to whom the Software is
12 | furnished to do so, subject to the following conditions:
13 |
14 | The above copyright notice and this permission notice shall be included in
15 | all copies or substantial portions of the Software.
16 |
17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 | THE SOFTWARE.
24 | ****************************************************************************/
25 |
26 | #include "TransformUtils.h"
27 | #include "cocoa/CCAffineTransform.h"
28 |
29 | namespace cocos2d {
30 |
31 | void CGAffineToGL(const CCAffineTransform *t, GLfloat *m)
32 | {
33 | // | m[0] m[4] m[8] m[12] | | m11 m21 m31 m41 | | a c 0 tx |
34 | // | m[1] m[5] m[9] m[13] | | m12 m22 m32 m42 | | b d 0 ty |
35 | // | m[2] m[6] m[10] m[14] | <=> | m13 m23 m33 m43 | <=> | 0 0 1 0 |
36 | // | m[3] m[7] m[11] m[15] | | m14 m24 m34 m44 | | 0 0 0 1 |
37 |
38 | m[2] = m[3] = m[6] = m[7] = m[8] = m[9] = m[11] = m[14] = 0.0f;
39 | m[10] = m[15] = 1.0f;
40 | m[0] = t->a; m[4] = t->c; m[12] = t->tx;
41 | m[1] = t->b; m[5] = t->d; m[13] = t->ty;
42 | }
43 |
44 | void GLToCGAffine(const GLfloat *m, CCAffineTransform *t)
45 | {
46 | t->a = m[0]; t->c = m[4]; t->tx = m[12];
47 | t->b = m[1]; t->d = m[5]; t->ty = m[13];
48 | }
49 |
50 | }//namespace cocos2d
51 |
52 |
--------------------------------------------------------------------------------
/MyMoonWarrior/Classes/layer/ AboutLayer.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // AboutLayer.cpp
3 | // MyMoonWarrior
4 | //
5 | // Created by cesc on 13-3-2.
6 | //
7 | //
8 |
9 | #include " AboutLayer.h"
10 |
11 | #include "WelcomeLayer.h"
12 | AboutLayer::AboutLayer(){}
13 | AboutLayer::~AboutLayer(){}
14 |
15 | bool AboutLayer::init(){
16 |
17 |
18 | bool sRect = false;
19 |
20 | do {
21 | CC_BREAK_IF( !BasicLayer::init() );
22 |
23 |
24 | setupViews();
25 |
26 |
27 | sRect = true;
28 | } while (0);
29 |
30 |
31 | return sRect;
32 | }
33 |
34 |
35 | CCScene* AboutLayer::scene(){
36 |
37 | CCScene* sc = NULL;
38 |
39 | do {
40 | sc = CCScene::create();
41 |
42 | CC_BREAK_IF( !sc );
43 |
44 | AboutLayer* layer = AboutLayer::create();
45 | CC_BREAK_IF( !layer );
46 |
47 | sc->addChild( layer );
48 | } while (0);
49 |
50 | return sc;
51 | }
52 |
53 |
54 |
55 |
56 | void AboutLayer::setupViews(){
57 |
58 | setBackgroundImage( "loading.png" );
59 |
60 | // 加入title
61 | CCSprite* title = CCSprite::create( "menuTitle.png",CCRectMake(0, 34, 130, 38) );
62 |
63 | title->setAnchorPoint( ccp(0.5, 1) );
64 | title->setPosition( ccp( getWinSize().width / 2 ,getWinSize().height -20 ) );
65 | this->addChild( title );
66 | // 加入文字说明
67 |
68 | CCLabelBMFont* pDes = CCLabelBMFont::create( "This Game is recoded by longlingxiu ", "arial-14.fnt" );
69 |
70 | pDes->setPosition( ccp(getWinSize().width / 2, getWinSize().height / 2) );
71 |
72 | this ->addChild(pDes);
73 |
74 |
75 |
76 | CCLabelBMFont* fontOfBack = CCLabelBMFont::create("Go Back", "arial-14.fnt" );
77 |
78 | fontOfBack->setScale(1.5f);
79 |
80 | CCMenuItemLabel* backLabel = CCMenuItemLabel::create(fontOfBack, this, menu_selector(AboutLayer::back_callback));
81 | backLabel->setAnchorPoint( ccp( 0.5, 0 ) );
82 | backLabel->setPosition( ccp( getWinSize().width / 2, 30) );
83 |
84 | CCMenu* menu = CCMenu::create( backLabel, NULL );;
85 | menu->setPosition( CCPointZero );
86 |
87 | this->addChild( menu );
88 |
89 | }
90 |
91 | void AboutLayer::back_callback( CCObject* pSender ){
92 |
93 | CCDirector::sharedDirector()->popScene();
94 | }
95 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/cocos2dx/platform/CCCommon.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | Copyright (c) 2010 cocos2d-x.org
3 |
4 | http://www.cocos2d-x.org
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in
14 | all copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | THE SOFTWARE.
23 | ****************************************************************************/
24 |
25 | #ifndef __CC_COMMON_H__
26 | #define __CC_COMMON_H__
27 |
28 | #include "CCPlatformMacros.h"
29 |
30 | NS_CC_BEGIN
31 |
32 | /**
33 | * @addtogroup platform
34 | * @{
35 | */
36 |
37 | /// The max length of CCLog message.
38 | static const int kMaxLogLen = 16*1024;
39 |
40 | /**
41 | @brief Output Debug message.
42 | */
43 | void CC_DLL CCLog(const char * pszFormat, ...);
44 |
45 | /**
46 | * lua can not deal with ...
47 | */
48 | void CC_DLL CCLuaLog(const char * pszFormat);
49 |
50 | /**
51 | @brief Pop out a message box
52 | */
53 | void CC_DLL CCMessageBox(const char * pszMsg, const char * pszTitle);
54 |
55 | /**
56 | @brief Enum the language type supported now
57 | */
58 | typedef enum LanguageType
59 | {
60 | kLanguageEnglish = 0,
61 | kLanguageChinese,
62 | kLanguageFrench,
63 | kLanguageItalian,
64 | kLanguageGerman,
65 | kLanguageSpanish,
66 | kLanguageRussian,
67 | kLanguageKorean
68 | } ccLanguageType;
69 |
70 | // end of platform group
71 | /// @}
72 |
73 | NS_CC_END
74 |
75 | #endif // __CC_COMMON_H__
76 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/cocos2dx/layers_scenes_transitions_nodes/CCScene.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | Copyright (c) 2010-2012 cocos2d-x.org
3 | Copyright (c) 2008-2010 Ricardo Quesada
4 | Copyright (c) 2011 Zynga Inc.
5 |
6 | http://www.cocos2d-x.org
7 |
8 | Permission is hereby granted, free of charge, to any person obtaining a copy
9 | of this software and associated documentation files (the "Software"), to deal
10 | in the Software without restriction, including without limitation the rights
11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 | copies of the Software, and to permit persons to whom the Software is
13 | furnished to do so, subject to the following conditions:
14 |
15 | The above copyright notice and this permission notice shall be included in
16 | all copies or substantial portions of the Software.
17 |
18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24 | THE SOFTWARE.
25 | ****************************************************************************/
26 |
27 | #ifndef __CCSCENE_H__
28 | #define __CCSCENE_H__
29 |
30 | #include "base_nodes/CCNode.h"
31 |
32 | NS_CC_BEGIN
33 |
34 | /**
35 | * @addtogroup scene
36 | * @{
37 | */
38 |
39 | /** @brief CCScene is a subclass of CCNode that is used only as an abstract concept.
40 |
41 | CCScene an CCNode are almost identical with the difference that CCScene has it's
42 | anchor point (by default) at the center of the screen.
43 |
44 | For the moment CCScene has no other logic than that, but in future releases it might have
45 | additional logic.
46 |
47 | It is a good practice to use and CCScene as the parent of all your nodes.
48 | */
49 | class CC_DLL CCScene : public CCNode
50 | {
51 | public:
52 | CCScene();
53 | virtual ~CCScene();
54 | bool init();
55 | CC_DEPRECATED_ATTRIBUTE static CCScene *node(void);
56 | static CCScene *create(void);
57 | };
58 |
59 | // end of scene group
60 | /// @}
61 |
62 | NS_CC_END
63 |
64 | #endif // __CCSCENE_H__
65 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/cocos2dx/kazmath/src/aabb.c:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2008, Luke Benstead.
3 | All rights reserved.
4 |
5 | Redistribution and use in source and binary forms, with or without modification,
6 | are permitted provided that the following conditions are met:
7 |
8 | * Redistributions of source code must retain the above copyright notice,
9 | this list of conditions and the following disclaimer.
10 | * Redistributions in binary form must reproduce the above copyright notice,
11 | this list of conditions and the following disclaimer in the documentation
12 | and/or other materials provided with the distribution.
13 |
14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
18 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
21 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 | */
25 |
26 | #include "kazmath/aabb.h"
27 |
28 | /**
29 | * Returns KM_TRUE if point is in the specified AABB, returns
30 | * KM_FALSE otherwise.
31 | */
32 | const int kmAABBContainsPoint(const kmVec3* pPoint, const kmAABB* pBox)
33 | {
34 | if(pPoint->x >= pBox->min.x && pPoint->x <= pBox->max.x &&
35 | pPoint->y >= pBox->min.y && pPoint->y <= pBox->max.y &&
36 | pPoint->z >= pBox->min.z && pPoint->z <= pBox->max.z) {
37 | return KM_TRUE;
38 | }
39 |
40 | return KM_FALSE;
41 | }
42 |
43 | /**
44 | * Assigns pIn to pOut, returns pOut.
45 | */
46 | kmAABB* const kmAABBAssign(kmAABB* pOut, const kmAABB* pIn)
47 | {
48 | kmVec3Assign(&pOut->min, &pIn->min);
49 | kmVec3Assign(&pOut->max, &pIn->max);
50 | return pOut;
51 | }
52 |
53 | /**
54 | * Scales pIn by s, stores the resulting AABB in pOut. Returns pOut
55 | */
56 | kmAABB* const kmAABBScale(kmAABB* pOut, const kmAABB* pIn, kmScalar s)
57 | {
58 | assert(0 && "Not implemented");
59 | return 0;
60 | }
61 |
62 |
63 |
64 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/extensions/CCBReader/CCLabelBMFontLoader.cpp:
--------------------------------------------------------------------------------
1 | #include "CCLabelBMFontLoader.h"
2 |
3 |
4 |
5 | NS_CC_EXT_BEGIN
6 |
7 | #define PROPERTY_COLOR "color"
8 | #define PROPERTY_OPACITY "opacity"
9 | #define PROPERTY_BLENDFUNC "blendFunc"
10 | #define PROPERTY_FNTFILE "fntFile"
11 | #define PROPERTY_STRING "string"
12 |
13 | void CCLabelBMFontLoader::onHandlePropTypeColor3(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, ccColor3B pCCColor3B, CCBReader * pCCBReader) {
14 | if(pPropertyName->compare(PROPERTY_COLOR) == 0) {
15 | ((CCLabelBMFont *)pNode)->setColor(pCCColor3B);
16 | } else {
17 | CCNodeLoader::onHandlePropTypeColor3(pNode, pParent, pPropertyName, pCCColor3B, pCCBReader);
18 | }
19 | }
20 |
21 | void CCLabelBMFontLoader::onHandlePropTypeByte(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, unsigned char pByte, CCBReader * pCCBReader) {
22 | if(pPropertyName->compare(PROPERTY_OPACITY) == 0) {
23 | ((CCLabelBMFont *)pNode)->setOpacity(pByte);
24 | } else {
25 | CCNodeLoader::onHandlePropTypeByte(pNode, pParent, pPropertyName, pByte, pCCBReader);
26 | }
27 | }
28 |
29 | void CCLabelBMFontLoader::onHandlePropTypeBlendFunc(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, ccBlendFunc pCCBlendFunc, CCBReader * pCCBReader) {
30 | if(pPropertyName->compare(PROPERTY_BLENDFUNC) == 0) {
31 | ((CCLabelBMFont *)pNode)->setBlendFunc(pCCBlendFunc);
32 | } else {
33 | CCNodeLoader::onHandlePropTypeBlendFunc(pNode, pParent, pPropertyName, pCCBlendFunc, pCCBReader);
34 | }
35 | }
36 |
37 | void CCLabelBMFontLoader::onHandlePropTypeFntFile(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, CCString * pFntFile, CCBReader * pCCBReader) {
38 | if(pPropertyName->compare(PROPERTY_FNTFILE) == 0) {
39 | ((CCLabelBMFont *)pNode)->setFntFile(pFntFile->getCString());
40 | } else {
41 | CCNodeLoader::onHandlePropTypeFntFile(pNode, pParent, pPropertyName, pFntFile, pCCBReader);
42 | }
43 | }
44 |
45 | void CCLabelBMFontLoader::onHandlePropTypeText(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, CCString * pText, CCBReader * pCCBReader) {
46 | if(pPropertyName->compare(PROPERTY_STRING) == 0) {
47 | ((CCLabelBMFont *)pNode)->setString(pText->getCString());
48 | } else {
49 | CCNodeLoader::onHandlePropTypeText(pNode, pParent, pPropertyName, pText, pCCBReader);
50 | }
51 | }
52 |
53 | NS_CC_EXT_END
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/extensions/CCBReader/CCSpriteLoader.cpp:
--------------------------------------------------------------------------------
1 | #include "CCSpriteLoader.h"
2 |
3 | #define PROPERTY_FLIP "flip"
4 | #define PROPERTY_DISPLAYFRAME "displayFrame"
5 | #define PROPERTY_COLOR "color"
6 | #define PROPERTY_OPACITY "opacity"
7 | #define PROPERTY_BLENDFUNC "blendFunc"
8 |
9 | NS_CC_EXT_BEGIN
10 |
11 | void CCSpriteLoader::onHandlePropTypeSpriteFrame(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, CCSpriteFrame * pCCSpriteFrame, CCBReader * pCCBReader) {
12 | if(pPropertyName->compare(PROPERTY_DISPLAYFRAME) == 0) {
13 | ((CCSprite *)pNode)->setDisplayFrame(pCCSpriteFrame);
14 | } else {
15 | CCNodeLoader::onHandlePropTypeSpriteFrame(pNode, pParent, pPropertyName, pCCSpriteFrame, pCCBReader);
16 | }
17 | }
18 |
19 | void CCSpriteLoader::onHandlePropTypeFlip(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, bool * pFlip, CCBReader * pCCBReader) {
20 | if(pPropertyName->compare(PROPERTY_FLIP) == 0) {
21 | ((CCSprite *)pNode)->setFlipX(pFlip[0]);
22 | ((CCSprite *)pNode)->setFlipY(pFlip[1]);
23 | } else {
24 | CCNodeLoader::onHandlePropTypeFlip(pNode, pParent, pPropertyName, pFlip, pCCBReader);
25 | }
26 | }
27 |
28 | void CCSpriteLoader::onHandlePropTypeColor3(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, ccColor3B pCCColor3B, CCBReader * pCCBReader) {
29 | if(pPropertyName->compare(PROPERTY_COLOR) == 0) {
30 | ((CCSprite *)pNode)->setColor(pCCColor3B);
31 | } else {
32 | CCNodeLoader::onHandlePropTypeColor3(pNode, pParent, pPropertyName, pCCColor3B, pCCBReader);
33 | }
34 | }
35 |
36 | void CCSpriteLoader::onHandlePropTypeByte(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, unsigned char pByte, CCBReader * pCCBReader) {
37 | if(pPropertyName->compare(PROPERTY_OPACITY) == 0) {
38 | ((CCSprite *)pNode)->setOpacity(pByte);
39 | } else {
40 | CCNodeLoader::onHandlePropTypeByte(pNode, pParent, pPropertyName, pByte, pCCBReader);
41 | }
42 | }
43 |
44 | void CCSpriteLoader::onHandlePropTypeBlendFunc(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, ccBlendFunc pCCBlendFunc, CCBReader * pCCBReader) {
45 | if(pPropertyName->compare(PROPERTY_BLENDFUNC) == 0) {
46 | ((CCSprite *)pNode)->setBlendFunc(pCCBlendFunc);
47 | } else {
48 | CCNodeLoader::onHandlePropTypeBlendFunc(pNode, pParent, pPropertyName, pCCBlendFunc, pCCBReader);
49 | }
50 | }
51 |
52 | NS_CC_EXT_END
53 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/cocos2dx/kazmath/include/kazmath/GL/matrix.h:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2008, Luke Benstead.
3 | All rights reserved.
4 |
5 | Redistribution and use in source and binary forms, with or without modification,
6 | are permitted provided that the following conditions are met:
7 |
8 | * Redistributions of source code must retain the above copyright notice,
9 | this list of conditions and the following disclaimer.
10 | * Redistributions in binary form must reproduce the above copyright notice,
11 | this list of conditions and the following disclaimer in the documentation
12 | and/or other materials provided with the distribution.
13 |
14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
18 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
21 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 | */
25 |
26 | #ifndef KM_GL_MATRIX_H_INCLUDED
27 | #define KM_GL_MATRIX_H_INCLUDED
28 |
29 | #include "platform/CCPlatformMacros.h"
30 |
31 | #define KM_GL_MODELVIEW 0x1700
32 | #define KM_GL_PROJECTION 0x1701
33 | #define KM_GL_TEXTURE 0x1702
34 |
35 | typedef unsigned int kmGLEnum;
36 |
37 | #include "../mat4.h"
38 | #include "../vec3.h"
39 |
40 | #ifdef __cplusplus
41 | extern "C" {
42 | #endif
43 |
44 | void CC_DLL kmGLFreeAll(void);
45 | void CC_DLL kmGLPushMatrix(void);
46 | void CC_DLL kmGLPopMatrix(void);
47 | void CC_DLL kmGLMatrixMode(kmGLEnum mode);
48 | void CC_DLL kmGLLoadIdentity(void);
49 | void CC_DLL kmGLLoadMatrix(const kmMat4* pIn);
50 | void CC_DLL kmGLMultMatrix(const kmMat4* pIn);
51 | void CC_DLL kmGLTranslatef(float x, float y, float z);
52 | void CC_DLL kmGLRotatef(float angle, float x, float y, float z);
53 | void CC_DLL kmGLScalef(float x, float y, float z);
54 | void CC_DLL kmGLGetMatrix(kmGLEnum mode, kmMat4* pOut);
55 |
56 | #ifdef __cplusplus
57 | }
58 | #endif
59 |
60 | #endif // MATRIX_H_INCLUDED
61 |
--------------------------------------------------------------------------------
/MyMoonWarrior/libs/cocos2dx/touch_dispatcher/CCTouch.cpp:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | Copyright (c) 2010 cocos2d-x.org
3 |
4 | http://www.cocos2d-x.org
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in
14 | all copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | THE SOFTWARE.
23 | ****************************************************************************/
24 |
25 | #include "support/CCPointExtension.h"
26 | #include "CCTouch.h"
27 | #include "CCDirector.h"
28 |
29 | NS_CC_BEGIN
30 |
31 | // returns the current touch location in screen coordinates
32 | CCPoint CCTouch::getLocationInView() const
33 | {
34 | return m_point;
35 | }
36 |
37 | // returns the current previous location in screen coordinates
38 | CCPoint CCTouch::getPreviousLocationInView() const
39 | {
40 | return m_prevPoint;
41 | }
42 |
43 | // returns the current touch location in OpenGL coordinates
44 | CCPoint CCTouch::getLocation() const
45 | {
46 | return CCDirector::sharedDirector()->convertToGL(m_point);
47 | }
48 |
49 | // returns the previous touch location in OpenGL coordinates
50 | CCPoint CCTouch::getPreviousLocation() const
51 | {
52 | return CCDirector::sharedDirector()->convertToGL(m_prevPoint);
53 | }
54 |
55 | // returns the delta position between the current location and the previous location in OpenGL coordinates
56 | CCPoint CCTouch::getDelta() const
57 | {
58 | return ccpSub(getLocation(), getPreviousLocation());
59 | }
60 |
61 | NS_CC_END
--------------------------------------------------------------------------------