-
Notifications
You must be signed in to change notification settings - Fork 2
/
enemyShips.h
76 lines (53 loc) · 1.65 KB
/
enemyShips.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
64
65
66
67
68
69
70
71
72
73
74
75
76
//
// Created by BearMace on 06/11/2017.
//
#ifndef LAZCORN_ENEMYSHIPS_H
#define LAZCORN_ENEMYSHIPS_H
#include "Object.h"
#include "pathPoints.h"
#include "equipment.h"
#include <cmath>
#include <iostream>
#include <random>
#include <SFML/Audio/Sound.hpp>
#include <SFML/Audio/SoundBuffer.hpp>
class enemyShips : public Object
{
public:
enemyShips();
enemyShips(int x, int y, int health,int target,int number);
std::default_random_engine el{std::random_device{}()};
std::uniform_int_distribution<int>spawn{0,4};
std::uniform_int_distribution<int>targetPoint{4,10};
int PathNumber;
int PathCount=0;
int target;
int range = 50;
int targetRange = 5;
void ProcessEvents(sf::RenderWindow* window);
std::vector<Object*> projectiles;
sf::Texture enemy_texture;
sf::RectangleShape* HealthBarBackground = new sf::RectangleShape();
sf::RectangleShape* HealthBar = new sf::RectangleShape();
sf::Texture HealthBarBackgroundTexture;
sf::Texture HealthBarTexture;
int bound = 0;
bool exit = false;
sf::Texture* Project_Texture;
float fireRate;
sf::SoundBuffer buffer;
sf::Sound sound;
equipment* weapons[1];
bool EnemyFire = true;
bool can_fire = false;
void Enemy_fire(float time);
void shoot(equipment* weapon, sf::Vector2f velocity);
//enemy movement
int enemymovement(enemyShips* enemy,float time,pathPoints* PP,sf::Vector2f Player,int PlayerWidth, std::vector<Object*> *Bulllet_list);
void setpos(int x, int y){
this->rect.setPosition(x, y);
}
bool Out_bound = false;
void moveOverride() override;
};
#endif //LAZCORN_ENEMYSHIPS_H