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

Unified Diff: nacltoons/src/PhysicsLayer.h

Issue 12226130: [nacltoons] Add initial frontend and physics game scenes. (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 side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698