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

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
« no previous file with comments | « nacltoons/src/GameplayScene.cc ('k') | nacltoons/src/PhysicsLayer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: nacltoons/src/PhysicsLayer.h
diff --git a/nacltoons/src/PhysicsLayer.h b/nacltoons/src/PhysicsLayer.h
new file mode 100644
index 0000000000000000000000000000000000000000..30922bcdd79028dd3690ceae88db3a140195a56b
--- /dev/null
+++ b/nacltoons/src/PhysicsLayer.h
@@ -0,0 +1,32 @@
+// Copyright (c) 2013 The Chromium 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 {
+ 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_
« no previous file with comments | « nacltoons/src/GameplayScene.cc ('k') | nacltoons/src/PhysicsLayer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698