OLD | NEW |
1 // Copyright (c) 2013 The Native Client Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 #ifndef GAMEPLAY_SCENE_H | 4 #ifndef GAMEPLAY_SCENE_H_ |
5 #define GAMEPLAY_SCENE_H | 5 #define GAMEPLAY_SCENE_H_ |
6 | 6 |
7 #include "cocos2d.h" | 7 #include "cocos2d.h" |
8 | 8 |
9 USING_NS_CC; | 9 USING_NS_CC; |
10 | 10 |
11 class Gameplay : public CCLayerColor | 11 /** |
12 { | 12 * Main gameplay scene containing the physics layer |
| 13 * that the user can interact with and a UI layer over |
| 14 * the top for menus. |
| 15 */ |
| 16 class Gameplay : public CCScene { |
13 public: | 17 public: |
14 Gameplay(); | 18 Gameplay() {} |
| 19 ~Gameplay() {} |
| 20 CREATE_FUNC(Gameplay); |
| 21 virtual bool init(); |
| 22 void Restart(); |
| 23 static CCScene* scene(); |
| 24 }; |
15 | 25 |
16 ~Gameplay(); | 26 /** |
17 | 27 * UI layer for menus. |
| 28 */ |
| 29 class UILayer : public CCLayer { |
| 30 public: |
| 31 UILayer() {} |
| 32 ~UILayer() {} |
| 33 CREATE_FUNC(UILayer); |
18 virtual bool init(); | 34 virtual bool init(); |
19 | 35 |
20 static CCScene* scene(); | 36 private: |
21 | 37 // menu callbacks |
22 CREATE_FUNC(Gameplay); | 38 void Restart(CCObject* sender); |
23 | 39 void Exit(CCObject* sender); |
24 virtual void ccTouchesEnded(CCSet* touches, CCEvent* event); | |
25 protected: | |
26 void updateGame(float dt); | |
27 }; | 40 }; |
28 | 41 |
29 #endif // !GAMEPLAY_SCENE_H | 42 #endif // !GAMEPLAY_SCENE_H_ |
OLD | NEW |