Files
wnmj/Classes/Games/13S/13S_GameOverAni.h
2026-02-13 14:34:15 +08:00

61 lines
1.3 KiB
C++
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#pragma once
#include "cocos2d.h"
#include <vector>
#include "Types.h"
USING_NS_CC;
using namespace std;
#define BombToGun 50 //定义枪和枪火的距离;
#define FadeOutTime 0.5 //淡出时间;
#define DanHenPadding 30 //弹痕间距;
#define GunTime 0.1 //打枪时间;
struct tagSSSGunInfo
{
Vec2 ptPos; //位置坐标;
uint16 wViewID; //用户椅子视图;
uint8 cbGender; //性别;
int nScore; //积分;
};
struct tagSSSTwoGunInfos
{
tagSSSGunInfo* pWinnerInfo;
tagSSSGunInfo* pLoserInfo;
bool isPlayed;
tagSSSTwoGunInfos()
{
isPlayed = false;
pWinnerInfo = NULL;
pLoserInfo = NULL;
}
};
//使用此类时需调用其create方法然后将其添加进父节点进而调用showAnimation方法;
class CGameOverAni : public Node
{
public:
CGameOverAni();
~CGameOverAni();
virtual bool init();
//根据赢家、输家坐标和椅子号播放打枪动画;
void showAnimation(const std::function<void(tagSSSTwoGunInfos*)>& fnCallback);
void addGunPlay(tagSSSTwoGunInfos* pTwoGunInfo);
//释放指针;
bool deleteInfo(tagSSSTwoGunInfos* pInfo);
bool eraseInfo(int index);
//判断是否已经存在打枪者和被打枪者,避免重复;
bool isExist(int winId,int loseId);
tagSSSTwoGunInfos* getNoPlayInfo();
CREATE_FUNC(CGameOverAni);
private:
Animation* m_pAnimation;
bool m_bIsPlaying;
vector<tagSSSTwoGunInfos*> m_VecGunInfos;
};