前情提要:飞机大战第三篇 实现敌机与爆炸
如下:
新建类----->Enemy + Boom
第一步:敌机类
Enemy.h
#include <stdio.h>
#include "cocos2d.h"
USING_NS_CC;
class Enemy:public Node
{
public:
CREATE_FUNC(Enemy);
int type;
int hp;
int ex,ey;
int toolID;//道具 0 不含 1 加血 2 炸雷 3 激光 4 散弹
Sprite * eSprite;
bool init();
static Enemy * createEnemy(int type,int x,int y);
void moveTo(int x,int y);
};
Enemy.cpp