Chromium Code Reviews| Index: nacltoons/src/PhysicsLayer.h |
| diff --git a/nacltoons/src/PhysicsLayer.h b/nacltoons/src/PhysicsLayer.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..b50a444c50794e9cbb41a34e9cfafff324e17e2b |
| --- /dev/null |
| +++ b/nacltoons/src/PhysicsLayer.h |
| @@ -0,0 +1,33 @@ |
| +// Copyright (c) 2013 The Native Client Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| +#ifndef PHYSICS_LAYER_H |
| +#define PHYSICS_LAYER_H |
| + |
| +#include "cocos2d.h" |
| +#include "Box2D/Box2D.h" |
| + |
| +USING_NS_CC; |
| + |
| +/** |
| + * Physics layer that the user interacts with. |
| + */ |
| +class PhysicsLayer : public CCLayerColor |
| +{ |
|
binji
2013/02/12 22:51:53
{ on previous line
Sam Clegg
2013/02/12 23:07:38
Done.
|
| + public: |
| + PhysicsLayer() {} |
| + ~PhysicsLayer(); |
| + CREATE_FUNC(PhysicsLayer); |
| + virtual bool init(); |
| + virtual void ccTouchesEnded(CCSet* touches, CCEvent* event); |
| + |
| + private: |
| + void addNewSpriteAtPosition(CCPoint p); |
| + void updateWorld(float dt); |
| + bool initPhysics(); |
| + |
| + CCTexture2D* sprite_texture_; |
| + b2World* world_; |
| +}; |
| + |
| +#endif // !PHYSICS_LAYER_H |