-
Notifications
You must be signed in to change notification settings - Fork 11
/
GlobalDefine.h
61 lines (51 loc) · 2.1 KB
/
GlobalDefine.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*!
* \file GlobalDefine.h
* \date 2015/05/14 12:47
*
* \author SuooL
* Contact: [email protected]
*
* \brief 全局宏定义
*
* TODO: long description
*
* \note
*/
#ifndef __GlobalDefine__H__
#define __GlobalDefine__H__
#include "cocos2d.h"
#include "SimpleAudioEngine.h"
USING_NS_CC;
using namespace CocosDenshion;
#define WINSIZE Director::getInstance()->getWinSize()
#define setIntToXML UserDefault::getInstance()->setIntegerForKey
#define setFloatToXML UserDefault::getInstance()->setFloatForKey
#define setBoolToXML UserDefault::getInstance()->setBoolForKey
#define getIntFromXML UserDefault::getInstance()->getIntegerForKey
#define getFloatFromXML UserDefault::getInstance()->getFloatForKey
#define getBoolFromXML UserDefault::getInstance()->getBoolForKey
#define SOUND_KEY "soundClose" // 背景音效
#define MUSIC_KEY "musicClose" // 背景音乐
#define SOUNDVOL "soundVolume" // 音效音量
#define MUSICVOL "musicVolume" // 音乐音量
#define EXP_KEY "heroCurrentExp" // 英雄当前经验
#define GAMELEVEL_KEY "gameLevel" // 当前关卡
#define HEROLEVEL_KEY "heroLevel" // 当前等级
#define HEROCOIN_KEY "heroCoin" // 英雄金币
#define HEROENERGY_KEY "heroEnergy" // 英雄体力
#define HEROHP_KEY "heroHP" // 英雄血量
#define HEROMP_KEY "heroMP" // 英雄能量
#define HEROAPOWER_KEY "heroAPower" // 英雄普攻伤害
#define HEROABILITY_KEY "heroAbility" // 英雄能力等级
#define SELECTGATE "selectGate" // 选择的关卡
#define GATEONE "gateOne" // 第一关
#define GATETWO "gateTwo" // 第二关
#define GATETHREE "gateThree" // 第三关
#define GAMEOVER "gameOver" // 游戏结束结果
#define aduioEngine SimpleAudioEngine::getInstance()
#define PLAYEFFECT if (getBoolFromXML(SOUND_KEY)) \
{\
aduioEngine->setEffectsVolume(getFloatFromXML(SOUNDVOL));\
aduioEngine->playEffect("Sound/button.wav");\
}
#endif