From c74b2de9719f0e0a386e5947b7dc4311d493cc0b Mon Sep 17 00:00:00 2001 From: Vegard Storheil Eriksen Date: Sun, 23 May 2010 20:19:05 +0200 Subject: Added Enemy-class. --- engine/enemy.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 engine/enemy.cpp (limited to 'engine/enemy.cpp') 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 + +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 -- cgit v1.2.3