-
Notifications
You must be signed in to change notification settings - Fork 1
/
Weapon.h
63 lines (50 loc) · 1.24 KB
/
Weapon.h
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#pragma once
#include <SFML/Graphics.hpp>
#include <SFML/Audio.hpp>
#include "Drawable.h"
#include "Missle.h"
#ifndef WEAPON_H
#define WEAPON_H
enum WeaponType{
Integral,
Derivative,
Minus,
Plus,
YellowBall
};
class Weapon : public Drawable
{
private:
int SCREEN_WIDTH;
int SCREEN_HEIGHT;
int bulletFireLimit;
int bulletLeft;
float cooldown;
float distanceFromMouse;
int error;
double damage;
double range;
double speed;
double repeatRate;
std::string missleColider;
std::string directory;
sf::Vector2i destenation;
sf::Vector2f fireFromPosition;
sf::Clock repetition;
Missle **missle;
public:
bool fired;
bool active;
Weapon(WeaponType weaponType = Integral ,int BulletFireLimit = 5,float RepeatRate = 0.25);
~Weapon(void);
int ReturnFirstAvailable(Missle **missle,int MissleAmount );
void WeaponFiring();
void Display(sf::RenderWindow *window);
void Logic(bool FiringLocked = false, sf::Vector2i target = sf::Vector2i(0,0));
void UpdateCollision();
void SetFiringPosition(sf::Vector2f Position);
void SetTargetPosition(sf::Vector2f Position);
void PutScreenSize(int _SCREEN_WIDTH, int _SCREEN_HEIGHT);
int SetWeapon(WeaponType Weapon);
};
#endif