Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2013 The Native Client Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 #ifndef PHYSICS_LAYER_H | |
| 5 #define PHYSICS_LAYER_H | |
| 6 | |
| 7 #include "cocos2d.h" | |
| 8 #include "Box2D/Box2D.h" | |
| 9 | |
| 10 USING_NS_CC; | |
| 11 | |
| 12 /** | |
| 13 * Physics layer that the user interacts with. | |
| 14 */ | |
| 15 class PhysicsLayer : public CCLayerColor | |
| 16 { | |
|
binji
2013/02/12 22:51:53
{ on previous line
Sam Clegg
2013/02/12 23:07:38
Done.
| |
| 17 public: | |
| 18 PhysicsLayer() {} | |
| 19 ~PhysicsLayer(); | |
| 20 CREATE_FUNC(PhysicsLayer); | |
| 21 virtual bool init(); | |
| 22 virtual void ccTouchesEnded(CCSet* touches, CCEvent* event); | |
| 23 | |
| 24 private: | |
| 25 void addNewSpriteAtPosition(CCPoint p); | |
| 26 void updateWorld(float dt); | |
| 27 bool initPhysics(); | |
| 28 | |
| 29 CCTexture2D* sprite_texture_; | |
| 30 b2World* world_; | |
| 31 }; | |
| 32 | |
| 33 #endif // !PHYSICS_LAYER_H | |
| OLD | NEW |