| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium 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 /** | 11 /** |
| 12 * Main gameplay scene containing the physics layer | 12 * Main gameplay scene containing the physics layer |
| 13 * that the user can interact with and a UI layer over | 13 * that the user can interact with and a UI layer over |
| 14 * the top for menus. | 14 * the top for menus. |
| 15 */ | 15 */ |
| 16 class Gameplay : public CCScene { | 16 class GameplayScene : public CCScene { |
| 17 public: | 17 public: |
| 18 Gameplay() {} | 18 GameplayScene() {} |
| 19 ~Gameplay() {} | 19 ~GameplayScene() {} |
| 20 CREATE_FUNC(Gameplay); | 20 // add static create() method which encapsulates new + init |
| 21 CREATE_FUNC(GameplayScene); |
| 21 virtual bool init(); | 22 virtual bool init(); |
| 22 void Restart(); | 23 void Restart(); |
| 23 static CCScene* scene(); | |
| 24 }; | 24 }; |
| 25 | 25 |
| 26 /** | 26 /** |
| 27 * UI layer for menus. | 27 * UI layer for displaying menu and information overlays on |
| 28 * top of the running game. |
| 28 */ | 29 */ |
| 29 class UILayer : public CCLayer { | 30 class UILayer : public CCLayer { |
| 30 public: | 31 public: |
| 31 UILayer() {} | 32 UILayer() {} |
| 32 ~UILayer() {} | 33 ~UILayer() {} |
| 34 // add static create() method which encapsulates new + init |
| 33 CREATE_FUNC(UILayer); | 35 CREATE_FUNC(UILayer); |
| 34 virtual bool init(); | 36 virtual bool init(); |
| 35 | 37 |
| 36 private: | 38 private: |
| 37 // menu callbacks | 39 // menu callbacks |
| 38 void Restart(CCObject* sender); | 40 void Restart(CCObject* sender); |
| 39 void Exit(CCObject* sender); | 41 void Exit(CCObject* sender); |
| 40 }; | 42 }; |
| 41 | 43 |
| 42 #endif // !GAMEPLAY_SCENE_H_ | 44 #endif // GAMEPLAY_SCENE_H_ |
| OLD | NEW |