Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(661)

Side by Side Diff: nacltoons/src/physics_layer.h

Issue 12220140: [nacltoons] Cleanup initial game code. (Closed) Base URL: https://nativeclient-sdk.googlecode.com/svn/trunk/src
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 PHYSICS_LAYER_H_ 4 #ifndef PHYSICS_LAYER_H_
5 #define PHYSICS_LAYER_H_ 5 #define PHYSICS_LAYER_H_
6 6
7 #include "cocos2d.h" 7 #include "cocos2d.h"
8 #include "Box2D/Box2D.h" 8 #include "Box2D/Box2D.h"
9 9
10 USING_NS_CC; 10 USING_NS_CC;
11 11
12 /** 12 /**
13 * Physics layer that the user interacts with. 13 * Physics layer that the user interacts with.
14 */ 14 */
15 class PhysicsLayer : public CCLayerColor { 15 class PhysicsLayer : public CCLayerColor {
16 public: 16 public:
17 PhysicsLayer() {} 17 PhysicsLayer() {}
18 ~PhysicsLayer(); 18 ~PhysicsLayer();
19 // add static create() method which encapsulates new + init
19 CREATE_FUNC(PhysicsLayer); 20 CREATE_FUNC(PhysicsLayer);
20 virtual bool init(); 21 virtual bool init();
21 virtual void ccTouchesEnded(CCSet* touches, CCEvent* event); 22 virtual void ccTouchesEnded(CCSet* touches, CCEvent* event);
22 23
23 private: 24 private:
24 void AddNewSpriteAtPosition(CCPoint p); 25 void AddNewSpriteAtPosition(CCPoint p);
25 void UpdateWorld(float dt); 26 void UpdateWorld(float dt);
26 bool InitPhysics(); 27 bool InitPhysics();
27 28
28 CCTexture2D* sprite_texture_; 29 CCTexture2D* sprite_texture_;
29 b2World* world_; 30 b2World* world_;
30 }; 31 };
31 32
32 #endif // !PHYSICS_LAYER_H_ 33 #endif // PHYSICS_LAYER_H_
OLDNEW
« nacltoons/src/app_delegate.cc ('K') | « nacltoons/src/gameplay_scene.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698