diff options
author | Simponic <loganthebean222@gmail.com> | 2020-11-06 11:48:27 -0700 |
---|---|---|
committer | Simponic <loganthebean222@gmail.com> | 2020-11-06 11:48:27 -0700 |
commit | f4e392912a3812b602f787c6db30296cea14962e (patch) | |
tree | 0207b67ab6bb4bca46f56b2fa51d23b5433bb2f4 /src/gun.cpp | |
download | tozy-f4e392912a3812b602f787c6db30296cea14962e.tar.gz tozy-f4e392912a3812b602f787c6db30296cea14962e.zip |
Added files
Diffstat (limited to 'src/gun.cpp')
-rw-r--r-- | src/gun.cpp | 19 |
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); +} |