]> git.localhorst.tv Git - sdl-test8.git/blobdiff - src/pong/CountingWall.h
added collision engine, more or less stole gameplay from sdl-test7
[sdl-test8.git] / src / pong / CountingWall.h
diff --git a/src/pong/CountingWall.h b/src/pong/CountingWall.h
new file mode 100644 (file)
index 0000000..c14820d
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * CountingWall.h
+ *
+ *  Created on: Apr 17, 2012
+ *      Author: holy
+ */
+
+#ifndef PONG_COUNTINGWALL_H_
+#define PONG_COUNTINGWALL_H_
+
+#include "../game/Entity.h"
+#include "../shape/AABB.h"
+
+#include <SDL/SDL.h>
+
+namespace pong {
+
+class CountingWall
+: public game::Entity {
+
+       public:
+               CountingWall(Scalar width, Scalar height);
+               virtual ~CountingWall(void);
+
+       public:
+               int HitCount(void) { return count; };
+
+       public:
+               virtual void Collide(Entity &other, const Ray &);
+               virtual void Render(SDL_Surface *dest) const;
+
+       private:
+               shape::AABB shape;
+               int count;
+
+};
+
+}
+
+#endif /* PONG_COUNTINGWALL_H_ */