summaryrefslogtreecommitdiff
path: root/engine/enemy.cpp
diff options
context:
space:
mode:
authorVegard Storheil Eriksen <zyp@jvnv.net>2010-05-23 20:19:05 +0200
committerVegard Storheil Eriksen <zyp@jvnv.net>2010-05-23 20:19:05 +0200
commitc74b2de9719f0e0a386e5947b7dc4311d493cc0b (patch)
tree7bc813e6d617c283644f8855b95fbbb13d3f33b9 /engine/enemy.cpp
parent02d326cd9540cdf3aeffceb35ceac2d0fc03faf0 (diff)
Added Enemy-class.
Diffstat (limited to 'engine/enemy.cpp')
-rw-r--r--engine/enemy.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/engine/enemy.cpp b/engine/enemy.cpp
new file mode 100644
index 0000000..bf4d5ee
--- /dev/null
+++ b/engine/enemy.cpp
@@ -0,0 +1,29 @@
+#include "enemy.h"
+
+#include "texturesdl.h"
+
+#include <SDL/SDL_opengl.h>
+
+Enemy::Enemy(const Vector2& initpos) {
+ pos = initpos;
+
+ texture = new TextureSDL("textures/enemy.png");
+}
+
+void Enemy::update() {
+
+}
+
+void Enemy::draw() {
+ glPointSize(32.0);
+
+ glColor4f(1, 1, 1, 1);
+ glEnable(GL_TEXTURE_2D);
+ glBindTexture(GL_TEXTURE_2D, texture->tex());
+
+ glBegin(GL_POINTS);
+ glVertex2f(pos.x, pos.y);
+ glEnd();
+
+ glDisable(GL_TEXTURE_2D);
+} \ No newline at end of file