summaryrefslogtreecommitdiff
path: root/src/gun.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gun.cpp')
-rw-r--r--src/gun.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/gun.cpp b/src/gun.cpp
new file mode 100644
index 0000000..312e1b1
--- /dev/null
+++ b/src/gun.cpp
@@ -0,0 +1,19 @@
+#include "point.h"
+#include "object.h"
+#include "gun.h"
+#include <SFML/Graphics.hpp>
+#include <SFML/Window.hpp>
+
+Gun :: Gun() : Object() {}
+
+Gun :: Gun(const Point &point, const sf::Texture &texture, const int width, const int height) : Object(point) {
+ setTexture(texture);
+ this->sprite.setTexture(texture);
+ this->sprite.setOrigin(sf::Vector2f(width / 2 - 20, height / 2));
+ setWidth(width);
+ setHeight(height);
+}
+
+void Gun :: draw(sf::RenderWindow &window) {
+ window.draw(sprite);
+}