]> git.localhorst.tv Git - sdl-test8.git/blobdiff - src/pong/CountingWall.cpp
added collision engine, more or less stole gameplay from sdl-test7
[sdl-test8.git] / src / pong / CountingWall.cpp
diff --git a/src/pong/CountingWall.cpp b/src/pong/CountingWall.cpp
new file mode 100644 (file)
index 0000000..4b044a7
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * CountingWall.cpp
+ *
+ *  Created on: Apr 17, 2012
+ *      Author: holy
+ */
+
+#include "CountingWall.h"
+
+#include <limits>
+
+using game::Entity;
+
+
+namespace pong {
+
+CountingWall::CountingWall(Scalar width, Scalar height)
+: Entity(&shape, std::numeric_limits<Scalar>::infinity())
+, shape(width, height)
+, count(0) {
+
+}
+
+CountingWall::~CountingWall(void) {
+
+}
+
+
+void CountingWall::Collide(Entity &, const Ray &) {
+       ++count;
+}
+
+void CountingWall::Render(SDL_Surface *dest) const {
+
+}
+
+}