summaryrefslogtreecommitdiff
path: root/src/gun.cpp
blob: 312e1b1d9bd6f51bacf522298e1aefcbcdac2fd7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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);
}