Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "Spell.h"
- Spell::Spell()
- {
- }
- void Spell::LoadContent(/*Characters *wizard*/)
- {
- if (!this->m_texture.loadFromFile("res/graphics/" + this->m_path))
- std::cout << "ERROR LOADING SPELL" << std::endl;
- /*if (m_direction == Direction::UP)
- {
- this->m_position.x = 0;
- this->m_position.y = wizard->getPosition().y;
- }
- else if (m_direction == Direction::DOWN)
- {
- this->m_position.x = 0;
- this->m_position.y = wizard->getPosition().y;
- }
- else if(m_direction == Direction::RIGHT)
- {
- this->m_position.x = wizard->getPosition().x;
- this->m_position.y = 0;
- }
- else if (m_direction == Direction::RIGHT)
- {
- this->m_position.x = wizard->getPosition().x;
- this->m_position.y = 0;
- }*/
- this->m_position.x = 100;
- this->m_position.y = 100;
- this->m_sprite.setTexture(this->m_texture);
- this->m_sprite.setPosition(this->m_position);
- this->m_sprite.setOrigin(this->m_texture.getSize().x, this->m_texture.getSize().y);
- this->m_sprite.setColor(sf::Color::Red);
- }
- void Spell::Update()
- {
- if (m_direction == Direction::UP)
- this->m_sprite.move(0, SPEED);
- else if (m_direction == Direction::DOWN)
- this->m_sprite.move(0, -SPEED);
- else if (m_direction == Direction::RIGHT)
- this->m_sprite.move(SPEED, 0);
- else if (m_direction == Direction::LEFT)
- this->m_sprite.move(-SPEED, 0);
- }
- void Spell::Draw(sf::RenderWindow &window)
- {
- window.draw(m_sprite);
- }
- Spell::~Spell()
- {
- }
- Fire::Fire()
- {
- }
- Fire::Fire(Direction direction)
- {
- this->m_path = "spell_fire.png";
- this->m_direction = direction;
- }
- Fire::~Fire()
- {
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement