-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGameSceneScene.h
166 lines (117 loc) · 3.74 KB
/
GameSceneScene.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
#ifndef __GameScene_SCENE_H__
#define __GameScene_SCENE_H__
#pragma warning(disable:4996)
#include "cocos2d.h"
#include"Player.h"
#include"Route.h"
#include"Control.h"
#include"Ui.h"
#include"PopupLayer.h"
USING_NS_CC;
class GameScene : public cocos2d::Layer
{
public:
// there's no 'id' in cpp, so we recommend returning the class instance pointer
static cocos2d::Scene* CreateScene();
// Here's a difference. Method 'init' in cocos2d-x returns bool, instead of returning 'id' in cocos2d-iphone
virtual bool Init();
// implement the "static Create()" method manually
CREATE_FUNC(GameScene);
//Get the coordinate in the map where the character can move to
void GetWaygild();
//Acquire isWalk
bool** IsWalk();
//Returns the container of step marker
static Vector<Sprite*>* GetStepImage(){ return step_image; };
//Acquire a container of characters
static Vector<Player*>* GetPlayers(){ return players; };
//Acquire the character number
static int GetPlayerNumber(){ return playerNumber; };
//Set the character number
static void SetPlayerNumber(int t){ playerNumber = t; };
//Set the map type
static void SetMap_type(int i){ map_type = i; };
// True to indicate the place accessible,false otherwise
static bool** isWalk;
//Acquire the Layer"Land"
static TMXLayer* GetLandLayer(){ return land; };
//Acquire the map
static TMXTiledMap* GetMap(){ return map; };
//Display a dialog to ask whether to purchase estates
static void show_buy_land_dialog(int);
static float buy_land_x;
static float buy_land_y;
//Update the character's money
static void UpdateMoney(Player*, int money);
//Add all sorts of game resources
void AddInfor(float);
//Acquire the rows and columns of the map
static int GetRowCount(){ return rowCount; };
static int GetColCount(){ return colCount; };
//Get the ID of the vacant land
static int GetLand_id(){ return land_id; };
//Acquire the Go button
static Sprite* GetGo(){ return Go; };
//Aquire the ID where there are question marks
static int GetQuesMark_id(){ return quesMark_id; };
//Acuire the container of location pictures
static Vector<Sprite*>* GetLocation_image(){ return location_image; };
//Acquire the dialog of lottery publishing
static PopupLayer* GetDialogLottery(){ return dialogLottery; };
//Add progress timer
void AddProgressTimer();
//Update the progress timer
void Update(float);
private:
Sprite* progressBgSprite;
ProgressTimer* progress1;
Label* numsTTF;
static int land_id;
static int playerNumber;
static Vector<Player*>*players;
Size visibleSize;
static TMXTiledMap* map;
//The player
Player* player1;
static Vector<Sprite*> * playerImg;
//The width and height of a single tile
float tileWidth;
float tileHeigh;
std::vector<Vec2> point;
static Vector<Sprite*>* step_image;
static PopupLayer* dialog;
static PopupLayer* dialogLottery;
//Vacant land
static TMXLayer* land;
static TMXLayer* quesMark;
static int quesMark_id;
void reg_notification_Observe();
void ReceivedMsg(Object*);
static Vector<Sprite*>area_land;
static Layer* final_layer;
static int rowCount;
static int colCount;
static Sprite* Go;
static Vector<Sprite*>* location_image;
static int map_type;
void AddFinal_layer();
void Add_location_image();
Player* GetId(int ID);
int AreaLandPay(float x, float y, Player*, int id1, int id2, int id3);
//Add map
void Addmap(int type);
//Add players images
void AddPlayerImg();
//Add the info of the characters
void AddPlayerInformation(int number);
//Add players of number 'number'
void AddPlayer(int number);
//Add dice to Layer*
void AddDice(Layer*);
void SetIswalk();
void AddStepImage();
void AddDialog();
void AddDialoglottery();
void BuyLand(Node*);
};
#endif // __GameScene_SCENE_H__