HelloWorldScene.h
| 1 |
#ifndef __HELLOWORLD_SCENE_H__
|
|---|---|
| 2 |
#define __HELLOWORLD_SCENE_H__
|
| 3 |
|
| 4 |
#include "cocos2d.h" |
| 5 |
#include "CCLightning.h" |
| 6 |
|
| 7 |
#define LIGHTNING_MAX 4 |
| 8 |
|
| 9 |
class HelloWorld : public cocos2d::CCLayer |
| 10 |
{
|
| 11 |
public:
|
| 12 |
// Here's a difference. Method 'init' in cocos2d-x returns bool, instead of returning 'id' in cocos2d-iphone
|
| 13 |
virtual bool init();
|
| 14 |
|
| 15 |
// there's no 'id' in cpp, so we recommand to return the exactly class pointer
|
| 16 |
static cocos2d::CCScene* scene();
|
| 17 |
|
| 18 |
// implement the "static node()" method manually
|
| 19 |
LAYER_NODE_FUNC(HelloWorld); |
| 20 |
|
| 21 |
cocos2d::CCSprite* m_left; |
| 22 |
cocos2d::CCSprite* m_right; |
| 23 |
cocos2d::CCLightning* m_lightning[LIGHTNING_MAX]; |
| 24 |
|
| 25 |
void updateLightning(cocos2d::ccTime dt);
|
| 26 |
}; |
| 27 |
|
| 28 |
#endif // __HELLOWORLD_SCENE_H__ |