-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSwordWave.cpp
More file actions
34 lines (28 loc) · 936 Bytes
/
Copy pathSwordWave.cpp
File metadata and controls
34 lines (28 loc) · 936 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include "SwordWave.h"
SwordWave::SwordWave(float x, float y, float velocity, sf::Texture& sheet, sf::Vector2f scale)
:x(x), y(y), velocity(velocity)
{
this->spriteSetPosition(x, y);
this->createHitboxComponent(this->sprite, -20.f, -50.f, 40.f, 100.f);
this->createMovementComponent(10000.f, 0.f, 0.f);
this->createAnimationComponent(sheet, scale, 1, 1);
this->animationComponent->addAnimation("slash", 100.f, 0, 0, 0, 0);
}
SwordWave::~SwordWave()
{
}
HitboxComponent& SwordWave::getHitboxcomponent()
{
return *this->hitboxComponent;
}
void SwordWave::Update(const float& deltaTime)
{
this->animationComponent->play("slash",deltaTime);
this->movementComponent->setveclocity(sf::Vector2f(this->velocity, -9.80665f * 3.f));
this->movementComponent->Update(deltaTime);
}
void SwordWave::Render(sf::RenderTarget& target, sf::Shader* shader)
{
target.draw(this->sprite,shader);
//this->hitboxComponent->Render(target);
}