diff options
author | Yann Herklotz <ymherklotz@gmail.com> | 2018-05-19 15:15:20 +0100 |
---|---|---|
committer | Yann Herklotz <ymherklotz@gmail.com> | 2018-05-19 15:15:20 +0100 |
commit | a8de6cb5593e3d6347393eb4c144c9cc22a470d8 (patch) | |
tree | c92063014bb76356acd09a2231e81aa084c49266 /examples/shooter/bullet.cpp | |
parent | 6985227db75f6adfeba880926e6629bf17b00ee8 (diff) | |
download | YAGE-a8de6cb5593e3d6347393eb4c144c9cc22a470d8.tar.gz YAGE-a8de6cb5593e3d6347393eb4c144c9cc22a470d8.zip |
Moving resources and generalising examples
Diffstat (limited to 'examples/shooter/bullet.cpp')
-rw-r--r-- | examples/shooter/bullet.cpp | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/examples/shooter/bullet.cpp b/examples/shooter/bullet.cpp deleted file mode 100644 index c589b4db..00000000 --- a/examples/shooter/bullet.cpp +++ /dev/null @@ -1,33 +0,0 @@ -#include "bullet.h" - -Bullet::Bullet(const glm::vec4 &bound, Direction dir, float speed, float depth) - : bound_(bound), dir_(dir), speed_(speed), depth_(depth) -{ -} - -void Bullet::draw(yage::SpriteBatch &sp) -{ - switch(dir_) { - case Direction::UP: - bound_.y += speed_; - break; - case Direction::DOWN: - bound_.y -= speed_; - break; - case Direction::LEFT: - bound_.x -= speed_; - break; - case Direction::RIGHT: - bound_.x += speed_; - break; - } - sp.draw( - bound_, {0, 0, 1, 1}, - yage::ResourceManager::getTexture("examples/resources/bullet.png").id, - yage::Colour(255, 255, 255, 255), depth_); -} - -glm::vec4 Bullet::position() const -{ - return bound_; -} |