-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathShell.h
More file actions
33 lines (28 loc) · 1.28 KB
/
Shell.h
File metadata and controls
33 lines (28 loc) · 1.28 KB
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
#pragma once
#include "Object.h"
#include "Hero.h"
class Shell : public Object
{
public:
Shell(sf::String ImageFileAttack, int maxFrameAttackX, int maxFrameAttackY, double speed = 0, int damage = 1 , bool enemyKill = false);
~Shell();
bool enemyKill{ false };
static std::vector<Shell*> shells;
private:
int directionAttackX; int directionAttackY; float range; double speed; double x0; double y0;
int numberTield{ 1 }; int damage; float angle{ 0 };
sf::Clock clock;
double currentFrameAttackX; double currentFrameAttackY; double attackTime{3};
virtual int actionCollisionObjects(Object* obj) override;
int updateAnimation();
public:
void startShot(double x0, double y0, int directionAttackX, int directionAttackY, double range, double speed, float angle);
// Óíàñëåäîâàíî ÷åðåç Object
virtual bool animation(int direction) override;
virtual int update(sf::Event) override;
const int getDamage() { return damage; };
void setDamage(const int newDamage) { this->damage = newDamage; };
/*X: 1 - left, 2 - right, Y: 1 - up, 2 - down*/
static void makeShell(sf::String ImageFileAttack, int maxFrameAttackX, int maxFrameAttackY, double speed, int damage, bool enemyKill, Hero& hero, int directionX, int directionY, float angle);
static void checkIntersectsObjectsUpdate(const sf::Event& event);
};